diff --git a/lib/plaid.rb b/lib/plaid.rb deleted file mode 100644 index a3bb39440..000000000 --- a/lib/plaid.rb +++ /dev/null @@ -1,1487 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -# Common files -require 'plaid/api_client' -require 'plaid/api_error' -require 'plaid/version' -require 'plaid/configuration' - -# Models -Plaid.autoload :ACHClass, 'plaid/models/ach_class' -Plaid.autoload :APR, 'plaid/models/apr' -Plaid.autoload :AccountAccess, 'plaid/models/account_access' -Plaid.autoload :AccountAssets, 'plaid/models/account_assets' -Plaid.autoload :AccountBalance, 'plaid/models/account_balance' -Plaid.autoload :AccountBase, 'plaid/models/account_base' -Plaid.autoload :AccountFilter, 'plaid/models/account_filter' -Plaid.autoload :AccountFiltersResponse, 'plaid/models/account_filters_response' -Plaid.autoload :AccountIdentity, 'plaid/models/account_identity' -Plaid.autoload :AccountIdentityAllOf, 'plaid/models/account_identity_all_of' -Plaid.autoload :AccountIdentityMatchScore, 'plaid/models/account_identity_match_score' -Plaid.autoload :AccountIdentityMatchScoreAllOf, 'plaid/models/account_identity_match_score_all_of' -Plaid.autoload :AccountProductAccess, 'plaid/models/account_product_access' -Plaid.autoload :AccountProductAccessNullable, 'plaid/models/account_product_access_nullable' -Plaid.autoload :AccountSelectionCardinality, 'plaid/models/account_selection_cardinality' -Plaid.autoload :AccountSubtype, 'plaid/models/account_subtype' -Plaid.autoload :AccountType, 'plaid/models/account_type' -Plaid.autoload :AccountVerificationInsights, 'plaid/models/account_verification_insights' -Plaid.autoload :AccountVerificationInsightsAccountNumberFormat, 'plaid/models/account_verification_insights_account_number_format' -Plaid.autoload :AccountVerificationInsightsNetworkStatus, 'plaid/models/account_verification_insights_network_status' -Plaid.autoload :AccountVerificationInsightsPreviousReturns, 'plaid/models/account_verification_insights_previous_returns' -Plaid.autoload :AccountsBalanceGetRequest, 'plaid/models/accounts_balance_get_request' -Plaid.autoload :AccountsBalanceGetRequestOptions, 'plaid/models/accounts_balance_get_request_options' -Plaid.autoload :AccountsBalanceGetRequestPaymentDetails, 'plaid/models/accounts_balance_get_request_payment_details' -Plaid.autoload :AccountsBalanceGetResponsePaymentRiskAssessment, 'plaid/models/accounts_balance_get_response_payment_risk_assessment' -Plaid.autoload :AccountsGetRequest, 'plaid/models/accounts_get_request' -Plaid.autoload :AccountsGetRequestOptions, 'plaid/models/accounts_get_request_options' -Plaid.autoload :AccountsGetResponse, 'plaid/models/accounts_get_response' -Plaid.autoload :ActionState, 'plaid/models/action_state' -Plaid.autoload :Activity, 'plaid/models/activity' -Plaid.autoload :ActivityType, 'plaid/models/activity_type' -Plaid.autoload :Address, 'plaid/models/address' -Plaid.autoload :AddressData, 'plaid/models/address_data' -Plaid.autoload :AddressDataNotRequired, 'plaid/models/address_data_not_required' -Plaid.autoload :AddressDataNullable, 'plaid/models/address_data_nullable' -Plaid.autoload :AddressDataNullableNoRequiredFields, 'plaid/models/address_data_nullable_no_required_fields' -Plaid.autoload :AddressMatchScore, 'plaid/models/address_match_score' -Plaid.autoload :AddressNullable, 'plaid/models/address_nullable' -Plaid.autoload :AddressPurposeLabel, 'plaid/models/address_purpose_label' -Plaid.autoload :Application, 'plaid/models/application' -Plaid.autoload :ApplicationGetRequest, 'plaid/models/application_get_request' -Plaid.autoload :ApplicationGetResponse, 'plaid/models/application_get_response' -Plaid.autoload :Asset, 'plaid/models/asset' -Plaid.autoload :AssetDetail, 'plaid/models/asset_detail' -Plaid.autoload :AssetHolder, 'plaid/models/asset_holder' -Plaid.autoload :AssetHolderName, 'plaid/models/asset_holder_name' -Plaid.autoload :AssetOwner, 'plaid/models/asset_owner' -Plaid.autoload :AssetOwners, 'plaid/models/asset_owners' -Plaid.autoload :AssetReport, 'plaid/models/asset_report' -Plaid.autoload :AssetReportAccountBalance, 'plaid/models/asset_report_account_balance' -Plaid.autoload :AssetReportAddOns, 'plaid/models/asset_report_add_ons' -Plaid.autoload :AssetReportAuditCopyCreateRequest, 'plaid/models/asset_report_audit_copy_create_request' -Plaid.autoload :AssetReportAuditCopyCreateResponse, 'plaid/models/asset_report_audit_copy_create_response' -Plaid.autoload :AssetReportAuditCopyGetRequest, 'plaid/models/asset_report_audit_copy_get_request' -Plaid.autoload :AssetReportAuditCopyRemoveRequest, 'plaid/models/asset_report_audit_copy_remove_request' -Plaid.autoload :AssetReportAuditCopyRemoveResponse, 'plaid/models/asset_report_audit_copy_remove_response' -Plaid.autoload :AssetReportCreateRequest, 'plaid/models/asset_report_create_request' -Plaid.autoload :AssetReportCreateRequestOptions, 'plaid/models/asset_report_create_request_options' -Plaid.autoload :AssetReportCreateResponse, 'plaid/models/asset_report_create_response' -Plaid.autoload :AssetReportFilterRequest, 'plaid/models/asset_report_filter_request' -Plaid.autoload :AssetReportFilterResponse, 'plaid/models/asset_report_filter_response' -Plaid.autoload :AssetReportFreddie, 'plaid/models/asset_report_freddie' -Plaid.autoload :AssetReportFreddieGetRequest, 'plaid/models/asset_report_freddie_get_request' -Plaid.autoload :AssetReportFreddieGetResponse, 'plaid/models/asset_report_freddie_get_response' -Plaid.autoload :AssetReportGetRequest, 'plaid/models/asset_report_get_request' -Plaid.autoload :AssetReportGetRequestOptions, 'plaid/models/asset_report_get_request_options' -Plaid.autoload :AssetReportGetResponse, 'plaid/models/asset_report_get_response' -Plaid.autoload :AssetReportInvestmentHolding, 'plaid/models/asset_report_investment_holding' -Plaid.autoload :AssetReportInvestmentSecurity, 'plaid/models/asset_report_investment_security' -Plaid.autoload :AssetReportInvestments, 'plaid/models/asset_report_investments' -Plaid.autoload :AssetReportItem, 'plaid/models/asset_report_item' -Plaid.autoload :AssetReportPDFGetRequest, 'plaid/models/asset_report_pdf_get_request' -Plaid.autoload :AssetReportPDFGetRequestOptions, 'plaid/models/asset_report_pdf_get_request_options' -Plaid.autoload :AssetReportRefreshRequest, 'plaid/models/asset_report_refresh_request' -Plaid.autoload :AssetReportRefreshRequestOptions, 'plaid/models/asset_report_refresh_request_options' -Plaid.autoload :AssetReportRefreshResponse, 'plaid/models/asset_report_refresh_response' -Plaid.autoload :AssetReportRemoveRequest, 'plaid/models/asset_report_remove_request' -Plaid.autoload :AssetReportRemoveResponse, 'plaid/models/asset_report_remove_response' -Plaid.autoload :AssetReportTransaction, 'plaid/models/asset_report_transaction' -Plaid.autoload :AssetReportTransactionType, 'plaid/models/asset_report_transaction_type' -Plaid.autoload :AssetReportUser, 'plaid/models/asset_report_user' -Plaid.autoload :AssetTransaction, 'plaid/models/asset_transaction' -Plaid.autoload :AssetTransactionCategoryType, 'plaid/models/asset_transaction_category_type' -Plaid.autoload :AssetTransactionDescription, 'plaid/models/asset_transaction_description' -Plaid.autoload :AssetTransactionDetail, 'plaid/models/asset_transaction_detail' -Plaid.autoload :AssetTransactionType, 'plaid/models/asset_transaction_type' -Plaid.autoload :AssetTransactions, 'plaid/models/asset_transactions' -Plaid.autoload :AssetType, 'plaid/models/asset_type' -Plaid.autoload :Assets, 'plaid/models/assets' -Plaid.autoload :AssetsErrorWebhook, 'plaid/models/assets_error_webhook' -Plaid.autoload :AssetsProductReadyWebhook, 'plaid/models/assets_product_ready_webhook' -Plaid.autoload :AuthGetNumbers, 'plaid/models/auth_get_numbers' -Plaid.autoload :AuthGetRequest, 'plaid/models/auth_get_request' -Plaid.autoload :AuthGetRequestOptions, 'plaid/models/auth_get_request_options' -Plaid.autoload :AuthGetResponse, 'plaid/models/auth_get_response' -Plaid.autoload :AuthMetadata, 'plaid/models/auth_metadata' -Plaid.autoload :AuthSupportedMethods, 'plaid/models/auth_supported_methods' -Plaid.autoload :AutomaticallyVerifiedWebhook, 'plaid/models/automatically_verified_webhook' -Plaid.autoload :BalancePlusAttributes, 'plaid/models/balance_plus_attributes' -Plaid.autoload :BankIncomeCompleteResult, 'plaid/models/bank_income_complete_result' -Plaid.autoload :BankIncomeCompleteWebhook, 'plaid/models/bank_income_complete_webhook' -Plaid.autoload :BankIncomeRefreshCompleteResult, 'plaid/models/bank_income_refresh_complete_result' -Plaid.autoload :BankIncomeRefreshCompleteWebhook, 'plaid/models/bank_income_refresh_complete_webhook' -Plaid.autoload :BankIncomeRefreshUpdateWebhook, 'plaid/models/bank_income_refresh_update_webhook' -Plaid.autoload :BankInitiatedReturnRisk, 'plaid/models/bank_initiated_return_risk' -Plaid.autoload :BankTransfer, 'plaid/models/bank_transfer' -Plaid.autoload :BankTransferBalance, 'plaid/models/bank_transfer_balance' -Plaid.autoload :BankTransferBalanceGetRequest, 'plaid/models/bank_transfer_balance_get_request' -Plaid.autoload :BankTransferBalanceGetResponse, 'plaid/models/bank_transfer_balance_get_response' -Plaid.autoload :BankTransferCancelRequest, 'plaid/models/bank_transfer_cancel_request' -Plaid.autoload :BankTransferCancelResponse, 'plaid/models/bank_transfer_cancel_response' -Plaid.autoload :BankTransferCreateRequest, 'plaid/models/bank_transfer_create_request' -Plaid.autoload :BankTransferCreateResponse, 'plaid/models/bank_transfer_create_response' -Plaid.autoload :BankTransferDirection, 'plaid/models/bank_transfer_direction' -Plaid.autoload :BankTransferEvent, 'plaid/models/bank_transfer_event' -Plaid.autoload :BankTransferEventListBankTransferType, 'plaid/models/bank_transfer_event_list_bank_transfer_type' -Plaid.autoload :BankTransferEventListDirection, 'plaid/models/bank_transfer_event_list_direction' -Plaid.autoload :BankTransferEventListRequest, 'plaid/models/bank_transfer_event_list_request' -Plaid.autoload :BankTransferEventListResponse, 'plaid/models/bank_transfer_event_list_response' -Plaid.autoload :BankTransferEventSyncRequest, 'plaid/models/bank_transfer_event_sync_request' -Plaid.autoload :BankTransferEventSyncResponse, 'plaid/models/bank_transfer_event_sync_response' -Plaid.autoload :BankTransferEventType, 'plaid/models/bank_transfer_event_type' -Plaid.autoload :BankTransferFailure, 'plaid/models/bank_transfer_failure' -Plaid.autoload :BankTransferGetRequest, 'plaid/models/bank_transfer_get_request' -Plaid.autoload :BankTransferGetResponse, 'plaid/models/bank_transfer_get_response' -Plaid.autoload :BankTransferListRequest, 'plaid/models/bank_transfer_list_request' -Plaid.autoload :BankTransferListResponse, 'plaid/models/bank_transfer_list_response' -Plaid.autoload :BankTransferMigrateAccountRequest, 'plaid/models/bank_transfer_migrate_account_request' -Plaid.autoload :BankTransferMigrateAccountResponse, 'plaid/models/bank_transfer_migrate_account_response' -Plaid.autoload :BankTransferNetwork, 'plaid/models/bank_transfer_network' -Plaid.autoload :BankTransferStatus, 'plaid/models/bank_transfer_status' -Plaid.autoload :BankTransferSweep, 'plaid/models/bank_transfer_sweep' -Plaid.autoload :BankTransferSweepGetRequest, 'plaid/models/bank_transfer_sweep_get_request' -Plaid.autoload :BankTransferSweepGetResponse, 'plaid/models/bank_transfer_sweep_get_response' -Plaid.autoload :BankTransferSweepListRequest, 'plaid/models/bank_transfer_sweep_list_request' -Plaid.autoload :BankTransferSweepListResponse, 'plaid/models/bank_transfer_sweep_list_response' -Plaid.autoload :BankTransferType, 'plaid/models/bank_transfer_type' -Plaid.autoload :BankTransferUser, 'plaid/models/bank_transfer_user' -Plaid.autoload :BankTransfersEventsUpdateWebhook, 'plaid/models/bank_transfers_events_update_webhook' -Plaid.autoload :BankTransfersEventsUpdateWebhookForAuth, 'plaid/models/bank_transfers_events_update_webhook_for_auth' -Plaid.autoload :BaseReport, 'plaid/models/base_report' -Plaid.autoload :BaseReportAccount, 'plaid/models/base_report_account' -Plaid.autoload :BaseReportAccountBalances, 'plaid/models/base_report_account_balances' -Plaid.autoload :BaseReportAccountBalancesAllOf, 'plaid/models/base_report_account_balances_all_of' -Plaid.autoload :BaseReportAccountInsights, 'plaid/models/base_report_account_insights' -Plaid.autoload :BaseReportAverageFlowInsights, 'plaid/models/base_report_average_flow_insights' -Plaid.autoload :BaseReportAverageMonthlyBalances, 'plaid/models/base_report_average_monthly_balances' -Plaid.autoload :BaseReportGetRequest, 'plaid/models/base_report_get_request' -Plaid.autoload :BaseReportGetResponse, 'plaid/models/base_report_get_response' -Plaid.autoload :BaseReportItem, 'plaid/models/base_report_item' -Plaid.autoload :BaseReportLongestGapInsights, 'plaid/models/base_report_longest_gap_insights' -Plaid.autoload :BaseReportNumberFlowInsights, 'plaid/models/base_report_number_flow_insights' -Plaid.autoload :BaseReportTransaction, 'plaid/models/base_report_transaction' -Plaid.autoload :BaseReportWarning, 'plaid/models/base_report_warning' -Plaid.autoload :BaseReportWarningCode, 'plaid/models/base_report_warning_code' -Plaid.autoload :BaseReportsErrorWebhook, 'plaid/models/base_reports_error_webhook' -Plaid.autoload :BaseReportsProductReadyWebhook, 'plaid/models/base_reports_product_ready_webhook' -Plaid.autoload :BeaconAuditTrail, 'plaid/models/beacon_audit_trail' -Plaid.autoload :BeaconAuditTrailSource, 'plaid/models/beacon_audit_trail_source' -Plaid.autoload :BeaconDuplicateDetectedWebhook, 'plaid/models/beacon_duplicate_detected_webhook' -Plaid.autoload :BeaconDuplicateGetRequest, 'plaid/models/beacon_duplicate_get_request' -Plaid.autoload :BeaconDuplicateGetResponse, 'plaid/models/beacon_duplicate_get_response' -Plaid.autoload :BeaconMatchSummaryAnalysis, 'plaid/models/beacon_match_summary_analysis' -Plaid.autoload :BeaconMatchSummaryCode, 'plaid/models/beacon_match_summary_code' -Plaid.autoload :BeaconReport, 'plaid/models/beacon_report' -Plaid.autoload :BeaconReportCreateRequest, 'plaid/models/beacon_report_create_request' -Plaid.autoload :BeaconReportCreateResponse, 'plaid/models/beacon_report_create_response' -Plaid.autoload :BeaconReportCreatedWebhook, 'plaid/models/beacon_report_created_webhook' -Plaid.autoload :BeaconReportGetRequest, 'plaid/models/beacon_report_get_request' -Plaid.autoload :BeaconReportGetResponse, 'plaid/models/beacon_report_get_response' -Plaid.autoload :BeaconReportListRequest, 'plaid/models/beacon_report_list_request' -Plaid.autoload :BeaconReportListResponse, 'plaid/models/beacon_report_list_response' -Plaid.autoload :BeaconReportSyndication, 'plaid/models/beacon_report_syndication' -Plaid.autoload :BeaconReportSyndicationAnalysis, 'plaid/models/beacon_report_syndication_analysis' -Plaid.autoload :BeaconReportSyndicationCreatedWebhook, 'plaid/models/beacon_report_syndication_created_webhook' -Plaid.autoload :BeaconReportSyndicationGetRequest, 'plaid/models/beacon_report_syndication_get_request' -Plaid.autoload :BeaconReportSyndicationGetResponse, 'plaid/models/beacon_report_syndication_get_response' -Plaid.autoload :BeaconReportSyndicationListRequest, 'plaid/models/beacon_report_syndication_list_request' -Plaid.autoload :BeaconReportSyndicationListResponse, 'plaid/models/beacon_report_syndication_list_response' -Plaid.autoload :BeaconReportSyndicationOriginalReport, 'plaid/models/beacon_report_syndication_original_report' -Plaid.autoload :BeaconReportType, 'plaid/models/beacon_report_type' -Plaid.autoload :BeaconReportUpdatedWebhook, 'plaid/models/beacon_report_updated_webhook' -Plaid.autoload :BeaconUserAddress, 'plaid/models/beacon_user_address' -Plaid.autoload :BeaconUserCreateRequest, 'plaid/models/beacon_user_create_request' -Plaid.autoload :BeaconUserCreateResponse, 'plaid/models/beacon_user_create_response' -Plaid.autoload :BeaconUserData, 'plaid/models/beacon_user_data' -Plaid.autoload :BeaconUserGetRequest, 'plaid/models/beacon_user_get_request' -Plaid.autoload :BeaconUserGetResponse, 'plaid/models/beacon_user_get_response' -Plaid.autoload :BeaconUserIDNumber, 'plaid/models/beacon_user_id_number' -Plaid.autoload :BeaconUserName, 'plaid/models/beacon_user_name' -Plaid.autoload :BeaconUserNameNullable, 'plaid/models/beacon_user_name_nullable' -Plaid.autoload :BeaconUserRequestAddress, 'plaid/models/beacon_user_request_address' -Plaid.autoload :BeaconUserRequestAddressNullable, 'plaid/models/beacon_user_request_address_nullable' -Plaid.autoload :BeaconUserRequestData, 'plaid/models/beacon_user_request_data' -Plaid.autoload :BeaconUserReviewRequest, 'plaid/models/beacon_user_review_request' -Plaid.autoload :BeaconUserRevision, 'plaid/models/beacon_user_revision' -Plaid.autoload :BeaconUserStatus, 'plaid/models/beacon_user_status' -Plaid.autoload :BeaconUserStatusUpdatedWebhook, 'plaid/models/beacon_user_status_updated_webhook' -Plaid.autoload :BeaconUserUpdateRequest, 'plaid/models/beacon_user_update_request' -Plaid.autoload :BeaconUserUpdateRequestData, 'plaid/models/beacon_user_update_request_data' -Plaid.autoload :BeaconUserUpdateResponse, 'plaid/models/beacon_user_update_response' -Plaid.autoload :CategoriesGetResponse, 'plaid/models/categories_get_response' -Plaid.autoload :Category, 'plaid/models/category' -Plaid.autoload :CategoryInsightDetails, 'plaid/models/category_insight_details' -Plaid.autoload :CategoryInsights, 'plaid/models/category_insights' -Plaid.autoload :Cause, 'plaid/models/cause' -Plaid.autoload :CauseAllOf, 'plaid/models/cause_all_of' -Plaid.autoload :ClientProvidedEnhancedTransaction, 'plaid/models/client_provided_enhanced_transaction' -Plaid.autoload :ClientProvidedEnrichedTransaction, 'plaid/models/client_provided_enriched_transaction' -Plaid.autoload :ClientProvidedRawTransaction, 'plaid/models/client_provided_raw_transaction' -Plaid.autoload :ClientProvidedTransaction, 'plaid/models/client_provided_transaction' -Plaid.autoload :ClientProvidedTransactionLocation, 'plaid/models/client_provided_transaction_location' -Plaid.autoload :ConnectedApplication, 'plaid/models/connected_application' -Plaid.autoload :ConsumerReportPermissiblePurpose, 'plaid/models/consumer_report_permissible_purpose' -Plaid.autoload :ConsumerReportUserIdentity, 'plaid/models/consumer_report_user_identity' -Plaid.autoload :Counterparty, 'plaid/models/counterparty' -Plaid.autoload :CounterpartyInsights, 'plaid/models/counterparty_insights' -Plaid.autoload :CounterpartyType, 'plaid/models/counterparty_type' -Plaid.autoload :CountryCode, 'plaid/models/country_code' -Plaid.autoload :CraBankIncome, 'plaid/models/cra_bank_income' -Plaid.autoload :CraBankIncomeAccount, 'plaid/models/cra_bank_income_account' -Plaid.autoload :CraBankIncomeCause, 'plaid/models/cra_bank_income_cause' -Plaid.autoload :CraBankIncomeCompleteResult, 'plaid/models/cra_bank_income_complete_result' -Plaid.autoload :CraBankIncomeCompleteWebhook, 'plaid/models/cra_bank_income_complete_webhook' -Plaid.autoload :CraBankIncomeEmployer, 'plaid/models/cra_bank_income_employer' -Plaid.autoload :CraBankIncomeGetRequest, 'plaid/models/cra_bank_income_get_request' -Plaid.autoload :CraBankIncomeGetResponse, 'plaid/models/cra_bank_income_get_response' -Plaid.autoload :CraBankIncomeHistoricalSummary, 'plaid/models/cra_bank_income_historical_summary' -Plaid.autoload :CraBankIncomeItem, 'plaid/models/cra_bank_income_item' -Plaid.autoload :CraBankIncomeSource, 'plaid/models/cra_bank_income_source' -Plaid.autoload :CraBankIncomeSummary, 'plaid/models/cra_bank_income_summary' -Plaid.autoload :CraBankIncomeTransaction, 'plaid/models/cra_bank_income_transaction' -Plaid.autoload :CraBankIncomeWarning, 'plaid/models/cra_bank_income_warning' -Plaid.autoload :CraBankIncomeWarningCode, 'plaid/models/cra_bank_income_warning_code' -Plaid.autoload :CraPartnerInsights, 'plaid/models/cra_partner_insights' -Plaid.autoload :CraPartnerInsightsCompleteResult, 'plaid/models/cra_partner_insights_complete_result' -Plaid.autoload :CraPartnerInsightsCompleteWebhook, 'plaid/models/cra_partner_insights_complete_webhook' -Plaid.autoload :CraPartnerInsightsGetRequest, 'plaid/models/cra_partner_insights_get_request' -Plaid.autoload :CraPartnerInsightsGetResponse, 'plaid/models/cra_partner_insights_get_response' -Plaid.autoload :CraPartnerInsightsItem, 'plaid/models/cra_partner_insights_item' -Plaid.autoload :CraPartnerInsightsItemAccount, 'plaid/models/cra_partner_insights_item_account' -Plaid.autoload :CraPartnerInsightsPrism, 'plaid/models/cra_partner_insights_prism' -Plaid.autoload :CraPredictionInterval, 'plaid/models/cra_prediction_interval' -Plaid.autoload :Credit1099, 'plaid/models/credit1099' -Plaid.autoload :Credit1099Filer, 'plaid/models/credit1099_filer' -Plaid.autoload :Credit1099Payer, 'plaid/models/credit1099_payer' -Plaid.autoload :Credit1099Recipient, 'plaid/models/credit1099_recipient' -Plaid.autoload :CreditACHClass, 'plaid/models/credit_ach_class' -Plaid.autoload :CreditAccountSubtype, 'plaid/models/credit_account_subtype' -Plaid.autoload :CreditAmountWithCurrency, 'plaid/models/credit_amount_with_currency' -Plaid.autoload :CreditAuditCopyTokenCreateRequest, 'plaid/models/credit_audit_copy_token_create_request' -Plaid.autoload :CreditAuditCopyTokenCreateResponse, 'plaid/models/credit_audit_copy_token_create_response' -Plaid.autoload :CreditAuditCopyTokenRemoveRequest, 'plaid/models/credit_audit_copy_token_remove_request' -Plaid.autoload :CreditAuditCopyTokenRemoveResponse, 'plaid/models/credit_audit_copy_token_remove_response' -Plaid.autoload :CreditAuditCopyTokenUpdateRequest, 'plaid/models/credit_audit_copy_token_update_request' -Plaid.autoload :CreditAuditCopyTokenUpdateResponse, 'plaid/models/credit_audit_copy_token_update_response' -Plaid.autoload :CreditBankEmployer, 'plaid/models/credit_bank_employer' -Plaid.autoload :CreditBankEmployment, 'plaid/models/credit_bank_employment' -Plaid.autoload :CreditBankEmploymentGetRequest, 'plaid/models/credit_bank_employment_get_request' -Plaid.autoload :CreditBankEmploymentGetResponse, 'plaid/models/credit_bank_employment_get_response' -Plaid.autoload :CreditBankEmploymentItem, 'plaid/models/credit_bank_employment_item' -Plaid.autoload :CreditBankEmploymentReport, 'plaid/models/credit_bank_employment_report' -Plaid.autoload :CreditBankEmploymentWarning, 'plaid/models/credit_bank_employment_warning' -Plaid.autoload :CreditBankEmploymentWarningType, 'plaid/models/credit_bank_employment_warning_type' -Plaid.autoload :CreditBankIncome, 'plaid/models/credit_bank_income' -Plaid.autoload :CreditBankIncomeAccount, 'plaid/models/credit_bank_income_account' -Plaid.autoload :CreditBankIncomeAccountType, 'plaid/models/credit_bank_income_account_type' -Plaid.autoload :CreditBankIncomeCategory, 'plaid/models/credit_bank_income_category' -Plaid.autoload :CreditBankIncomeCause, 'plaid/models/credit_bank_income_cause' -Plaid.autoload :CreditBankIncomeErrorType, 'plaid/models/credit_bank_income_error_type' -Plaid.autoload :CreditBankIncomeGetRequest, 'plaid/models/credit_bank_income_get_request' -Plaid.autoload :CreditBankIncomeGetRequestOptions, 'plaid/models/credit_bank_income_get_request_options' -Plaid.autoload :CreditBankIncomeGetResponse, 'plaid/models/credit_bank_income_get_response' -Plaid.autoload :CreditBankIncomeHistoricalSummary, 'plaid/models/credit_bank_income_historical_summary' -Plaid.autoload :CreditBankIncomeItem, 'plaid/models/credit_bank_income_item' -Plaid.autoload :CreditBankIncomePDFGetRequest, 'plaid/models/credit_bank_income_pdf_get_request' -Plaid.autoload :CreditBankIncomePayFrequency, 'plaid/models/credit_bank_income_pay_frequency' -Plaid.autoload :CreditBankIncomeRefreshRequest, 'plaid/models/credit_bank_income_refresh_request' -Plaid.autoload :CreditBankIncomeRefreshRequestOptions, 'plaid/models/credit_bank_income_refresh_request_options' -Plaid.autoload :CreditBankIncomeRefreshResponse, 'plaid/models/credit_bank_income_refresh_response' -Plaid.autoload :CreditBankIncomeSource, 'plaid/models/credit_bank_income_source' -Plaid.autoload :CreditBankIncomeSummary, 'plaid/models/credit_bank_income_summary' -Plaid.autoload :CreditBankIncomeTransaction, 'plaid/models/credit_bank_income_transaction' -Plaid.autoload :CreditBankIncomeWarning, 'plaid/models/credit_bank_income_warning' -Plaid.autoload :CreditBankIncomeWarningCode, 'plaid/models/credit_bank_income_warning_code' -Plaid.autoload :CreditBankIncomeWarningType, 'plaid/models/credit_bank_income_warning_type' -Plaid.autoload :CreditBankIncomeWebhookUpdateRequest, 'plaid/models/credit_bank_income_webhook_update_request' -Plaid.autoload :CreditBankIncomeWebhookUpdateResponse, 'plaid/models/credit_bank_income_webhook_update_response' -Plaid.autoload :CreditBankStatementUploadAccountOwner, 'plaid/models/credit_bank_statement_upload_account_owner' -Plaid.autoload :CreditBankStatementUploadAccountOwnerAddress, 'plaid/models/credit_bank_statement_upload_account_owner_address' -Plaid.autoload :CreditBankStatementUploadBankAccount, 'plaid/models/credit_bank_statement_upload_bank_account' -Plaid.autoload :CreditBankStatementUploadBankAccountPeriod, 'plaid/models/credit_bank_statement_upload_bank_account_period' -Plaid.autoload :CreditBankStatementUploadItem, 'plaid/models/credit_bank_statement_upload_item' -Plaid.autoload :CreditBankStatementUploadObject, 'plaid/models/credit_bank_statement_upload_object' -Plaid.autoload :CreditBankStatementUploadTransaction, 'plaid/models/credit_bank_statement_upload_transaction' -Plaid.autoload :CreditBankStatementsUploadsGetRequest, 'plaid/models/credit_bank_statements_uploads_get_request' -Plaid.autoload :CreditBankStatementsUploadsGetRequestOptions, 'plaid/models/credit_bank_statements_uploads_get_request_options' -Plaid.autoload :CreditBankStatementsUploadsGetResponse, 'plaid/models/credit_bank_statements_uploads_get_response' -Plaid.autoload :CreditCardLiability, 'plaid/models/credit_card_liability' -Plaid.autoload :CreditCategory, 'plaid/models/credit_category' -Plaid.autoload :CreditDocumentMetadata, 'plaid/models/credit_document_metadata' -Plaid.autoload :CreditEmployerVerification, 'plaid/models/credit_employer_verification' -Plaid.autoload :CreditEmploymentGetRequest, 'plaid/models/credit_employment_get_request' -Plaid.autoload :CreditEmploymentGetResponse, 'plaid/models/credit_employment_get_response' -Plaid.autoload :CreditEmploymentItem, 'plaid/models/credit_employment_item' -Plaid.autoload :CreditEmploymentVerification, 'plaid/models/credit_employment_verification' -Plaid.autoload :CreditFilter, 'plaid/models/credit_filter' -Plaid.autoload :CreditFreddieMacAsset, 'plaid/models/credit_freddie_mac_asset' -Plaid.autoload :CreditFreddieMacAssetTransaction, 'plaid/models/credit_freddie_mac_asset_transaction' -Plaid.autoload :CreditFreddieMacAssetTransactions, 'plaid/models/credit_freddie_mac_asset_transactions' -Plaid.autoload :CreditFreddieMacAssets, 'plaid/models/credit_freddie_mac_assets' -Plaid.autoload :CreditFreddieMacIndividualName, 'plaid/models/credit_freddie_mac_individual_name' -Plaid.autoload :CreditFreddieMacLoan, 'plaid/models/credit_freddie_mac_loan' -Plaid.autoload :CreditFreddieMacLoanIdentifiers, 'plaid/models/credit_freddie_mac_loan_identifiers' -Plaid.autoload :CreditFreddieMacLoans, 'plaid/models/credit_freddie_mac_loans' -Plaid.autoload :CreditFreddieMacParties, 'plaid/models/credit_freddie_mac_parties' -Plaid.autoload :CreditFreddieMacParty, 'plaid/models/credit_freddie_mac_party' -Plaid.autoload :CreditFreddieMacPartyIndividual, 'plaid/models/credit_freddie_mac_party_individual' -Plaid.autoload :CreditFreddieMacReportingInformation, 'plaid/models/credit_freddie_mac_reporting_information' -Plaid.autoload :CreditFreddieMacReportsGetRequest, 'plaid/models/credit_freddie_mac_reports_get_request' -Plaid.autoload :CreditFreddieMacReportsGetResponse, 'plaid/models/credit_freddie_mac_reports_get_response' -Plaid.autoload :CreditFreddieMacService, 'plaid/models/credit_freddie_mac_service' -Plaid.autoload :CreditFreddieMacServices, 'plaid/models/credit_freddie_mac_services' -Plaid.autoload :CreditFreddieMacVerificationOfAsset, 'plaid/models/credit_freddie_mac_verification_of_asset' -Plaid.autoload :CreditFreddieMacVerificationOfAssetResponse, 'plaid/models/credit_freddie_mac_verification_of_asset_response' -Plaid.autoload :CreditFreddieMacVerificationOfAssetsDeal, 'plaid/models/credit_freddie_mac_verification_of_assets_deal' -Plaid.autoload :CreditPayStub, 'plaid/models/credit_pay_stub' -Plaid.autoload :CreditPayStubAddress, 'plaid/models/credit_pay_stub_address' -Plaid.autoload :CreditPayStubDeductions, 'plaid/models/credit_pay_stub_deductions' -Plaid.autoload :CreditPayStubEarnings, 'plaid/models/credit_pay_stub_earnings' -Plaid.autoload :CreditPayStubEmployee, 'plaid/models/credit_pay_stub_employee' -Plaid.autoload :CreditPayStubEmployer, 'plaid/models/credit_pay_stub_employer' -Plaid.autoload :CreditPayStubNetPay, 'plaid/models/credit_pay_stub_net_pay' -Plaid.autoload :CreditPayStubPayBasisType, 'plaid/models/credit_pay_stub_pay_basis_type' -Plaid.autoload :CreditPayrollIncomeGetRequest, 'plaid/models/credit_payroll_income_get_request' -Plaid.autoload :CreditPayrollIncomeGetRequestOptions, 'plaid/models/credit_payroll_income_get_request_options' -Plaid.autoload :CreditPayrollIncomeGetResponse, 'plaid/models/credit_payroll_income_get_response' -Plaid.autoload :CreditPayrollIncomeParsingConfigUpdateRequest, 'plaid/models/credit_payroll_income_parsing_config_update_request' -Plaid.autoload :CreditPayrollIncomeParsingConfigUpdateResponse, 'plaid/models/credit_payroll_income_parsing_config_update_response' -Plaid.autoload :CreditPayrollIncomePrecheckRequest, 'plaid/models/credit_payroll_income_precheck_request' -Plaid.autoload :CreditPayrollIncomePrecheckResponse, 'plaid/models/credit_payroll_income_precheck_response' -Plaid.autoload :CreditPayrollIncomeRefreshRequest, 'plaid/models/credit_payroll_income_refresh_request' -Plaid.autoload :CreditPayrollIncomeRefreshRequestOptions, 'plaid/models/credit_payroll_income_refresh_request_options' -Plaid.autoload :CreditPayrollIncomeRefreshResponse, 'plaid/models/credit_payroll_income_refresh_response' -Plaid.autoload :CreditPayrollIncomeRiskSignalsGetRequest, 'plaid/models/credit_payroll_income_risk_signals_get_request' -Plaid.autoload :CreditPayrollIncomeRiskSignalsGetResponse, 'plaid/models/credit_payroll_income_risk_signals_get_response' -Plaid.autoload :CreditPlatformIds, 'plaid/models/credit_platform_ids' -Plaid.autoload :CreditRelayCreateRequest, 'plaid/models/credit_relay_create_request' -Plaid.autoload :CreditRelayCreateResponse, 'plaid/models/credit_relay_create_response' -Plaid.autoload :CreditRelayGetRequest, 'plaid/models/credit_relay_get_request' -Plaid.autoload :CreditRelayPDFGetRequest, 'plaid/models/credit_relay_pdf_get_request' -Plaid.autoload :CreditRelayRefreshRequest, 'plaid/models/credit_relay_refresh_request' -Plaid.autoload :CreditRelayRefreshResponse, 'plaid/models/credit_relay_refresh_response' -Plaid.autoload :CreditRelayRemoveRequest, 'plaid/models/credit_relay_remove_request' -Plaid.autoload :CreditRelayRemoveResponse, 'plaid/models/credit_relay_remove_response' -Plaid.autoload :CreditSession, 'plaid/models/credit_session' -Plaid.autoload :CreditSessionBankEmploymentResult, 'plaid/models/credit_session_bank_employment_result' -Plaid.autoload :CreditSessionBankEmploymentStatus, 'plaid/models/credit_session_bank_employment_status' -Plaid.autoload :CreditSessionBankIncomeResult, 'plaid/models/credit_session_bank_income_result' -Plaid.autoload :CreditSessionBankIncomeStatus, 'plaid/models/credit_session_bank_income_status' -Plaid.autoload :CreditSessionDocumentIncomeResult, 'plaid/models/credit_session_document_income_result' -Plaid.autoload :CreditSessionError, 'plaid/models/credit_session_error' -Plaid.autoload :CreditSessionItemAddResult, 'plaid/models/credit_session_item_add_result' -Plaid.autoload :CreditSessionPayrollIncomeResult, 'plaid/models/credit_session_payroll_income_result' -Plaid.autoload :CreditSessionResults, 'plaid/models/credit_session_results' -Plaid.autoload :CreditSessionsGetRequest, 'plaid/models/credit_sessions_get_request' -Plaid.autoload :CreditSessionsGetResponse, 'plaid/models/credit_sessions_get_response' -Plaid.autoload :CreditW2, 'plaid/models/credit_w2' -Plaid.autoload :CustomerInitiatedReturnRisk, 'plaid/models/customer_initiated_return_risk' -Plaid.autoload :DashboardUser, 'plaid/models/dashboard_user' -Plaid.autoload :DashboardUserGetRequest, 'plaid/models/dashboard_user_get_request' -Plaid.autoload :DashboardUserGetResponse, 'plaid/models/dashboard_user_get_response' -Plaid.autoload :DashboardUserListRequest, 'plaid/models/dashboard_user_list_request' -Plaid.autoload :DashboardUserListResponse, 'plaid/models/dashboard_user_list_response' -Plaid.autoload :DashboardUserStatus, 'plaid/models/dashboard_user_status' -Plaid.autoload :DateRange, 'plaid/models/date_range' -Plaid.autoload :Deductions, 'plaid/models/deductions' -Plaid.autoload :DeductionsBreakdown, 'plaid/models/deductions_breakdown' -Plaid.autoload :DeductionsTotal, 'plaid/models/deductions_total' -Plaid.autoload :DefaultUpdateWebhook, 'plaid/models/default_update_webhook' -Plaid.autoload :DepositSwitchAddressData, 'plaid/models/deposit_switch_address_data' -Plaid.autoload :DepositSwitchAltCreateRequest, 'plaid/models/deposit_switch_alt_create_request' -Plaid.autoload :DepositSwitchAltCreateResponse, 'plaid/models/deposit_switch_alt_create_response' -Plaid.autoload :DepositSwitchCreateRequest, 'plaid/models/deposit_switch_create_request' -Plaid.autoload :DepositSwitchCreateRequestOptions, 'plaid/models/deposit_switch_create_request_options' -Plaid.autoload :DepositSwitchCreateResponse, 'plaid/models/deposit_switch_create_response' -Plaid.autoload :DepositSwitchGetRequest, 'plaid/models/deposit_switch_get_request' -Plaid.autoload :DepositSwitchGetResponse, 'plaid/models/deposit_switch_get_response' -Plaid.autoload :DepositSwitchStateUpdateWebhook, 'plaid/models/deposit_switch_state_update_webhook' -Plaid.autoload :DepositSwitchTargetAccount, 'plaid/models/deposit_switch_target_account' -Plaid.autoload :DepositSwitchTargetUser, 'plaid/models/deposit_switch_target_user' -Plaid.autoload :DepositSwitchTokenCreateRequest, 'plaid/models/deposit_switch_token_create_request' -Plaid.autoload :DepositSwitchTokenCreateResponse, 'plaid/models/deposit_switch_token_create_response' -Plaid.autoload :DepositoryAccountSubtype, 'plaid/models/depository_account_subtype' -Plaid.autoload :DepositoryFilter, 'plaid/models/depository_filter' -Plaid.autoload :DetailedOriginator, 'plaid/models/detailed_originator' -Plaid.autoload :DetectedAccount, 'plaid/models/detected_account' -Plaid.autoload :DistributionBreakdown, 'plaid/models/distribution_breakdown' -Plaid.autoload :DocType, 'plaid/models/doc_type' -Plaid.autoload :DocumentAnalysis, 'plaid/models/document_analysis' -Plaid.autoload :DocumentAuthenticityMatchCode, 'plaid/models/document_authenticity_match_code' -Plaid.autoload :DocumentDateOfBirthMatchCode, 'plaid/models/document_date_of_birth_match_code' -Plaid.autoload :DocumentMetadata, 'plaid/models/document_metadata' -Plaid.autoload :DocumentNameMatchCode, 'plaid/models/document_name_match_code' -Plaid.autoload :DocumentRiskSignal, 'plaid/models/document_risk_signal' -Plaid.autoload :DocumentRiskSignalInstitutionMetadata, 'plaid/models/document_risk_signal_institution_metadata' -Plaid.autoload :DocumentRiskSignalsObject, 'plaid/models/document_risk_signals_object' -Plaid.autoload :DocumentRiskSummary, 'plaid/models/document_risk_summary' -Plaid.autoload :DocumentStatus, 'plaid/models/document_status' -Plaid.autoload :DocumentaryVerification, 'plaid/models/documentary_verification' -Plaid.autoload :DocumentaryVerificationDocument, 'plaid/models/documentary_verification_document' -Plaid.autoload :Earnings, 'plaid/models/earnings' -Plaid.autoload :EarningsBreakdown, 'plaid/models/earnings_breakdown' -Plaid.autoload :EarningsBreakdownCanonicalDescription, 'plaid/models/earnings_breakdown_canonical_description' -Plaid.autoload :EarningsTotal, 'plaid/models/earnings_total' -Plaid.autoload :Email, 'plaid/models/email' -Plaid.autoload :EmailAddressMatchScore, 'plaid/models/email_address_match_score' -Plaid.autoload :Employee, 'plaid/models/employee' -Plaid.autoload :EmployeeIncomeSummaryFieldString, 'plaid/models/employee_income_summary_field_string' -Plaid.autoload :Employer, 'plaid/models/employer' -Plaid.autoload :EmployerIncomeSummaryFieldString, 'plaid/models/employer_income_summary_field_string' -Plaid.autoload :EmployerVerification, 'plaid/models/employer_verification' -Plaid.autoload :EmployersSearchRequest, 'plaid/models/employers_search_request' -Plaid.autoload :EmployersSearchResponse, 'plaid/models/employers_search_response' -Plaid.autoload :EmploymentDetails, 'plaid/models/employment_details' -Plaid.autoload :EmploymentSourceType, 'plaid/models/employment_source_type' -Plaid.autoload :EmploymentVerification, 'plaid/models/employment_verification' -Plaid.autoload :EmploymentVerificationGetRequest, 'plaid/models/employment_verification_get_request' -Plaid.autoload :EmploymentVerificationGetResponse, 'plaid/models/employment_verification_get_response' -Plaid.autoload :EmploymentVerificationStatus, 'plaid/models/employment_verification_status' -Plaid.autoload :Enhancements, 'plaid/models/enhancements' -Plaid.autoload :EnrichTransactionDirection, 'plaid/models/enrich_transaction_direction' -Plaid.autoload :Enrichments, 'plaid/models/enrichments' -Plaid.autoload :EntityDocument, 'plaid/models/entity_document' -Plaid.autoload :EntityDocumentType, 'plaid/models/entity_document_type' -Plaid.autoload :EntityScreeningHitAnalysis, 'plaid/models/entity_screening_hit_analysis' -Plaid.autoload :EntityScreeningHitData, 'plaid/models/entity_screening_hit_data' -Plaid.autoload :EntityScreeningHitDocumentsItems, 'plaid/models/entity_screening_hit_documents_items' -Plaid.autoload :EntityScreeningHitEmails, 'plaid/models/entity_screening_hit_emails' -Plaid.autoload :EntityScreeningHitEmailsItems, 'plaid/models/entity_screening_hit_emails_items' -Plaid.autoload :EntityScreeningHitNames, 'plaid/models/entity_screening_hit_names' -Plaid.autoload :EntityScreeningHitNamesItems, 'plaid/models/entity_screening_hit_names_items' -Plaid.autoload :EntityScreeningHitPhoneNumbers, 'plaid/models/entity_screening_hit_phone_numbers' -Plaid.autoload :EntityScreeningHitUrls, 'plaid/models/entity_screening_hit_urls' -Plaid.autoload :EntityScreeningHitUrlsItems, 'plaid/models/entity_screening_hit_urls_items' -Plaid.autoload :EntityScreeningHitsPhoneNumberItems, 'plaid/models/entity_screening_hits_phone_number_items' -Plaid.autoload :EntityScreeningStatusUpdatedWebhook, 'plaid/models/entity_screening_status_updated_webhook' -Plaid.autoload :EntityWatchlistCode, 'plaid/models/entity_watchlist_code' -Plaid.autoload :EntityWatchlistProgram, 'plaid/models/entity_watchlist_program' -Plaid.autoload :EntityWatchlistScreening, 'plaid/models/entity_watchlist_screening' -Plaid.autoload :EntityWatchlistScreeningHit, 'plaid/models/entity_watchlist_screening_hit' -Plaid.autoload :EntityWatchlistScreeningReview, 'plaid/models/entity_watchlist_screening_review' -Plaid.autoload :EntityWatchlistScreeningSearchTerms, 'plaid/models/entity_watchlist_screening_search_terms' -Plaid.autoload :EntityWatchlistSearchTerms, 'plaid/models/entity_watchlist_search_terms' -Plaid.autoload :ExpirationDate, 'plaid/models/expiration_date' -Plaid.autoload :ExternalPaymentInitiationConsentOptions, 'plaid/models/external_payment_initiation_consent_options' -Plaid.autoload :ExternalPaymentOptions, 'plaid/models/external_payment_options' -Plaid.autoload :ExternalPaymentRefundDetails, 'plaid/models/external_payment_refund_details' -Plaid.autoload :ExternalPaymentScheduleBase, 'plaid/models/external_payment_schedule_base' -Plaid.autoload :ExternalPaymentScheduleGet, 'plaid/models/external_payment_schedule_get' -Plaid.autoload :ExternalPaymentScheduleRequest, 'plaid/models/external_payment_schedule_request' -Plaid.autoload :FDXContentTypes, 'plaid/models/fdx_content_types' -Plaid.autoload :FDXFiAttribute, 'plaid/models/fdxfi_attribute' -Plaid.autoload :FDXHateoasLink, 'plaid/models/fdx_hateoas_link' -Plaid.autoload :FDXHateoasLinkAction, 'plaid/models/fdx_hateoas_link_action' -Plaid.autoload :FDXInitiatorFiAttribute, 'plaid/models/fdx_initiator_fi_attribute' -Plaid.autoload :FDXNotification, 'plaid/models/fdx_notification' -Plaid.autoload :FDXNotificationCategory, 'plaid/models/fdx_notification_category' -Plaid.autoload :FDXNotificationPayload, 'plaid/models/fdx_notification_payload' -Plaid.autoload :FDXNotificationPayloadIdType, 'plaid/models/fdx_notification_payload_id_type' -Plaid.autoload :FDXNotificationPriority, 'plaid/models/fdx_notification_priority' -Plaid.autoload :FDXNotificationSeverity, 'plaid/models/fdx_notification_severity' -Plaid.autoload :FDXNotificationType, 'plaid/models/fdx_notification_type' -Plaid.autoload :FDXParty, 'plaid/models/fdx_party' -Plaid.autoload :FDXPartyRegistry, 'plaid/models/fdx_party_registry' -Plaid.autoload :FDXPartyType, 'plaid/models/fdx_party_type' -Plaid.autoload :FallbackAuthMicrodepositAutoVerifiedWebhook, 'plaid/models/fallback_auth_microdeposit_auto_verified_webhook' -Plaid.autoload :FallbackAuthMicrodepositVerificationExpiredWebhook, 'plaid/models/fallback_auth_microdeposit_verification_expired_webhook' -Plaid.autoload :FinancialInstitutionInsights, 'plaid/models/financial_institution_insights' -Plaid.autoload :Form1099Type, 'plaid/models/form1099_type' -Plaid.autoload :FraudAmount, 'plaid/models/fraud_amount' -Plaid.autoload :GenericScreeningHitLocationItems, 'plaid/models/generic_screening_hit_location_items' -Plaid.autoload :HealthIncident, 'plaid/models/health_incident' -Plaid.autoload :HistoricalBalance, 'plaid/models/historical_balance' -Plaid.autoload :HistoricalUpdateWebhook, 'plaid/models/historical_update_webhook' -Plaid.autoload :Holding, 'plaid/models/holding' -Plaid.autoload :HoldingsDefaultUpdateWebhook, 'plaid/models/holdings_default_update_webhook' -Plaid.autoload :HoldingsOverride, 'plaid/models/holdings_override' -Plaid.autoload :HostedLinkDeliveryMethod, 'plaid/models/hosted_link_delivery_method' -Plaid.autoload :HostedMMDVerificationWebhook, 'plaid/models/hosted_mmd_verification_webhook' -Plaid.autoload :IDNumberType, 'plaid/models/id_number_type' -Plaid.autoload :ISOCurrencyCode, 'plaid/models/iso_currency_code' -Plaid.autoload :IdentityDefaultUpdateWebhook, 'plaid/models/identity_default_update_webhook' -Plaid.autoload :IdentityDocument, 'plaid/models/identity_document' -Plaid.autoload :IdentityDocumentMetadata, 'plaid/models/identity_document_metadata' -Plaid.autoload :IdentityGetRequest, 'plaid/models/identity_get_request' -Plaid.autoload :IdentityGetRequestOptions, 'plaid/models/identity_get_request_options' -Plaid.autoload :IdentityGetResponse, 'plaid/models/identity_get_response' -Plaid.autoload :IdentityMatchRequest, 'plaid/models/identity_match_request' -Plaid.autoload :IdentityMatchRequestOptions, 'plaid/models/identity_match_request_options' -Plaid.autoload :IdentityMatchResponse, 'plaid/models/identity_match_response' -Plaid.autoload :IdentityMatchUser, 'plaid/models/identity_match_user' -Plaid.autoload :IdentityRefreshRequest, 'plaid/models/identity_refresh_request' -Plaid.autoload :IdentityRefreshResponse, 'plaid/models/identity_refresh_response' -Plaid.autoload :IdentityUpdateTypes, 'plaid/models/identity_update_types' -Plaid.autoload :IdentityVerification, 'plaid/models/identity_verification' -Plaid.autoload :IdentityVerificationAutofillAddress, 'plaid/models/identity_verification_autofill_address' -Plaid.autoload :IdentityVerificationAutofillCreateRequest, 'plaid/models/identity_verification_autofill_create_request' -Plaid.autoload :IdentityVerificationAutofillCreateResponse, 'plaid/models/identity_verification_autofill_create_response' -Plaid.autoload :IdentityVerificationAutofillStatus, 'plaid/models/identity_verification_autofill_status' -Plaid.autoload :IdentityVerificationAutofillUserData, 'plaid/models/identity_verification_autofill_user_data' -Plaid.autoload :IdentityVerificationCreateRequest, 'plaid/models/identity_verification_create_request' -Plaid.autoload :IdentityVerificationCreateRequestUser, 'plaid/models/identity_verification_create_request_user' -Plaid.autoload :IdentityVerificationCreateResponse, 'plaid/models/identity_verification_create_response' -Plaid.autoload :IdentityVerificationDocumentAddressResponse, 'plaid/models/identity_verification_document_address_response' -Plaid.autoload :IdentityVerificationGetRequest, 'plaid/models/identity_verification_get_request' -Plaid.autoload :IdentityVerificationGetResponse, 'plaid/models/identity_verification_get_response' -Plaid.autoload :IdentityVerificationListRequest, 'plaid/models/identity_verification_list_request' -Plaid.autoload :IdentityVerificationListResponse, 'plaid/models/identity_verification_list_response' -Plaid.autoload :IdentityVerificationRequestUser, 'plaid/models/identity_verification_request_user' -Plaid.autoload :IdentityVerificationRequestUserName, 'plaid/models/identity_verification_request_user_name' -Plaid.autoload :IdentityVerificationResponseUserName, 'plaid/models/identity_verification_response_user_name' -Plaid.autoload :IdentityVerificationRetriedWebhook, 'plaid/models/identity_verification_retried_webhook' -Plaid.autoload :IdentityVerificationRetryRequest, 'plaid/models/identity_verification_retry_request' -Plaid.autoload :IdentityVerificationRetryRequestStepsObject, 'plaid/models/identity_verification_retry_request_steps_object' -Plaid.autoload :IdentityVerificationRetryResponse, 'plaid/models/identity_verification_retry_response' -Plaid.autoload :IdentityVerificationStatus, 'plaid/models/identity_verification_status' -Plaid.autoload :IdentityVerificationStatusUpdatedWebhook, 'plaid/models/identity_verification_status_updated_webhook' -Plaid.autoload :IdentityVerificationStepStatus, 'plaid/models/identity_verification_step_status' -Plaid.autoload :IdentityVerificationStepSummary, 'plaid/models/identity_verification_step_summary' -Plaid.autoload :IdentityVerificationStepUpdatedWebhook, 'plaid/models/identity_verification_step_updated_webhook' -Plaid.autoload :IdentityVerificationTemplateReference, 'plaid/models/identity_verification_template_reference' -Plaid.autoload :IdentityVerificationUserAddress, 'plaid/models/identity_verification_user_address' -Plaid.autoload :IdentityVerificationUserData, 'plaid/models/identity_verification_user_data' -Plaid.autoload :ImageQuality, 'plaid/models/image_quality' -Plaid.autoload :IncidentUpdate, 'plaid/models/incident_update' -Plaid.autoload :IncomeBreakdown, 'plaid/models/income_breakdown' -Plaid.autoload :IncomeBreakdownType, 'plaid/models/income_breakdown_type' -Plaid.autoload :IncomeOverride, 'plaid/models/income_override' -Plaid.autoload :IncomeSummary, 'plaid/models/income_summary' -Plaid.autoload :IncomeSummaryFieldNumber, 'plaid/models/income_summary_field_number' -Plaid.autoload :IncomeSummaryFieldString, 'plaid/models/income_summary_field_string' -Plaid.autoload :IncomeVerificationCreateRequest, 'plaid/models/income_verification_create_request' -Plaid.autoload :IncomeVerificationCreateRequestOptions, 'plaid/models/income_verification_create_request_options' -Plaid.autoload :IncomeVerificationCreateResponse, 'plaid/models/income_verification_create_response' -Plaid.autoload :IncomeVerificationDocParsingConfig, 'plaid/models/income_verification_doc_parsing_config' -Plaid.autoload :IncomeVerificationDocumentsDownloadRequest, 'plaid/models/income_verification_documents_download_request' -Plaid.autoload :IncomeVerificationPayrollFlowType, 'plaid/models/income_verification_payroll_flow_type' -Plaid.autoload :IncomeVerificationPaystubsGetRequest, 'plaid/models/income_verification_paystubs_get_request' -Plaid.autoload :IncomeVerificationPaystubsGetResponse, 'plaid/models/income_verification_paystubs_get_response' -Plaid.autoload :IncomeVerificationPrecheckConfidence, 'plaid/models/income_verification_precheck_confidence' -Plaid.autoload :IncomeVerificationPrecheckEmployer, 'plaid/models/income_verification_precheck_employer' -Plaid.autoload :IncomeVerificationPrecheckEmployerAddress, 'plaid/models/income_verification_precheck_employer_address' -Plaid.autoload :IncomeVerificationPrecheckEmployerAddressData, 'plaid/models/income_verification_precheck_employer_address_data' -Plaid.autoload :IncomeVerificationPrecheckMilitaryInfo, 'plaid/models/income_verification_precheck_military_info' -Plaid.autoload :IncomeVerificationPrecheckPayrollInstitution, 'plaid/models/income_verification_precheck_payroll_institution' -Plaid.autoload :IncomeVerificationPrecheckRequest, 'plaid/models/income_verification_precheck_request' -Plaid.autoload :IncomeVerificationPrecheckResponse, 'plaid/models/income_verification_precheck_response' -Plaid.autoload :IncomeVerificationPrecheckUser, 'plaid/models/income_verification_precheck_user' -Plaid.autoload :IncomeVerificationRefreshReconnectNeededWebhook, 'plaid/models/income_verification_refresh_reconnect_needed_webhook' -Plaid.autoload :IncomeVerificationRiskSignalsStatusWebhook, 'plaid/models/income_verification_risk_signals_status_webhook' -Plaid.autoload :IncomeVerificationSourceType, 'plaid/models/income_verification_source_type' -Plaid.autoload :IncomeVerificationStatusWebhook, 'plaid/models/income_verification_status_webhook' -Plaid.autoload :IncomeVerificationTaxformsGetRequest, 'plaid/models/income_verification_taxforms_get_request' -Plaid.autoload :IncomeVerificationTaxformsGetResponse, 'plaid/models/income_verification_taxforms_get_response' -Plaid.autoload :IncomeVerificationWebhookStatus, 'plaid/models/income_verification_webhook_status' -Plaid.autoload :IndividualName, 'plaid/models/individual_name' -Plaid.autoload :IndividualScreeningHitNames, 'plaid/models/individual_screening_hit_names' -Plaid.autoload :IndividualWatchlistCode, 'plaid/models/individual_watchlist_code' -Plaid.autoload :IndividualWatchlistProgram, 'plaid/models/individual_watchlist_program' -Plaid.autoload :InflowModel, 'plaid/models/inflow_model' -Plaid.autoload :InitialUpdateWebhook, 'plaid/models/initial_update_webhook' -Plaid.autoload :Institution, 'plaid/models/institution' -Plaid.autoload :InstitutionStatus, 'plaid/models/institution_status' -Plaid.autoload :InstitutionStatusAlertWebhook, 'plaid/models/institution_status_alert_webhook' -Plaid.autoload :InstitutionSupportedNetworks, 'plaid/models/institution_supported_networks' -Plaid.autoload :InstitutionsGetByIdRequest, 'plaid/models/institutions_get_by_id_request' -Plaid.autoload :InstitutionsGetByIdRequestOptions, 'plaid/models/institutions_get_by_id_request_options' -Plaid.autoload :InstitutionsGetByIdResponse, 'plaid/models/institutions_get_by_id_response' -Plaid.autoload :InstitutionsGetRequest, 'plaid/models/institutions_get_request' -Plaid.autoload :InstitutionsGetRequestOptions, 'plaid/models/institutions_get_request_options' -Plaid.autoload :InstitutionsGetResponse, 'plaid/models/institutions_get_response' -Plaid.autoload :InstitutionsSearchAccountFilter, 'plaid/models/institutions_search_account_filter' -Plaid.autoload :InstitutionsSearchPaymentInitiationOptions, 'plaid/models/institutions_search_payment_initiation_options' -Plaid.autoload :InstitutionsSearchRequest, 'plaid/models/institutions_search_request' -Plaid.autoload :InstitutionsSearchRequestOptions, 'plaid/models/institutions_search_request_options' -Plaid.autoload :InstitutionsSearchResponse, 'plaid/models/institutions_search_response' -Plaid.autoload :InvestmentAccountSubtype, 'plaid/models/investment_account_subtype' -Plaid.autoload :InvestmentFilter, 'plaid/models/investment_filter' -Plaid.autoload :InvestmentHoldingsGetRequestOptions, 'plaid/models/investment_holdings_get_request_options' -Plaid.autoload :InvestmentTransaction, 'plaid/models/investment_transaction' -Plaid.autoload :InvestmentTransactionSubtype, 'plaid/models/investment_transaction_subtype' -Plaid.autoload :InvestmentTransactionType, 'plaid/models/investment_transaction_type' -Plaid.autoload :InvestmentsAuthGetNumbers, 'plaid/models/investments_auth_get_numbers' -Plaid.autoload :InvestmentsAuthGetRequest, 'plaid/models/investments_auth_get_request' -Plaid.autoload :InvestmentsAuthGetRequestOptions, 'plaid/models/investments_auth_get_request_options' -Plaid.autoload :InvestmentsAuthGetResponse, 'plaid/models/investments_auth_get_response' -Plaid.autoload :InvestmentsAuthOwner, 'plaid/models/investments_auth_owner' -Plaid.autoload :InvestmentsDefaultUpdateWebhook, 'plaid/models/investments_default_update_webhook' -Plaid.autoload :InvestmentsHistoricalUpdateWebhook, 'plaid/models/investments_historical_update_webhook' -Plaid.autoload :InvestmentsHoldingsGetRequest, 'plaid/models/investments_holdings_get_request' -Plaid.autoload :InvestmentsHoldingsGetResponse, 'plaid/models/investments_holdings_get_response' -Plaid.autoload :InvestmentsRefreshRequest, 'plaid/models/investments_refresh_request' -Plaid.autoload :InvestmentsRefreshResponse, 'plaid/models/investments_refresh_response' -Plaid.autoload :InvestmentsTransactionsGetRequest, 'plaid/models/investments_transactions_get_request' -Plaid.autoload :InvestmentsTransactionsGetRequestOptions, 'plaid/models/investments_transactions_get_request_options' -Plaid.autoload :InvestmentsTransactionsGetResponse, 'plaid/models/investments_transactions_get_response' -Plaid.autoload :InvestmentsTransactionsOverride, 'plaid/models/investments_transactions_override' -Plaid.autoload :IssuingCountry, 'plaid/models/issuing_country' -Plaid.autoload :Item, 'plaid/models/item' -Plaid.autoload :ItemAccessTokenInvalidateRequest, 'plaid/models/item_access_token_invalidate_request' -Plaid.autoload :ItemAccessTokenInvalidateResponse, 'plaid/models/item_access_token_invalidate_response' -Plaid.autoload :ItemActivityListRequest, 'plaid/models/item_activity_list_request' -Plaid.autoload :ItemActivityListResponse, 'plaid/models/item_activity_list_response' -Plaid.autoload :ItemApplicationListRequest, 'plaid/models/item_application_list_request' -Plaid.autoload :ItemApplicationListResponse, 'plaid/models/item_application_list_response' -Plaid.autoload :ItemApplicationListUserAuth, 'plaid/models/item_application_list_user_auth' -Plaid.autoload :ItemApplicationScopesUpdateRequest, 'plaid/models/item_application_scopes_update_request' -Plaid.autoload :ItemApplicationScopesUpdateResponse, 'plaid/models/item_application_scopes_update_response' -Plaid.autoload :ItemApplicationUnlinkRequest, 'plaid/models/item_application_unlink_request' -Plaid.autoload :ItemApplicationUnlinkResponse, 'plaid/models/item_application_unlink_response' -Plaid.autoload :ItemErrorWebhook, 'plaid/models/item_error_webhook' -Plaid.autoload :ItemGetRequest, 'plaid/models/item_get_request' -Plaid.autoload :ItemGetResponse, 'plaid/models/item_get_response' -Plaid.autoload :ItemImportRequest, 'plaid/models/item_import_request' -Plaid.autoload :ItemImportRequestOptions, 'plaid/models/item_import_request_options' -Plaid.autoload :ItemImportRequestUserAuth, 'plaid/models/item_import_request_user_auth' -Plaid.autoload :ItemImportResponse, 'plaid/models/item_import_response' -Plaid.autoload :ItemLoginRepairedWebhook, 'plaid/models/item_login_repaired_webhook' -Plaid.autoload :ItemProductReadyWebhook, 'plaid/models/item_product_ready_webhook' -Plaid.autoload :ItemPublicTokenCreateRequest, 'plaid/models/item_public_token_create_request' -Plaid.autoload :ItemPublicTokenCreateResponse, 'plaid/models/item_public_token_create_response' -Plaid.autoload :ItemPublicTokenExchangeRequest, 'plaid/models/item_public_token_exchange_request' -Plaid.autoload :ItemPublicTokenExchangeResponse, 'plaid/models/item_public_token_exchange_response' -Plaid.autoload :ItemRemoveRequest, 'plaid/models/item_remove_request' -Plaid.autoload :ItemRemoveResponse, 'plaid/models/item_remove_response' -Plaid.autoload :ItemStatus, 'plaid/models/item_status' -Plaid.autoload :ItemStatusInvestments, 'plaid/models/item_status_investments' -Plaid.autoload :ItemStatusLastWebhook, 'plaid/models/item_status_last_webhook' -Plaid.autoload :ItemStatusNullable, 'plaid/models/item_status_nullable' -Plaid.autoload :ItemStatusTransactions, 'plaid/models/item_status_transactions' -Plaid.autoload :ItemWebhookUpdateRequest, 'plaid/models/item_webhook_update_request' -Plaid.autoload :ItemWebhookUpdateResponse, 'plaid/models/item_webhook_update_response' -Plaid.autoload :JWKPublicKey, 'plaid/models/jwk_public_key' -Plaid.autoload :JWTHeader, 'plaid/models/jwt_header' -Plaid.autoload :KYCCheckAddressSummary, 'plaid/models/kyc_check_address_summary' -Plaid.autoload :KYCCheckDateOfBirthSummary, 'plaid/models/kyc_check_date_of_birth_summary' -Plaid.autoload :KYCCheckDetails, 'plaid/models/kyc_check_details' -Plaid.autoload :KYCCheckIDNumberSummary, 'plaid/models/kyc_check_id_number_summary' -Plaid.autoload :KYCCheckNameSummary, 'plaid/models/kyc_check_name_summary' -Plaid.autoload :KYCCheckPhoneSummary, 'plaid/models/kyc_check_phone_summary' -Plaid.autoload :LastDataAccessTimes, 'plaid/models/last_data_access_times' -Plaid.autoload :LiabilitiesDefaultUpdateWebhook, 'plaid/models/liabilities_default_update_webhook' -Plaid.autoload :LiabilitiesGetRequest, 'plaid/models/liabilities_get_request' -Plaid.autoload :LiabilitiesGetRequestOptions, 'plaid/models/liabilities_get_request_options' -Plaid.autoload :LiabilitiesGetResponse, 'plaid/models/liabilities_get_response' -Plaid.autoload :LiabilitiesObject, 'plaid/models/liabilities_object' -Plaid.autoload :LiabilityOverride, 'plaid/models/liability_override' -Plaid.autoload :LinkCallbackMetadata, 'plaid/models/link_callback_metadata' -Plaid.autoload :LinkDeliveryAccount, 'plaid/models/link_delivery_account' -Plaid.autoload :LinkDeliveryCallbackWebhook, 'plaid/models/link_delivery_callback_webhook' -Plaid.autoload :LinkDeliveryCommunicationMethod, 'plaid/models/link_delivery_communication_method' -Plaid.autoload :LinkDeliveryCreateRequest, 'plaid/models/link_delivery_create_request' -Plaid.autoload :LinkDeliveryCreateResponse, 'plaid/models/link_delivery_create_response' -Plaid.autoload :LinkDeliveryDeliveryMethod, 'plaid/models/link_delivery_delivery_method' -Plaid.autoload :LinkDeliveryGetRequest, 'plaid/models/link_delivery_get_request' -Plaid.autoload :LinkDeliveryGetResponse, 'plaid/models/link_delivery_get_response' -Plaid.autoload :LinkDeliveryInstitution, 'plaid/models/link_delivery_institution' -Plaid.autoload :LinkDeliveryMetadata, 'plaid/models/link_delivery_metadata' -Plaid.autoload :LinkDeliveryOptions, 'plaid/models/link_delivery_options' -Plaid.autoload :LinkDeliveryRecipient, 'plaid/models/link_delivery_recipient' -Plaid.autoload :LinkDeliverySessionStatus, 'plaid/models/link_delivery_session_status' -Plaid.autoload :LinkDeliveryVerificationStatus, 'plaid/models/link_delivery_verification_status' -Plaid.autoload :LinkDeliveryWebhookCallbackType, 'plaid/models/link_delivery_webhook_callback_type' -Plaid.autoload :LinkDeliveryWebhookCommunicationMethod, 'plaid/models/link_delivery_webhook_communication_method' -Plaid.autoload :LinkDeliveryWebhookDeliveryStatus, 'plaid/models/link_delivery_webhook_delivery_status' -Plaid.autoload :LinkEvent, 'plaid/models/link_event' -Plaid.autoload :LinkEventMetadata, 'plaid/models/link_event_metadata' -Plaid.autoload :LinkEventName, 'plaid/models/link_event_name' -Plaid.autoload :LinkEventsWebhook, 'plaid/models/link_events_webhook' -Plaid.autoload :LinkOAuthCorrelationIdExchangeRequest, 'plaid/models/link_o_auth_correlation_id_exchange_request' -Plaid.autoload :LinkOAuthCorrelationIdExchangeResponse, 'plaid/models/link_o_auth_correlation_id_exchange_response' -Plaid.autoload :LinkSessionExit, 'plaid/models/link_session_exit' -Plaid.autoload :LinkSessionExitMetadata, 'plaid/models/link_session_exit_metadata' -Plaid.autoload :LinkSessionExitMetadataInstitution, 'plaid/models/link_session_exit_metadata_institution' -Plaid.autoload :LinkSessionFinishedWebhook, 'plaid/models/link_session_finished_webhook' -Plaid.autoload :LinkSessionSuccess, 'plaid/models/link_session_success' -Plaid.autoload :LinkSessionSuccessMetadata, 'plaid/models/link_session_success_metadata' -Plaid.autoload :LinkSessionSuccessMetadataAccount, 'plaid/models/link_session_success_metadata_account' -Plaid.autoload :LinkSessionSuccessMetadataInstitution, 'plaid/models/link_session_success_metadata_institution' -Plaid.autoload :LinkSessionSuccessMetadataTransferStatus, 'plaid/models/link_session_success_metadata_transfer_status' -Plaid.autoload :LinkTokenAccountFilters, 'plaid/models/link_token_account_filters' -Plaid.autoload :LinkTokenCreateCardSwitch, 'plaid/models/link_token_create_card_switch' -Plaid.autoload :LinkTokenCreateCreditFilter, 'plaid/models/link_token_create_credit_filter' -Plaid.autoload :LinkTokenCreateDepositoryFilter, 'plaid/models/link_token_create_depository_filter' -Plaid.autoload :LinkTokenCreateHostedLink, 'plaid/models/link_token_create_hosted_link' -Plaid.autoload :LinkTokenCreateIdentity, 'plaid/models/link_token_create_identity' -Plaid.autoload :LinkTokenCreateInstitutionData, 'plaid/models/link_token_create_institution_data' -Plaid.autoload :LinkTokenCreateInvestmentFilter, 'plaid/models/link_token_create_investment_filter' -Plaid.autoload :LinkTokenCreateLoanFilter, 'plaid/models/link_token_create_loan_filter' -Plaid.autoload :LinkTokenCreateRequest, 'plaid/models/link_token_create_request' -Plaid.autoload :LinkTokenCreateRequestAccountSubtypes, 'plaid/models/link_token_create_request_account_subtypes' -Plaid.autoload :LinkTokenCreateRequestAuth, 'plaid/models/link_token_create_request_auth' -Plaid.autoload :LinkTokenCreateRequestBaseReport, 'plaid/models/link_token_create_request_base_report' -Plaid.autoload :LinkTokenCreateRequestCreditPartnerInsights, 'plaid/models/link_token_create_request_credit_partner_insights' -Plaid.autoload :LinkTokenCreateRequestDepositSwitch, 'plaid/models/link_token_create_request_deposit_switch' -Plaid.autoload :LinkTokenCreateRequestEmployment, 'plaid/models/link_token_create_request_employment' -Plaid.autoload :LinkTokenCreateRequestEmploymentBankIncome, 'plaid/models/link_token_create_request_employment_bank_income' -Plaid.autoload :LinkTokenCreateRequestIdentityVerification, 'plaid/models/link_token_create_request_identity_verification' -Plaid.autoload :LinkTokenCreateRequestIncomeVerification, 'plaid/models/link_token_create_request_income_verification' -Plaid.autoload :LinkTokenCreateRequestIncomeVerificationBankIncome, 'plaid/models/link_token_create_request_income_verification_bank_income' -Plaid.autoload :LinkTokenCreateRequestIncomeVerificationPayrollIncome, 'plaid/models/link_token_create_request_income_verification_payroll_income' -Plaid.autoload :LinkTokenCreateRequestPaymentInitiation, 'plaid/models/link_token_create_request_payment_initiation' -Plaid.autoload :LinkTokenCreateRequestStatements, 'plaid/models/link_token_create_request_statements' -Plaid.autoload :LinkTokenCreateRequestTransfer, 'plaid/models/link_token_create_request_transfer' -Plaid.autoload :LinkTokenCreateRequestUpdate, 'plaid/models/link_token_create_request_update' -Plaid.autoload :LinkTokenCreateRequestUser, 'plaid/models/link_token_create_request_user' -Plaid.autoload :LinkTokenCreateRequestUserAddress, 'plaid/models/link_token_create_request_user_address' -Plaid.autoload :LinkTokenCreateRequestUserIdNumber, 'plaid/models/link_token_create_request_user_id_number' -Plaid.autoload :LinkTokenCreateRequestUserName, 'plaid/models/link_token_create_request_user_name' -Plaid.autoload :LinkTokenCreateRequestUserStatedIncomeSource, 'plaid/models/link_token_create_request_user_stated_income_source' -Plaid.autoload :LinkTokenCreateResponse, 'plaid/models/link_token_create_response' -Plaid.autoload :LinkTokenEUConfig, 'plaid/models/link_token_eu_config' -Plaid.autoload :LinkTokenGetMetadataResponse, 'plaid/models/link_token_get_metadata_response' -Plaid.autoload :LinkTokenGetRequest, 'plaid/models/link_token_get_request' -Plaid.autoload :LinkTokenGetResponse, 'plaid/models/link_token_get_response' -Plaid.autoload :LinkTokenGetSessionsResponse, 'plaid/models/link_token_get_sessions_response' -Plaid.autoload :LinkTokenInvestments, 'plaid/models/link_token_investments' -Plaid.autoload :LinkTokenInvestmentsAuth, 'plaid/models/link_token_investments_auth' -Plaid.autoload :LinkTokenTransactions, 'plaid/models/link_token_transactions' -Plaid.autoload :LinkUserDeliveryStatusWebhook, 'plaid/models/link_user_delivery_status_webhook' -Plaid.autoload :Loan, 'plaid/models/loan' -Plaid.autoload :LoanAccountSubtype, 'plaid/models/loan_account_subtype' -Plaid.autoload :LoanFilter, 'plaid/models/loan_filter' -Plaid.autoload :LoanIdentifier, 'plaid/models/loan_identifier' -Plaid.autoload :LoanIdentifierType, 'plaid/models/loan_identifier_type' -Plaid.autoload :LoanIdentifiers, 'plaid/models/loan_identifiers' -Plaid.autoload :Loans, 'plaid/models/loans' -Plaid.autoload :Location, 'plaid/models/location' -Plaid.autoload :MFA, 'plaid/models/mfa' -Plaid.autoload :MatchSummary, 'plaid/models/match_summary' -Plaid.autoload :MatchSummaryCode, 'plaid/models/match_summary_code' -Plaid.autoload :MerchantInsights, 'plaid/models/merchant_insights' -Plaid.autoload :Meta, 'plaid/models/meta' -Plaid.autoload :MortgageInterestRate, 'plaid/models/mortgage_interest_rate' -Plaid.autoload :MortgageLiability, 'plaid/models/mortgage_liability' -Plaid.autoload :MortgagePropertyAddress, 'plaid/models/mortgage_property_address' -Plaid.autoload :MultiDocumentRiskSignal, 'plaid/models/multi_document_risk_signal' -Plaid.autoload :NameMatchScore, 'plaid/models/name_match_score' -Plaid.autoload :NetPay, 'plaid/models/net_pay' -Plaid.autoload :NewAccountsAvailableWebhook, 'plaid/models/new_accounts_available_webhook' -Plaid.autoload :Numbers, 'plaid/models/numbers' -Plaid.autoload :NumbersACATS, 'plaid/models/numbers_acats' -Plaid.autoload :NumbersACH, 'plaid/models/numbers_ach' -Plaid.autoload :NumbersACHNullable, 'plaid/models/numbers_ach_nullable' -Plaid.autoload :NumbersATON, 'plaid/models/numbers_aton' -Plaid.autoload :NumbersBACS, 'plaid/models/numbers_bacs' -Plaid.autoload :NumbersBACSNullable, 'plaid/models/numbers_bacs_nullable' -Plaid.autoload :NumbersEFT, 'plaid/models/numbers_eft' -Plaid.autoload :NumbersEFTNullable, 'plaid/models/numbers_eft_nullable' -Plaid.autoload :NumbersIBANNullable, 'plaid/models/numbers_iban_nullable' -Plaid.autoload :NumbersInternational, 'plaid/models/numbers_international' -Plaid.autoload :NumbersInternationalIBAN, 'plaid/models/numbers_international_iban' -Plaid.autoload :NumbersInternationalNullable, 'plaid/models/numbers_international_nullable' -Plaid.autoload :OmittableTransferType, 'plaid/models/omittable_transfer_type' -Plaid.autoload :OptionContract, 'plaid/models/option_contract' -Plaid.autoload :Originator, 'plaid/models/originator' -Plaid.autoload :OriginatorExpectedTransferFrequency, 'plaid/models/originator_expected_transfer_frequency' -Plaid.autoload :OtherAccountSubtype, 'plaid/models/other_account_subtype' -Plaid.autoload :OtherFilter, 'plaid/models/other_filter' -Plaid.autoload :OverrideAccountType, 'plaid/models/override_account_type' -Plaid.autoload :OverrideAccounts, 'plaid/models/override_accounts' -Plaid.autoload :Owner, 'plaid/models/owner' -Plaid.autoload :OwnerOverride, 'plaid/models/owner_override' -Plaid.autoload :OwnershipType, 'plaid/models/ownership_type' -Plaid.autoload :POBoxStatus, 'plaid/models/po_box_status' -Plaid.autoload :PSLFStatus, 'plaid/models/pslf_status' -Plaid.autoload :Parties, 'plaid/models/parties' -Plaid.autoload :PartnerCustomerCreateRequest, 'plaid/models/partner_customer_create_request' -Plaid.autoload :PartnerCustomerCreateResponse, 'plaid/models/partner_customer_create_response' -Plaid.autoload :PartnerCustomerEnableRequest, 'plaid/models/partner_customer_enable_request' -Plaid.autoload :PartnerCustomerEnableResponse, 'plaid/models/partner_customer_enable_response' -Plaid.autoload :PartnerCustomerGetRequest, 'plaid/models/partner_customer_get_request' -Plaid.autoload :PartnerCustomerGetResponse, 'plaid/models/partner_customer_get_response' -Plaid.autoload :PartnerCustomerOAuthInstitutionsGetRequest, 'plaid/models/partner_customer_o_auth_institutions_get_request' -Plaid.autoload :PartnerCustomerOAuthInstitutionsGetResponse, 'plaid/models/partner_customer_o_auth_institutions_get_response' -Plaid.autoload :PartnerCustomerRemoveRequest, 'plaid/models/partner_customer_remove_request' -Plaid.autoload :PartnerCustomerRemoveResponse, 'plaid/models/partner_customer_remove_response' -Plaid.autoload :PartnerEndCustomer, 'plaid/models/partner_end_customer' -Plaid.autoload :PartnerEndCustomerAddress, 'plaid/models/partner_end_customer_address' -Plaid.autoload :PartnerEndCustomerAssetsUnderManagement, 'plaid/models/partner_end_customer_assets_under_management' -Plaid.autoload :PartnerEndCustomerBillingContact, 'plaid/models/partner_end_customer_billing_contact' -Plaid.autoload :PartnerEndCustomerCustomerSupportInfo, 'plaid/models/partner_end_customer_customer_support_info' -Plaid.autoload :PartnerEndCustomerFlowdownStatus, 'plaid/models/partner_end_customer_flowdown_status' -Plaid.autoload :PartnerEndCustomerOAuthInstitution, 'plaid/models/partner_end_customer_o_auth_institution' -Plaid.autoload :PartnerEndCustomerOAuthInstitutionApplicationStatus, 'plaid/models/partner_end_customer_o_auth_institution_application_status' -Plaid.autoload :PartnerEndCustomerOAuthInstitutionEnvironments, 'plaid/models/partner_end_customer_o_auth_institution_environments' -Plaid.autoload :PartnerEndCustomerOAuthStatusUpdatedValues, 'plaid/models/partner_end_customer_o_auth_status_updated_values' -Plaid.autoload :PartnerEndCustomerOAuthStatusUpdatedWebhook, 'plaid/models/partner_end_customer_o_auth_status_updated_webhook' -Plaid.autoload :PartnerEndCustomerQuestionnaireStatus, 'plaid/models/partner_end_customer_questionnaire_status' -Plaid.autoload :PartnerEndCustomerSecrets, 'plaid/models/partner_end_customer_secrets' -Plaid.autoload :PartnerEndCustomerStatus, 'plaid/models/partner_end_customer_status' -Plaid.autoload :PartnerEndCustomerTechnicalContact, 'plaid/models/partner_end_customer_technical_contact' -Plaid.autoload :PartnerEndCustomerWithSecrets, 'plaid/models/partner_end_customer_with_secrets' -Plaid.autoload :PartnerEndCustomerWithSecretsAllOf, 'plaid/models/partner_end_customer_with_secrets_all_of' -Plaid.autoload :Party, 'plaid/models/party' -Plaid.autoload :PartyIndividual, 'plaid/models/party_individual' -Plaid.autoload :PartyRoleType, 'plaid/models/party_role_type' -Plaid.autoload :Pay, 'plaid/models/pay' -Plaid.autoload :PayFrequency, 'plaid/models/pay_frequency' -Plaid.autoload :PayFrequencyValue, 'plaid/models/pay_frequency_value' -Plaid.autoload :PayPeriodDetails, 'plaid/models/pay_period_details' -Plaid.autoload :PayPeriodDetailsPayFrequency, 'plaid/models/pay_period_details_pay_frequency' -Plaid.autoload :PayStubDeductionsBreakdown, 'plaid/models/pay_stub_deductions_breakdown' -Plaid.autoload :PayStubDeductionsTotal, 'plaid/models/pay_stub_deductions_total' -Plaid.autoload :PayStubDistributionBreakdown, 'plaid/models/pay_stub_distribution_breakdown' -Plaid.autoload :PayStubEarningsBreakdown, 'plaid/models/pay_stub_earnings_breakdown' -Plaid.autoload :PayStubEarningsTotal, 'plaid/models/pay_stub_earnings_total' -Plaid.autoload :PayStubPayPeriodDetails, 'plaid/models/pay_stub_pay_period_details' -Plaid.autoload :PayStubTaxpayerID, 'plaid/models/pay_stub_taxpayer_id' -Plaid.autoload :PaymentAmount, 'plaid/models/payment_amount' -Plaid.autoload :PaymentAmountCurrency, 'plaid/models/payment_amount_currency' -Plaid.autoload :PaymentAmountNullable, 'plaid/models/payment_amount_nullable' -Plaid.autoload :PaymentAmountRefunded, 'plaid/models/payment_amount_refunded' -Plaid.autoload :PaymentAmountToRefund, 'plaid/models/payment_amount_to_refund' -Plaid.autoload :PaymentChannel, 'plaid/models/payment_channel' -Plaid.autoload :PaymentConsentMaxPaymentAmount, 'plaid/models/payment_consent_max_payment_amount' -Plaid.autoload :PaymentConsentPeriodicAlignment, 'plaid/models/payment_consent_periodic_alignment' -Plaid.autoload :PaymentConsentPeriodicAmount, 'plaid/models/payment_consent_periodic_amount' -Plaid.autoload :PaymentConsentPeriodicAmountAmount, 'plaid/models/payment_consent_periodic_amount_amount' -Plaid.autoload :PaymentConsentPeriodicInterval, 'plaid/models/payment_consent_periodic_interval' -Plaid.autoload :PaymentConsentValidDateTime, 'plaid/models/payment_consent_valid_date_time' -Plaid.autoload :PaymentInitiationAddress, 'plaid/models/payment_initiation_address' -Plaid.autoload :PaymentInitiationConsent, 'plaid/models/payment_initiation_consent' -Plaid.autoload :PaymentInitiationConsentConstraints, 'plaid/models/payment_initiation_consent_constraints' -Plaid.autoload :PaymentInitiationConsentCreateRequest, 'plaid/models/payment_initiation_consent_create_request' -Plaid.autoload :PaymentInitiationConsentCreateResponse, 'plaid/models/payment_initiation_consent_create_response' -Plaid.autoload :PaymentInitiationConsentGetRequest, 'plaid/models/payment_initiation_consent_get_request' -Plaid.autoload :PaymentInitiationConsentGetResponse, 'plaid/models/payment_initiation_consent_get_response' -Plaid.autoload :PaymentInitiationConsentPaymentExecuteRequest, 'plaid/models/payment_initiation_consent_payment_execute_request' -Plaid.autoload :PaymentInitiationConsentPaymentExecuteResponse, 'plaid/models/payment_initiation_consent_payment_execute_response' -Plaid.autoload :PaymentInitiationConsentRevokeRequest, 'plaid/models/payment_initiation_consent_revoke_request' -Plaid.autoload :PaymentInitiationConsentRevokeResponse, 'plaid/models/payment_initiation_consent_revoke_response' -Plaid.autoload :PaymentInitiationConsentScope, 'plaid/models/payment_initiation_consent_scope' -Plaid.autoload :PaymentInitiationConsentStatus, 'plaid/models/payment_initiation_consent_status' -Plaid.autoload :PaymentInitiationMetadata, 'plaid/models/payment_initiation_metadata' -Plaid.autoload :PaymentInitiationOptionalRestrictionBacs, 'plaid/models/payment_initiation_optional_restriction_bacs' -Plaid.autoload :PaymentInitiationPayment, 'plaid/models/payment_initiation_payment' -Plaid.autoload :PaymentInitiationPaymentCreateRequest, 'plaid/models/payment_initiation_payment_create_request' -Plaid.autoload :PaymentInitiationPaymentCreateResponse, 'plaid/models/payment_initiation_payment_create_response' -Plaid.autoload :PaymentInitiationPaymentCreateStatus, 'plaid/models/payment_initiation_payment_create_status' -Plaid.autoload :PaymentInitiationPaymentGetRequest, 'plaid/models/payment_initiation_payment_get_request' -Plaid.autoload :PaymentInitiationPaymentGetResponse, 'plaid/models/payment_initiation_payment_get_response' -Plaid.autoload :PaymentInitiationPaymentListRequest, 'plaid/models/payment_initiation_payment_list_request' -Plaid.autoload :PaymentInitiationPaymentListResponse, 'plaid/models/payment_initiation_payment_list_response' -Plaid.autoload :PaymentInitiationPaymentReverseRequest, 'plaid/models/payment_initiation_payment_reverse_request' -Plaid.autoload :PaymentInitiationPaymentReverseResponse, 'plaid/models/payment_initiation_payment_reverse_response' -Plaid.autoload :PaymentInitiationPaymentStatus, 'plaid/models/payment_initiation_payment_status' -Plaid.autoload :PaymentInitiationPaymentTokenCreateRequest, 'plaid/models/payment_initiation_payment_token_create_request' -Plaid.autoload :PaymentInitiationPaymentTokenCreateResponse, 'plaid/models/payment_initiation_payment_token_create_response' -Plaid.autoload :PaymentInitiationRecipient, 'plaid/models/payment_initiation_recipient' -Plaid.autoload :PaymentInitiationRecipientCreateRequest, 'plaid/models/payment_initiation_recipient_create_request' -Plaid.autoload :PaymentInitiationRecipientCreateResponse, 'plaid/models/payment_initiation_recipient_create_response' -Plaid.autoload :PaymentInitiationRecipientGetRequest, 'plaid/models/payment_initiation_recipient_get_request' -Plaid.autoload :PaymentInitiationRecipientGetResponse, 'plaid/models/payment_initiation_recipient_get_response' -Plaid.autoload :PaymentInitiationRecipientGetResponseAllOf, 'plaid/models/payment_initiation_recipient_get_response_all_of' -Plaid.autoload :PaymentInitiationRecipientListRequest, 'plaid/models/payment_initiation_recipient_list_request' -Plaid.autoload :PaymentInitiationRecipientListResponse, 'plaid/models/payment_initiation_recipient_list_response' -Plaid.autoload :PaymentInitiationStandingOrderMetadata, 'plaid/models/payment_initiation_standing_order_metadata' -Plaid.autoload :PaymentMeta, 'plaid/models/payment_meta' -Plaid.autoload :PaymentProfileCreateRequest, 'plaid/models/payment_profile_create_request' -Plaid.autoload :PaymentProfileCreateResponse, 'plaid/models/payment_profile_create_response' -Plaid.autoload :PaymentProfileGetRequest, 'plaid/models/payment_profile_get_request' -Plaid.autoload :PaymentProfileGetResponse, 'plaid/models/payment_profile_get_response' -Plaid.autoload :PaymentProfileRemoveRequest, 'plaid/models/payment_profile_remove_request' -Plaid.autoload :PaymentProfileRemoveResponse, 'plaid/models/payment_profile_remove_response' -Plaid.autoload :PaymentProfileStatus, 'plaid/models/payment_profile_status' -Plaid.autoload :PaymentScheduleInterval, 'plaid/models/payment_schedule_interval' -Plaid.autoload :PaymentScheme, 'plaid/models/payment_scheme' -Plaid.autoload :PaymentStatusUpdateWebhook, 'plaid/models/payment_status_update_webhook' -Plaid.autoload :PayrollIncomeAccountData, 'plaid/models/payroll_income_account_data' -Plaid.autoload :PayrollIncomeObject, 'plaid/models/payroll_income_object' -Plaid.autoload :PayrollIncomeRateOfPay, 'plaid/models/payroll_income_rate_of_pay' -Plaid.autoload :PayrollItem, 'plaid/models/payroll_item' -Plaid.autoload :PayrollItemStatus, 'plaid/models/payroll_item_status' -Plaid.autoload :PayrollRiskSignalsItem, 'plaid/models/payroll_risk_signals_item' -Plaid.autoload :Paystub, 'plaid/models/paystub' -Plaid.autoload :PaystubAddress, 'plaid/models/paystub_address' -Plaid.autoload :PaystubDeduction, 'plaid/models/paystub_deduction' -Plaid.autoload :PaystubDetails, 'plaid/models/paystub_details' -Plaid.autoload :PaystubEmployer, 'plaid/models/paystub_employer' -Plaid.autoload :PaystubOverride, 'plaid/models/paystub_override' -Plaid.autoload :PaystubOverrideDistributionBreakdown, 'plaid/models/paystub_override_distribution_breakdown' -Plaid.autoload :PaystubOverrideEmployee, 'plaid/models/paystub_override_employee' -Plaid.autoload :PaystubOverrideEmployeeAddress, 'plaid/models/paystub_override_employee_address' -Plaid.autoload :PaystubOverrideEmployer, 'plaid/models/paystub_override_employer' -Plaid.autoload :PaystubOverridePayPeriodDetails, 'plaid/models/paystub_override_pay_period_details' -Plaid.autoload :PaystubPayFrequency, 'plaid/models/paystub_pay_frequency' -Plaid.autoload :PaystubYTDDetails, 'plaid/models/paystub_ytd_details' -Plaid.autoload :PendingExpirationWebhook, 'plaid/models/pending_expiration_webhook' -Plaid.autoload :PersonalFinanceCategory, 'plaid/models/personal_finance_category' -Plaid.autoload :PhoneNumber, 'plaid/models/phone_number' -Plaid.autoload :PhoneNumberMatchScore, 'plaid/models/phone_number_match_score' -Plaid.autoload :PhoneType, 'plaid/models/phone_type' -Plaid.autoload :PhysicalDocumentCategory, 'plaid/models/physical_document_category' -Plaid.autoload :PhysicalDocumentExtractedData, 'plaid/models/physical_document_extracted_data' -Plaid.autoload :PhysicalDocumentExtractedDataAnalysis, 'plaid/models/physical_document_extracted_data_analysis' -Plaid.autoload :PhysicalDocumentImages, 'plaid/models/physical_document_images' -Plaid.autoload :PlaidError, 'plaid/models/plaid_error' -Plaid.autoload :PlaidErrorType, 'plaid/models/plaid_error_type' -Plaid.autoload :PlatformIds, 'plaid/models/platform_ids' -Plaid.autoload :PrismCashScore, 'plaid/models/prism_cash_score' -Plaid.autoload :PrismCashScoreMetadata, 'plaid/models/prism_cash_score_metadata' -Plaid.autoload :PrismDetect, 'plaid/models/prism_detect' -Plaid.autoload :PrismInsights, 'plaid/models/prism_insights' -Plaid.autoload :PrismProduct, 'plaid/models/prism_product' -Plaid.autoload :ProcessorAccountGetRequest, 'plaid/models/processor_account_get_request' -Plaid.autoload :ProcessorAccountGetResponse, 'plaid/models/processor_account_get_response' -Plaid.autoload :ProcessorApexProcessorTokenCreateRequest, 'plaid/models/processor_apex_processor_token_create_request' -Plaid.autoload :ProcessorAuthGetRequest, 'plaid/models/processor_auth_get_request' -Plaid.autoload :ProcessorAuthGetResponse, 'plaid/models/processor_auth_get_response' -Plaid.autoload :ProcessorBalanceGetRequest, 'plaid/models/processor_balance_get_request' -Plaid.autoload :ProcessorBalanceGetRequestOptions, 'plaid/models/processor_balance_get_request_options' -Plaid.autoload :ProcessorBalanceGetResponse, 'plaid/models/processor_balance_get_response' -Plaid.autoload :ProcessorBankTransferCreateRequest, 'plaid/models/processor_bank_transfer_create_request' -Plaid.autoload :ProcessorBankTransferCreateResponse, 'plaid/models/processor_bank_transfer_create_response' -Plaid.autoload :ProcessorDefaultUpdateWebhook, 'plaid/models/processor_default_update_webhook' -Plaid.autoload :ProcessorHistoricalUpdateWebhook, 'plaid/models/processor_historical_update_webhook' -Plaid.autoload :ProcessorIdentityGetRequest, 'plaid/models/processor_identity_get_request' -Plaid.autoload :ProcessorIdentityGetResponse, 'plaid/models/processor_identity_get_response' -Plaid.autoload :ProcessorIdentityMatchRequest, 'plaid/models/processor_identity_match_request' -Plaid.autoload :ProcessorIdentityMatchResponse, 'plaid/models/processor_identity_match_response' -Plaid.autoload :ProcessorInitialUpdateWebhook, 'plaid/models/processor_initial_update_webhook' -Plaid.autoload :ProcessorLiabilitiesGetRequest, 'plaid/models/processor_liabilities_get_request' -Plaid.autoload :ProcessorLiabilitiesGetResponse, 'plaid/models/processor_liabilities_get_response' -Plaid.autoload :ProcessorNumber, 'plaid/models/processor_number' -Plaid.autoload :ProcessorRecurringTransactionsUpdateWebhook, 'plaid/models/processor_recurring_transactions_update_webhook' -Plaid.autoload :ProcessorSignalDecisionReportRequest, 'plaid/models/processor_signal_decision_report_request' -Plaid.autoload :ProcessorSignalDecisionReportResponse, 'plaid/models/processor_signal_decision_report_response' -Plaid.autoload :ProcessorSignalEvaluateRequest, 'plaid/models/processor_signal_evaluate_request' -Plaid.autoload :ProcessorSignalEvaluateResponse, 'plaid/models/processor_signal_evaluate_response' -Plaid.autoload :ProcessorSignalPrepareRequest, 'plaid/models/processor_signal_prepare_request' -Plaid.autoload :ProcessorSignalPrepareResponse, 'plaid/models/processor_signal_prepare_response' -Plaid.autoload :ProcessorSignalReturnReportRequest, 'plaid/models/processor_signal_return_report_request' -Plaid.autoload :ProcessorSignalReturnReportResponse, 'plaid/models/processor_signal_return_report_response' -Plaid.autoload :ProcessorStripeBankAccountTokenCreateRequest, 'plaid/models/processor_stripe_bank_account_token_create_request' -Plaid.autoload :ProcessorStripeBankAccountTokenCreateResponse, 'plaid/models/processor_stripe_bank_account_token_create_response' -Plaid.autoload :ProcessorSyncUpdatesAvailableWebhook, 'plaid/models/processor_sync_updates_available_webhook' -Plaid.autoload :ProcessorTokenCreateRequest, 'plaid/models/processor_token_create_request' -Plaid.autoload :ProcessorTokenCreateResponse, 'plaid/models/processor_token_create_response' -Plaid.autoload :ProcessorTokenPermissionsGetRequest, 'plaid/models/processor_token_permissions_get_request' -Plaid.autoload :ProcessorTokenPermissionsGetResponse, 'plaid/models/processor_token_permissions_get_response' -Plaid.autoload :ProcessorTokenPermissionsSetRequest, 'plaid/models/processor_token_permissions_set_request' -Plaid.autoload :ProcessorTokenPermissionsSetResponse, 'plaid/models/processor_token_permissions_set_response' -Plaid.autoload :ProcessorTokenWebhookUpdate, 'plaid/models/processor_token_webhook_update' -Plaid.autoload :ProcessorTokenWebhookUpdateRequest, 'plaid/models/processor_token_webhook_update_request' -Plaid.autoload :ProcessorTokenWebhookUpdateResponse, 'plaid/models/processor_token_webhook_update_response' -Plaid.autoload :ProcessorTransactionsGetRequest, 'plaid/models/processor_transactions_get_request' -Plaid.autoload :ProcessorTransactionsGetRequestOptions, 'plaid/models/processor_transactions_get_request_options' -Plaid.autoload :ProcessorTransactionsGetResponse, 'plaid/models/processor_transactions_get_response' -Plaid.autoload :ProcessorTransactionsRecurringGetRequest, 'plaid/models/processor_transactions_recurring_get_request' -Plaid.autoload :ProcessorTransactionsRecurringGetResponse, 'plaid/models/processor_transactions_recurring_get_response' -Plaid.autoload :ProcessorTransactionsRefreshRequest, 'plaid/models/processor_transactions_refresh_request' -Plaid.autoload :ProcessorTransactionsRefreshResponse, 'plaid/models/processor_transactions_refresh_response' -Plaid.autoload :ProcessorTransactionsRemovedWebhook, 'plaid/models/processor_transactions_removed_webhook' -Plaid.autoload :ProcessorTransactionsSyncRequest, 'plaid/models/processor_transactions_sync_request' -Plaid.autoload :ProcessorTransactionsSyncResponse, 'plaid/models/processor_transactions_sync_response' -Plaid.autoload :ProductAccess, 'plaid/models/product_access' -Plaid.autoload :ProductPermissionsRequiredAuthWebhook, 'plaid/models/product_permissions_required_auth_webhook' -Plaid.autoload :ProductPermissionsRequiredIdentityWebhook, 'plaid/models/product_permissions_required_identity_webhook' -Plaid.autoload :ProductStatus, 'plaid/models/product_status' -Plaid.autoload :ProductStatusBreakdown, 'plaid/models/product_status_breakdown' -Plaid.autoload :Products, 'plaid/models/products' -Plaid.autoload :ProfileGetRequest, 'plaid/models/profile_get_request' -Plaid.autoload :ProfileGetResponse, 'plaid/models/profile_get_response' -Plaid.autoload :ProfileIdentity, 'plaid/models/profile_identity' -Plaid.autoload :ProfileIdentityAddress, 'plaid/models/profile_identity_address' -Plaid.autoload :ProfileIdentityName, 'plaid/models/profile_identity_name' -Plaid.autoload :ProfileItem, 'plaid/models/profile_item' -Plaid.autoload :ProgramNameSensitivity, 'plaid/models/program_name_sensitivity' -Plaid.autoload :ProjectedIncomeSummaryFieldNumber, 'plaid/models/projected_income_summary_field_number' -Plaid.autoload :ProxyType, 'plaid/models/proxy_type' -Plaid.autoload :RecaptchaRequiredError, 'plaid/models/recaptcha_required_error' -Plaid.autoload :RecipientBACS, 'plaid/models/recipient_bacs' -Plaid.autoload :RecipientBACSNullable, 'plaid/models/recipient_bacs_nullable' -Plaid.autoload :Recurrence, 'plaid/models/recurrence' -Plaid.autoload :RecurringCancelledWebhook, 'plaid/models/recurring_cancelled_webhook' -Plaid.autoload :RecurringFrequency, 'plaid/models/recurring_frequency' -Plaid.autoload :RecurringInsightsStream, 'plaid/models/recurring_insights_stream' -Plaid.autoload :RecurringNewTransferWebhook, 'plaid/models/recurring_new_transfer_webhook' -Plaid.autoload :RecurringTransactionFrequency, 'plaid/models/recurring_transaction_frequency' -Plaid.autoload :RecurringTransactions, 'plaid/models/recurring_transactions' -Plaid.autoload :RecurringTransactionsUpdateWebhook, 'plaid/models/recurring_transactions_update_webhook' -Plaid.autoload :RecurringTransfer, 'plaid/models/recurring_transfer' -Plaid.autoload :RecurringTransferNullable, 'plaid/models/recurring_transfer_nullable' -Plaid.autoload :RecurringTransferSkippedWebhook, 'plaid/models/recurring_transfer_skipped_webhook' -Plaid.autoload :RemovedTransaction, 'plaid/models/removed_transaction' -Plaid.autoload :ReportType, 'plaid/models/report_type' -Plaid.autoload :ReportingInformation, 'plaid/models/reporting_information' -Plaid.autoload :RiskCheckBehavior, 'plaid/models/risk_check_behavior' -Plaid.autoload :RiskCheckBehaviorBotDetectedLabel, 'plaid/models/risk_check_behavior_bot_detected_label' -Plaid.autoload :RiskCheckBehaviorFraudRingDetectedLabel, 'plaid/models/risk_check_behavior_fraud_ring_detected_label' -Plaid.autoload :RiskCheckBehaviorUserInteractionsLabel, 'plaid/models/risk_check_behavior_user_interactions_label' -Plaid.autoload :RiskCheckDetails, 'plaid/models/risk_check_details' -Plaid.autoload :RiskCheckDevice, 'plaid/models/risk_check_device' -Plaid.autoload :RiskCheckEmail, 'plaid/models/risk_check_email' -Plaid.autoload :RiskCheckEmailDomainIsCustom, 'plaid/models/risk_check_email_domain_is_custom' -Plaid.autoload :RiskCheckEmailDomainIsDisposable, 'plaid/models/risk_check_email_domain_is_disposable' -Plaid.autoload :RiskCheckEmailDomainIsFreeProvider, 'plaid/models/risk_check_email_domain_is_free_provider' -Plaid.autoload :RiskCheckEmailIsDeliverableStatus, 'plaid/models/risk_check_email_is_deliverable_status' -Plaid.autoload :RiskCheckEmailTopLevelDomainIsSuspicious, 'plaid/models/risk_check_email_top_level_domain_is_suspicious' -Plaid.autoload :RiskCheckIdentityAbuseSignals, 'plaid/models/risk_check_identity_abuse_signals' -Plaid.autoload :RiskCheckLinkedService, 'plaid/models/risk_check_linked_service' -Plaid.autoload :RiskCheckPhone, 'plaid/models/risk_check_phone' -Plaid.autoload :RiskCheckStolenIdentity, 'plaid/models/risk_check_stolen_identity' -Plaid.autoload :RiskCheckSyntheticIdentity, 'plaid/models/risk_check_synthetic_identity' -Plaid.autoload :RiskProfile, 'plaid/models/risk_profile' -Plaid.autoload :RiskReason, 'plaid/models/risk_reason' -Plaid.autoload :RiskSignalDocumentReference, 'plaid/models/risk_signal_document_reference' -Plaid.autoload :RiskSignalDocumentStatus, 'plaid/models/risk_signal_document_status' -Plaid.autoload :Role, 'plaid/models/role' -Plaid.autoload :RoleDetail, 'plaid/models/role_detail' -Plaid.autoload :Roles, 'plaid/models/roles' -Plaid.autoload :SandboxBankIncomeFireWebhookRequest, 'plaid/models/sandbox_bank_income_fire_webhook_request' -Plaid.autoload :SandboxBankIncomeFireWebhookResponse, 'plaid/models/sandbox_bank_income_fire_webhook_response' -Plaid.autoload :SandboxBankIncomeWebhookFireRequestWebhookCode, 'plaid/models/sandbox_bank_income_webhook_fire_request_webhook_code' -Plaid.autoload :SandboxBankIncomeWebhookFireRequestWebhookFields, 'plaid/models/sandbox_bank_income_webhook_fire_request_webhook_fields' -Plaid.autoload :SandboxBankTransferFireWebhookRequest, 'plaid/models/sandbox_bank_transfer_fire_webhook_request' -Plaid.autoload :SandboxBankTransferFireWebhookResponse, 'plaid/models/sandbox_bank_transfer_fire_webhook_response' -Plaid.autoload :SandboxBankTransferSimulateRequest, 'plaid/models/sandbox_bank_transfer_simulate_request' -Plaid.autoload :SandboxBankTransferSimulateResponse, 'plaid/models/sandbox_bank_transfer_simulate_response' -Plaid.autoload :SandboxIncomeFireWebhookRequest, 'plaid/models/sandbox_income_fire_webhook_request' -Plaid.autoload :SandboxIncomeFireWebhookResponse, 'plaid/models/sandbox_income_fire_webhook_response' -Plaid.autoload :SandboxIncomeWebhookFireRequestWebhookCode, 'plaid/models/sandbox_income_webhook_fire_request_webhook_code' -Plaid.autoload :SandboxItemFireWebhookRequest, 'plaid/models/sandbox_item_fire_webhook_request' -Plaid.autoload :SandboxItemFireWebhookResponse, 'plaid/models/sandbox_item_fire_webhook_response' -Plaid.autoload :SandboxItemResetLoginRequest, 'plaid/models/sandbox_item_reset_login_request' -Plaid.autoload :SandboxItemResetLoginResponse, 'plaid/models/sandbox_item_reset_login_response' -Plaid.autoload :SandboxItemSetVerificationStatusRequest, 'plaid/models/sandbox_item_set_verification_status_request' -Plaid.autoload :SandboxItemSetVerificationStatusResponse, 'plaid/models/sandbox_item_set_verification_status_response' -Plaid.autoload :SandboxOauthSelectAccountsRequest, 'plaid/models/sandbox_oauth_select_accounts_request' -Plaid.autoload :SandboxPaymentProfileResetLoginRequest, 'plaid/models/sandbox_payment_profile_reset_login_request' -Plaid.autoload :SandboxPaymentProfileResetLoginResponse, 'plaid/models/sandbox_payment_profile_reset_login_response' -Plaid.autoload :SandboxProcessorTokenCreateRequest, 'plaid/models/sandbox_processor_token_create_request' -Plaid.autoload :SandboxProcessorTokenCreateRequestOptions, 'plaid/models/sandbox_processor_token_create_request_options' -Plaid.autoload :SandboxProcessorTokenCreateResponse, 'plaid/models/sandbox_processor_token_create_response' -Plaid.autoload :SandboxPublicTokenCreateRequest, 'plaid/models/sandbox_public_token_create_request' -Plaid.autoload :SandboxPublicTokenCreateRequestIncomeVerificationBankIncome, 'plaid/models/sandbox_public_token_create_request_income_verification_bank_income' -Plaid.autoload :SandboxPublicTokenCreateRequestOptions, 'plaid/models/sandbox_public_token_create_request_options' -Plaid.autoload :SandboxPublicTokenCreateRequestOptionsIncomeVerification, 'plaid/models/sandbox_public_token_create_request_options_income_verification' -Plaid.autoload :SandboxPublicTokenCreateRequestOptionsTransactions, 'plaid/models/sandbox_public_token_create_request_options_transactions' -Plaid.autoload :SandboxPublicTokenCreateResponse, 'plaid/models/sandbox_public_token_create_response' -Plaid.autoload :SandboxTransferFireWebhookRequest, 'plaid/models/sandbox_transfer_fire_webhook_request' -Plaid.autoload :SandboxTransferFireWebhookResponse, 'plaid/models/sandbox_transfer_fire_webhook_response' -Plaid.autoload :SandboxTransferLedgerDepositSimulateRequest, 'plaid/models/sandbox_transfer_ledger_deposit_simulate_request' -Plaid.autoload :SandboxTransferLedgerDepositSimulateResponse, 'plaid/models/sandbox_transfer_ledger_deposit_simulate_response' -Plaid.autoload :SandboxTransferLedgerSimulateAvailableRequest, 'plaid/models/sandbox_transfer_ledger_simulate_available_request' -Plaid.autoload :SandboxTransferLedgerSimulateAvailableResponse, 'plaid/models/sandbox_transfer_ledger_simulate_available_response' -Plaid.autoload :SandboxTransferLedgerWithdrawSimulateRequest, 'plaid/models/sandbox_transfer_ledger_withdraw_simulate_request' -Plaid.autoload :SandboxTransferLedgerWithdrawSimulateResponse, 'plaid/models/sandbox_transfer_ledger_withdraw_simulate_response' -Plaid.autoload :SandboxTransferRefundSimulateRequest, 'plaid/models/sandbox_transfer_refund_simulate_request' -Plaid.autoload :SandboxTransferRefundSimulateResponse, 'plaid/models/sandbox_transfer_refund_simulate_response' -Plaid.autoload :SandboxTransferRepaymentSimulateRequest, 'plaid/models/sandbox_transfer_repayment_simulate_request' -Plaid.autoload :SandboxTransferRepaymentSimulateResponse, 'plaid/models/sandbox_transfer_repayment_simulate_response' -Plaid.autoload :SandboxTransferSimulateRequest, 'plaid/models/sandbox_transfer_simulate_request' -Plaid.autoload :SandboxTransferSimulateResponse, 'plaid/models/sandbox_transfer_simulate_response' -Plaid.autoload :SandboxTransferSweepSimulateRequest, 'plaid/models/sandbox_transfer_sweep_simulate_request' -Plaid.autoload :SandboxTransferSweepSimulateResponse, 'plaid/models/sandbox_transfer_sweep_simulate_response' -Plaid.autoload :SandboxTransferTestClockAdvanceRequest, 'plaid/models/sandbox_transfer_test_clock_advance_request' -Plaid.autoload :SandboxTransferTestClockAdvanceResponse, 'plaid/models/sandbox_transfer_test_clock_advance_response' -Plaid.autoload :SandboxTransferTestClockCreateRequest, 'plaid/models/sandbox_transfer_test_clock_create_request' -Plaid.autoload :SandboxTransferTestClockCreateResponse, 'plaid/models/sandbox_transfer_test_clock_create_response' -Plaid.autoload :SandboxTransferTestClockGetRequest, 'plaid/models/sandbox_transfer_test_clock_get_request' -Plaid.autoload :SandboxTransferTestClockGetResponse, 'plaid/models/sandbox_transfer_test_clock_get_response' -Plaid.autoload :SandboxTransferTestClockListRequest, 'plaid/models/sandbox_transfer_test_clock_list_request' -Plaid.autoload :SandboxTransferTestClockListResponse, 'plaid/models/sandbox_transfer_test_clock_list_response' -Plaid.autoload :Scopes, 'plaid/models/scopes' -Plaid.autoload :ScopesContext, 'plaid/models/scopes_context' -Plaid.autoload :ScopesNullable, 'plaid/models/scopes_nullable' -Plaid.autoload :ScreeningHitAnalysis, 'plaid/models/screening_hit_analysis' -Plaid.autoload :ScreeningHitData, 'plaid/models/screening_hit_data' -Plaid.autoload :ScreeningHitDateOfBirthItem, 'plaid/models/screening_hit_date_of_birth_item' -Plaid.autoload :ScreeningHitDocumentsItems, 'plaid/models/screening_hit_documents_items' -Plaid.autoload :ScreeningHitNamesItems, 'plaid/models/screening_hit_names_items' -Plaid.autoload :ScreeningStatusUpdatedWebhook, 'plaid/models/screening_status_updated_webhook' -Plaid.autoload :Security, 'plaid/models/security' -Plaid.autoload :SecurityOverride, 'plaid/models/security_override' -Plaid.autoload :SelfieAnalysis, 'plaid/models/selfie_analysis' -Plaid.autoload :SelfieAnalysisDocumentComparison, 'plaid/models/selfie_analysis_document_comparison' -Plaid.autoload :SelfieCapture, 'plaid/models/selfie_capture' -Plaid.autoload :SelfieCheck, 'plaid/models/selfie_check' -Plaid.autoload :SelfieCheckSelfie, 'plaid/models/selfie_check_selfie' -Plaid.autoload :SelfieCheckStatus, 'plaid/models/selfie_check_status' -Plaid.autoload :SelfieStatus, 'plaid/models/selfie_status' -Plaid.autoload :SenderBACSNullable, 'plaid/models/sender_bacs_nullable' -Plaid.autoload :Service, 'plaid/models/service' -Plaid.autoload :ServiceProductFulfillment, 'plaid/models/service_product_fulfillment' -Plaid.autoload :ServiceProductFulfillmentDetail, 'plaid/models/service_product_fulfillment_detail' -Plaid.autoload :ServiceProductFulfillmentIdentifier, 'plaid/models/service_product_fulfillment_identifier' -Plaid.autoload :ServicerAddressData, 'plaid/models/servicer_address_data' -Plaid.autoload :Services, 'plaid/models/services' -Plaid.autoload :SignalAddressData, 'plaid/models/signal_address_data' -Plaid.autoload :SignalDecisionOutcome, 'plaid/models/signal_decision_outcome' -Plaid.autoload :SignalDecisionReportRequest, 'plaid/models/signal_decision_report_request' -Plaid.autoload :SignalDecisionReportResponse, 'plaid/models/signal_decision_report_response' -Plaid.autoload :SignalDevice, 'plaid/models/signal_device' -Plaid.autoload :SignalEvaluateCoreAttributes, 'plaid/models/signal_evaluate_core_attributes' -Plaid.autoload :SignalEvaluateRequest, 'plaid/models/signal_evaluate_request' -Plaid.autoload :SignalEvaluateResponse, 'plaid/models/signal_evaluate_response' -Plaid.autoload :SignalPaymentMethod, 'plaid/models/signal_payment_method' -Plaid.autoload :SignalPersonName, 'plaid/models/signal_person_name' -Plaid.autoload :SignalPrepareRequest, 'plaid/models/signal_prepare_request' -Plaid.autoload :SignalPrepareResponse, 'plaid/models/signal_prepare_response' -Plaid.autoload :SignalReturnReportRequest, 'plaid/models/signal_return_report_request' -Plaid.autoload :SignalReturnReportResponse, 'plaid/models/signal_return_report_response' -Plaid.autoload :SignalScores, 'plaid/models/signal_scores' -Plaid.autoload :SignalUser, 'plaid/models/signal_user' -Plaid.autoload :SignalWarning, 'plaid/models/signal_warning' -Plaid.autoload :SimulatedTransferSweep, 'plaid/models/simulated_transfer_sweep' -Plaid.autoload :SingleDocumentRiskSignal, 'plaid/models/single_document_risk_signal' -Plaid.autoload :Source, 'plaid/models/source' -Plaid.autoload :StandaloneAccountType, 'plaid/models/standalone_account_type' -Plaid.autoload :StandaloneCurrencyCodeList, 'plaid/models/standalone_currency_code_list' -Plaid.autoload :StandaloneInvestmentTransactionType, 'plaid/models/standalone_investment_transaction_type' -Plaid.autoload :StatementsAccount, 'plaid/models/statements_account' -Plaid.autoload :StatementsDownloadRequest, 'plaid/models/statements_download_request' -Plaid.autoload :StatementsListRequest, 'plaid/models/statements_list_request' -Plaid.autoload :StatementsListResponse, 'plaid/models/statements_list_response' -Plaid.autoload :StatementsRefreshCompleteResult, 'plaid/models/statements_refresh_complete_result' -Plaid.autoload :StatementsRefreshCompleteWebhook, 'plaid/models/statements_refresh_complete_webhook' -Plaid.autoload :StatementsRefreshRequest, 'plaid/models/statements_refresh_request' -Plaid.autoload :StatementsRefreshResponse, 'plaid/models/statements_refresh_response' -Plaid.autoload :StatementsStatement, 'plaid/models/statements_statement' -Plaid.autoload :Status, 'plaid/models/status' -Plaid.autoload :Statuses, 'plaid/models/statuses' -Plaid.autoload :Strategy, 'plaid/models/strategy' -Plaid.autoload :StudentLoan, 'plaid/models/student_loan' -Plaid.autoload :StudentLoanRepaymentModel, 'plaid/models/student_loan_repayment_model' -Plaid.autoload :StudentLoanStatus, 'plaid/models/student_loan_status' -Plaid.autoload :StudentRepaymentPlan, 'plaid/models/student_repayment_plan' -Plaid.autoload :SweepStatus, 'plaid/models/sweep_status' -Plaid.autoload :SweepTrigger, 'plaid/models/sweep_trigger' -Plaid.autoload :SyncUpdatesAvailableWebhook, 'plaid/models/sync_updates_available_webhook' -Plaid.autoload :Taxform, 'plaid/models/taxform' -Plaid.autoload :TaxpayerID, 'plaid/models/taxpayer_id' -Plaid.autoload :TaxpayerIdentifier, 'plaid/models/taxpayer_identifier' -Plaid.autoload :TaxpayerIdentifierType, 'plaid/models/taxpayer_identifier_type' -Plaid.autoload :TaxpayerIdentifiers, 'plaid/models/taxpayer_identifiers' -Plaid.autoload :Total, 'plaid/models/total' -Plaid.autoload :TotalCanonicalDescription, 'plaid/models/total_canonical_description' -Plaid.autoload :Transaction, 'plaid/models/transaction' -Plaid.autoload :TransactionAllOf, 'plaid/models/transaction_all_of' -Plaid.autoload :TransactionBase, 'plaid/models/transaction_base' -Plaid.autoload :TransactionCode, 'plaid/models/transaction_code' -Plaid.autoload :TransactionCounterparty, 'plaid/models/transaction_counterparty' -Plaid.autoload :TransactionData, 'plaid/models/transaction_data' -Plaid.autoload :TransactionOverride, 'plaid/models/transaction_override' -Plaid.autoload :TransactionStream, 'plaid/models/transaction_stream' -Plaid.autoload :TransactionStreamAmount, 'plaid/models/transaction_stream_amount' -Plaid.autoload :TransactionStreamStatus, 'plaid/models/transaction_stream_status' -Plaid.autoload :TransactionsCategoryRule, 'plaid/models/transactions_category_rule' -Plaid.autoload :TransactionsEnhanceGetRequest, 'plaid/models/transactions_enhance_get_request' -Plaid.autoload :TransactionsEnhanceGetResponse, 'plaid/models/transactions_enhance_get_response' -Plaid.autoload :TransactionsEnrichRequest, 'plaid/models/transactions_enrich_request' -Plaid.autoload :TransactionsEnrichRequestOptions, 'plaid/models/transactions_enrich_request_options' -Plaid.autoload :TransactionsEnrichResponse, 'plaid/models/transactions_enrich_response' -Plaid.autoload :TransactionsGetRequest, 'plaid/models/transactions_get_request' -Plaid.autoload :TransactionsGetRequestOptions, 'plaid/models/transactions_get_request_options' -Plaid.autoload :TransactionsGetResponse, 'plaid/models/transactions_get_response' -Plaid.autoload :TransactionsRecurringCreateInput, 'plaid/models/transactions_recurring_create_input' -Plaid.autoload :TransactionsRecurringCreateRequest, 'plaid/models/transactions_recurring_create_request' -Plaid.autoload :TransactionsRecurringCreateResponse, 'plaid/models/transactions_recurring_create_response' -Plaid.autoload :TransactionsRecurringGetRequest, 'plaid/models/transactions_recurring_get_request' -Plaid.autoload :TransactionsRecurringGetRequestOptions, 'plaid/models/transactions_recurring_get_request_options' -Plaid.autoload :TransactionsRecurringGetResponse, 'plaid/models/transactions_recurring_get_response' -Plaid.autoload :TransactionsRecurringMergeInput, 'plaid/models/transactions_recurring_merge_input' -Plaid.autoload :TransactionsRecurringMergeRequest, 'plaid/models/transactions_recurring_merge_request' -Plaid.autoload :TransactionsRecurringMergeResponse, 'plaid/models/transactions_recurring_merge_response' -Plaid.autoload :TransactionsRecurringUpdateInput, 'plaid/models/transactions_recurring_update_input' -Plaid.autoload :TransactionsRecurringUpdateRequest, 'plaid/models/transactions_recurring_update_request' -Plaid.autoload :TransactionsRecurringUpdateResponse, 'plaid/models/transactions_recurring_update_response' -Plaid.autoload :TransactionsRefreshRequest, 'plaid/models/transactions_refresh_request' -Plaid.autoload :TransactionsRefreshResponse, 'plaid/models/transactions_refresh_response' -Plaid.autoload :TransactionsRemovedWebhook, 'plaid/models/transactions_removed_webhook' -Plaid.autoload :TransactionsRuleDetails, 'plaid/models/transactions_rule_details' -Plaid.autoload :TransactionsRuleField, 'plaid/models/transactions_rule_field' -Plaid.autoload :TransactionsRuleType, 'plaid/models/transactions_rule_type' -Plaid.autoload :TransactionsRulesCreateRequest, 'plaid/models/transactions_rules_create_request' -Plaid.autoload :TransactionsRulesCreateResponse, 'plaid/models/transactions_rules_create_response' -Plaid.autoload :TransactionsRulesListRequest, 'plaid/models/transactions_rules_list_request' -Plaid.autoload :TransactionsRulesListResponse, 'plaid/models/transactions_rules_list_response' -Plaid.autoload :TransactionsRulesRemoveRequest, 'plaid/models/transactions_rules_remove_request' -Plaid.autoload :TransactionsRulesRemoveResponse, 'plaid/models/transactions_rules_remove_response' -Plaid.autoload :TransactionsSyncRequest, 'plaid/models/transactions_sync_request' -Plaid.autoload :TransactionsSyncRequestOptions, 'plaid/models/transactions_sync_request_options' -Plaid.autoload :TransactionsSyncResponse, 'plaid/models/transactions_sync_response' -Plaid.autoload :TransactionsUserInsightsGetRequest, 'plaid/models/transactions_user_insights_get_request' -Plaid.autoload :TransactionsUserInsightsGetResponse, 'plaid/models/transactions_user_insights_get_response' -Plaid.autoload :Transfer, 'plaid/models/transfer' -Plaid.autoload :TransferACHNetwork, 'plaid/models/transfer_ach_network' -Plaid.autoload :TransferAuthorization, 'plaid/models/transfer_authorization' -Plaid.autoload :TransferAuthorizationCreateRequest, 'plaid/models/transfer_authorization_create_request' -Plaid.autoload :TransferAuthorizationCreateResponse, 'plaid/models/transfer_authorization_create_response' -Plaid.autoload :TransferAuthorizationDecision, 'plaid/models/transfer_authorization_decision' -Plaid.autoload :TransferAuthorizationDecisionRationale, 'plaid/models/transfer_authorization_decision_rationale' -Plaid.autoload :TransferAuthorizationDecisionRationaleCode, 'plaid/models/transfer_authorization_decision_rationale_code' -Plaid.autoload :TransferAuthorizationDevice, 'plaid/models/transfer_authorization_device' -Plaid.autoload :TransferAuthorizationGuaranteeDecision, 'plaid/models/transfer_authorization_guarantee_decision' -Plaid.autoload :TransferAuthorizationGuaranteeDecisionRationale, 'plaid/models/transfer_authorization_guarantee_decision_rationale' -Plaid.autoload :TransferAuthorizationGuaranteeDecisionRationaleCode, 'plaid/models/transfer_authorization_guarantee_decision_rationale_code' -Plaid.autoload :TransferAuthorizationPaymentRisk, 'plaid/models/transfer_authorization_payment_risk' -Plaid.autoload :TransferAuthorizationProposedTransfer, 'plaid/models/transfer_authorization_proposed_transfer' -Plaid.autoload :TransferAuthorizationRiskLevel, 'plaid/models/transfer_authorization_risk_level' -Plaid.autoload :TransferAuthorizationUserInRequest, 'plaid/models/transfer_authorization_user_in_request' -Plaid.autoload :TransferBalance, 'plaid/models/transfer_balance' -Plaid.autoload :TransferBalanceGetRequest, 'plaid/models/transfer_balance_get_request' -Plaid.autoload :TransferBalanceGetResponse, 'plaid/models/transfer_balance_get_response' -Plaid.autoload :TransferBalanceType, 'plaid/models/transfer_balance_type' -Plaid.autoload :TransferCancelRequest, 'plaid/models/transfer_cancel_request' -Plaid.autoload :TransferCancelResponse, 'plaid/models/transfer_cancel_response' -Plaid.autoload :TransferCapabilitiesGetRTP, 'plaid/models/transfer_capabilities_get_rtp' -Plaid.autoload :TransferCapabilitiesGetRequest, 'plaid/models/transfer_capabilities_get_request' -Plaid.autoload :TransferCapabilitiesGetResponse, 'plaid/models/transfer_capabilities_get_response' -Plaid.autoload :TransferConfigurationGetRequest, 'plaid/models/transfer_configuration_get_request' -Plaid.autoload :TransferConfigurationGetResponse, 'plaid/models/transfer_configuration_get_response' -Plaid.autoload :TransferCreateRequest, 'plaid/models/transfer_create_request' -Plaid.autoload :TransferCreateResponse, 'plaid/models/transfer_create_response' -Plaid.autoload :TransferCreditFundsSource, 'plaid/models/transfer_credit_funds_source' -Plaid.autoload :TransferCreditUsageConfiguration, 'plaid/models/transfer_credit_usage_configuration' -Plaid.autoload :TransferDebitUsageConfiguration, 'plaid/models/transfer_debit_usage_configuration' -Plaid.autoload :TransferDevice, 'plaid/models/transfer_device' -Plaid.autoload :TransferDiligenceDocumentUploadRequest, 'plaid/models/transfer_diligence_document_upload_request' -Plaid.autoload :TransferDiligenceDocumentUploadResponse, 'plaid/models/transfer_diligence_document_upload_response' -Plaid.autoload :TransferDiligenceStatus, 'plaid/models/transfer_diligence_status' -Plaid.autoload :TransferDiligenceSubmitRequest, 'plaid/models/transfer_diligence_submit_request' -Plaid.autoload :TransferDiligenceSubmitResponse, 'plaid/models/transfer_diligence_submit_response' -Plaid.autoload :TransferDocumentPurpose, 'plaid/models/transfer_document_purpose' -Plaid.autoload :TransferEvent, 'plaid/models/transfer_event' -Plaid.autoload :TransferEventListRequest, 'plaid/models/transfer_event_list_request' -Plaid.autoload :TransferEventListResponse, 'plaid/models/transfer_event_list_response' -Plaid.autoload :TransferEventListTransferType, 'plaid/models/transfer_event_list_transfer_type' -Plaid.autoload :TransferEventSyncRequest, 'plaid/models/transfer_event_sync_request' -Plaid.autoload :TransferEventSyncResponse, 'plaid/models/transfer_event_sync_response' -Plaid.autoload :TransferEventType, 'plaid/models/transfer_event_type' -Plaid.autoload :TransferEventsUpdateWebhook, 'plaid/models/transfer_events_update_webhook' -Plaid.autoload :TransferExpectedSweepSettlementScheduleItem, 'plaid/models/transfer_expected_sweep_settlement_schedule_item' -Plaid.autoload :TransferFailure, 'plaid/models/transfer_failure' -Plaid.autoload :TransferFundingAccount, 'plaid/models/transfer_funding_account' -Plaid.autoload :TransferGetRequest, 'plaid/models/transfer_get_request' -Plaid.autoload :TransferGetResponse, 'plaid/models/transfer_get_response' -Plaid.autoload :TransferIntentAuthorizationDecision, 'plaid/models/transfer_intent_authorization_decision' -Plaid.autoload :TransferIntentCreate, 'plaid/models/transfer_intent_create' -Plaid.autoload :TransferIntentCreateMode, 'plaid/models/transfer_intent_create_mode' -Plaid.autoload :TransferIntentCreateNetwork, 'plaid/models/transfer_intent_create_network' -Plaid.autoload :TransferIntentCreateRequest, 'plaid/models/transfer_intent_create_request' -Plaid.autoload :TransferIntentCreateResponse, 'plaid/models/transfer_intent_create_response' -Plaid.autoload :TransferIntentGet, 'plaid/models/transfer_intent_get' -Plaid.autoload :TransferIntentGetFailureReason, 'plaid/models/transfer_intent_get_failure_reason' -Plaid.autoload :TransferIntentGetRequest, 'plaid/models/transfer_intent_get_request' -Plaid.autoload :TransferIntentGetResponse, 'plaid/models/transfer_intent_get_response' -Plaid.autoload :TransferIntentStatus, 'plaid/models/transfer_intent_status' -Plaid.autoload :TransferLedgerBalance, 'plaid/models/transfer_ledger_balance' -Plaid.autoload :TransferLedgerDepositRequest, 'plaid/models/transfer_ledger_deposit_request' -Plaid.autoload :TransferLedgerDepositResponse, 'plaid/models/transfer_ledger_deposit_response' -Plaid.autoload :TransferLedgerDistributeRequest, 'plaid/models/transfer_ledger_distribute_request' -Plaid.autoload :TransferLedgerDistributeResponse, 'plaid/models/transfer_ledger_distribute_response' -Plaid.autoload :TransferLedgerGetRequest, 'plaid/models/transfer_ledger_get_request' -Plaid.autoload :TransferLedgerGetResponse, 'plaid/models/transfer_ledger_get_response' -Plaid.autoload :TransferLedgerSweepSimulateEventType, 'plaid/models/transfer_ledger_sweep_simulate_event_type' -Plaid.autoload :TransferLedgerWithdrawRequest, 'plaid/models/transfer_ledger_withdraw_request' -Plaid.autoload :TransferLedgerWithdrawResponse, 'plaid/models/transfer_ledger_withdraw_response' -Plaid.autoload :TransferListRequest, 'plaid/models/transfer_list_request' -Plaid.autoload :TransferListResponse, 'plaid/models/transfer_list_response' -Plaid.autoload :TransferMetricsGetRequest, 'plaid/models/transfer_metrics_get_request' -Plaid.autoload :TransferMetricsGetResponse, 'plaid/models/transfer_metrics_get_response' -Plaid.autoload :TransferMigrateAccountRequest, 'plaid/models/transfer_migrate_account_request' -Plaid.autoload :TransferMigrateAccountResponse, 'plaid/models/transfer_migrate_account_response' -Plaid.autoload :TransferNetwork, 'plaid/models/transfer_network' -Plaid.autoload :TransferOriginatorAddress, 'plaid/models/transfer_originator_address' -Plaid.autoload :TransferOriginatorCreateRequest, 'plaid/models/transfer_originator_create_request' -Plaid.autoload :TransferOriginatorCreateResponse, 'plaid/models/transfer_originator_create_response' -Plaid.autoload :TransferOriginatorDiligence, 'plaid/models/transfer_originator_diligence' -Plaid.autoload :TransferOriginatorFundingAccountUpdateRequest, 'plaid/models/transfer_originator_funding_account_update_request' -Plaid.autoload :TransferOriginatorFundingAccountUpdateResponse, 'plaid/models/transfer_originator_funding_account_update_response' -Plaid.autoload :TransferOriginatorGetRequest, 'plaid/models/transfer_originator_get_request' -Plaid.autoload :TransferOriginatorGetResponse, 'plaid/models/transfer_originator_get_response' -Plaid.autoload :TransferOriginatorListRequest, 'plaid/models/transfer_originator_list_request' -Plaid.autoload :TransferOriginatorListResponse, 'plaid/models/transfer_originator_list_response' -Plaid.autoload :TransferQuestionnaireCreateRequest, 'plaid/models/transfer_questionnaire_create_request' -Plaid.autoload :TransferQuestionnaireCreateResponse, 'plaid/models/transfer_questionnaire_create_response' -Plaid.autoload :TransferRecurringCancelRequest, 'plaid/models/transfer_recurring_cancel_request' -Plaid.autoload :TransferRecurringCancelResponse, 'plaid/models/transfer_recurring_cancel_response' -Plaid.autoload :TransferRecurringCreateRequest, 'plaid/models/transfer_recurring_create_request' -Plaid.autoload :TransferRecurringCreateResponse, 'plaid/models/transfer_recurring_create_response' -Plaid.autoload :TransferRecurringGetRequest, 'plaid/models/transfer_recurring_get_request' -Plaid.autoload :TransferRecurringGetResponse, 'plaid/models/transfer_recurring_get_response' -Plaid.autoload :TransferRecurringListRequest, 'plaid/models/transfer_recurring_list_request' -Plaid.autoload :TransferRecurringListResponse, 'plaid/models/transfer_recurring_list_response' -Plaid.autoload :TransferRecurringSchedule, 'plaid/models/transfer_recurring_schedule' -Plaid.autoload :TransferRecurringStatus, 'plaid/models/transfer_recurring_status' -Plaid.autoload :TransferRefund, 'plaid/models/transfer_refund' -Plaid.autoload :TransferRefundCancelRequest, 'plaid/models/transfer_refund_cancel_request' -Plaid.autoload :TransferRefundCancelResponse, 'plaid/models/transfer_refund_cancel_response' -Plaid.autoload :TransferRefundCreateRequest, 'plaid/models/transfer_refund_create_request' -Plaid.autoload :TransferRefundCreateResponse, 'plaid/models/transfer_refund_create_response' -Plaid.autoload :TransferRefundFailure, 'plaid/models/transfer_refund_failure' -Plaid.autoload :TransferRefundGetRequest, 'plaid/models/transfer_refund_get_request' -Plaid.autoload :TransferRefundGetResponse, 'plaid/models/transfer_refund_get_response' -Plaid.autoload :TransferRefundStatus, 'plaid/models/transfer_refund_status' -Plaid.autoload :TransferRepayment, 'plaid/models/transfer_repayment' -Plaid.autoload :TransferRepaymentListRequest, 'plaid/models/transfer_repayment_list_request' -Plaid.autoload :TransferRepaymentListResponse, 'plaid/models/transfer_repayment_list_response' -Plaid.autoload :TransferRepaymentReturn, 'plaid/models/transfer_repayment_return' -Plaid.autoload :TransferRepaymentReturnListRequest, 'plaid/models/transfer_repayment_return_list_request' -Plaid.autoload :TransferRepaymentReturnListResponse, 'plaid/models/transfer_repayment_return_list_response' -Plaid.autoload :TransferScheduleIntervalUnit, 'plaid/models/transfer_schedule_interval_unit' -Plaid.autoload :TransferStatus, 'plaid/models/transfer_status' -Plaid.autoload :TransferSweep, 'plaid/models/transfer_sweep' -Plaid.autoload :TransferSweepGetRequest, 'plaid/models/transfer_sweep_get_request' -Plaid.autoload :TransferSweepGetResponse, 'plaid/models/transfer_sweep_get_response' -Plaid.autoload :TransferSweepListRequest, 'plaid/models/transfer_sweep_list_request' -Plaid.autoload :TransferSweepListResponse, 'plaid/models/transfer_sweep_list_response' -Plaid.autoload :TransferSweepStatus, 'plaid/models/transfer_sweep_status' -Plaid.autoload :TransferTestClock, 'plaid/models/transfer_test_clock' -Plaid.autoload :TransferType, 'plaid/models/transfer_type' -Plaid.autoload :TransferUserAddressInRequest, 'plaid/models/transfer_user_address_in_request' -Plaid.autoload :TransferUserAddressInResponse, 'plaid/models/transfer_user_address_in_response' -Plaid.autoload :TransferUserInRequest, 'plaid/models/transfer_user_in_request' -Plaid.autoload :TransferUserInRequestDeprecated, 'plaid/models/transfer_user_in_request_deprecated' -Plaid.autoload :TransferUserInResponse, 'plaid/models/transfer_user_in_response' -Plaid.autoload :TransferWireDetails, 'plaid/models/transfer_wire_details' -Plaid.autoload :UpdateEntityScreeningRequestSearchTerms, 'plaid/models/update_entity_screening_request_search_terms' -Plaid.autoload :UpdateIndividualScreeningRequestSearchTerms, 'plaid/models/update_individual_screening_request_search_terms' -Plaid.autoload :UserAccountRevokedWebhook, 'plaid/models/user_account_revoked_webhook' -Plaid.autoload :UserAddress, 'plaid/models/user_address' -Plaid.autoload :UserCreateRequest, 'plaid/models/user_create_request' -Plaid.autoload :UserCreateResponse, 'plaid/models/user_create_response' -Plaid.autoload :UserCustomPassword, 'plaid/models/user_custom_password' -Plaid.autoload :UserDataOverview, 'plaid/models/user_data_overview' -Plaid.autoload :UserIDNumber, 'plaid/models/user_id_number' -Plaid.autoload :UserPermissionRevokedWebhook, 'plaid/models/user_permission_revoked_webhook' -Plaid.autoload :UserStatedIncomeSourceCategory, 'plaid/models/user_stated_income_source_category' -Plaid.autoload :UserStatedIncomeSourceFrequency, 'plaid/models/user_stated_income_source_frequency' -Plaid.autoload :UserStatedIncomeSourcePayType, 'plaid/models/user_stated_income_source_pay_type' -Plaid.autoload :UserUpdateRequest, 'plaid/models/user_update_request' -Plaid.autoload :UserUpdateResponse, 'plaid/models/user_update_response' -Plaid.autoload :ValidationSource, 'plaid/models/validation_source' -Plaid.autoload :ValidationSources, 'plaid/models/validation_sources' -Plaid.autoload :VerificationExpiredWebhook, 'plaid/models/verification_expired_webhook' -Plaid.autoload :VerificationOfAsset, 'plaid/models/verification_of_asset' -Plaid.autoload :VerificationOfAssetResponse, 'plaid/models/verification_of_asset_response' -Plaid.autoload :VerificationRefreshStatus, 'plaid/models/verification_refresh_status' -Plaid.autoload :VerificationStatus, 'plaid/models/verification_status' -Plaid.autoload :W2, 'plaid/models/w2' -Plaid.autoload :W2Box12, 'plaid/models/w2_box12' -Plaid.autoload :W2StateAndLocalWages, 'plaid/models/w2_state_and_local_wages' -Plaid.autoload :Wallet, 'plaid/models/wallet' -Plaid.autoload :WalletBalance, 'plaid/models/wallet_balance' -Plaid.autoload :WalletCreateRequest, 'plaid/models/wallet_create_request' -Plaid.autoload :WalletCreateResponse, 'plaid/models/wallet_create_response' -Plaid.autoload :WalletGetRequest, 'plaid/models/wallet_get_request' -Plaid.autoload :WalletGetResponse, 'plaid/models/wallet_get_response' -Plaid.autoload :WalletISOCurrencyCode, 'plaid/models/wallet_iso_currency_code' -Plaid.autoload :WalletListRequest, 'plaid/models/wallet_list_request' -Plaid.autoload :WalletListResponse, 'plaid/models/wallet_list_response' -Plaid.autoload :WalletNumbers, 'plaid/models/wallet_numbers' -Plaid.autoload :WalletPaymentScheme, 'plaid/models/wallet_payment_scheme' -Plaid.autoload :WalletStatus, 'plaid/models/wallet_status' -Plaid.autoload :WalletTransaction, 'plaid/models/wallet_transaction' -Plaid.autoload :WalletTransactionAmount, 'plaid/models/wallet_transaction_amount' -Plaid.autoload :WalletTransactionCounterparty, 'plaid/models/wallet_transaction_counterparty' -Plaid.autoload :WalletTransactionCounterpartyBACS, 'plaid/models/wallet_transaction_counterparty_bacs' -Plaid.autoload :WalletTransactionCounterpartyInternational, 'plaid/models/wallet_transaction_counterparty_international' -Plaid.autoload :WalletTransactionCounterpartyNumbers, 'plaid/models/wallet_transaction_counterparty_numbers' -Plaid.autoload :WalletTransactionExecuteRequest, 'plaid/models/wallet_transaction_execute_request' -Plaid.autoload :WalletTransactionExecuteResponse, 'plaid/models/wallet_transaction_execute_response' -Plaid.autoload :WalletTransactionFailureReason, 'plaid/models/wallet_transaction_failure_reason' -Plaid.autoload :WalletTransactionGetRequest, 'plaid/models/wallet_transaction_get_request' -Plaid.autoload :WalletTransactionGetResponse, 'plaid/models/wallet_transaction_get_response' -Plaid.autoload :WalletTransactionListRequest, 'plaid/models/wallet_transaction_list_request' -Plaid.autoload :WalletTransactionListRequestOptions, 'plaid/models/wallet_transaction_list_request_options' -Plaid.autoload :WalletTransactionListResponse, 'plaid/models/wallet_transaction_list_response' -Plaid.autoload :WalletTransactionStatus, 'plaid/models/wallet_transaction_status' -Plaid.autoload :WalletTransactionStatusUpdateWebhook, 'plaid/models/wallet_transaction_status_update_webhook' -Plaid.autoload :WalletTransactionsListRequest, 'plaid/models/wallet_transactions_list_request' -Plaid.autoload :Warning, 'plaid/models/warning' -Plaid.autoload :WatchlistScreeningAuditTrail, 'plaid/models/watchlist_screening_audit_trail' -Plaid.autoload :WatchlistScreeningDocument, 'plaid/models/watchlist_screening_document' -Plaid.autoload :WatchlistScreeningDocumentType, 'plaid/models/watchlist_screening_document_type' -Plaid.autoload :WatchlistScreeningEntityCreateRequest, 'plaid/models/watchlist_screening_entity_create_request' -Plaid.autoload :WatchlistScreeningEntityCreateResponse, 'plaid/models/watchlist_screening_entity_create_response' -Plaid.autoload :WatchlistScreeningEntityGetRequest, 'plaid/models/watchlist_screening_entity_get_request' -Plaid.autoload :WatchlistScreeningEntityGetResponse, 'plaid/models/watchlist_screening_entity_get_response' -Plaid.autoload :WatchlistScreeningEntityHistoryListRequest, 'plaid/models/watchlist_screening_entity_history_list_request' -Plaid.autoload :WatchlistScreeningEntityHistoryListResponse, 'plaid/models/watchlist_screening_entity_history_list_response' -Plaid.autoload :WatchlistScreeningEntityHitListRequest, 'plaid/models/watchlist_screening_entity_hit_list_request' -Plaid.autoload :WatchlistScreeningEntityHitListResponse, 'plaid/models/watchlist_screening_entity_hit_list_response' -Plaid.autoload :WatchlistScreeningEntityListRequest, 'plaid/models/watchlist_screening_entity_list_request' -Plaid.autoload :WatchlistScreeningEntityListResponse, 'plaid/models/watchlist_screening_entity_list_response' -Plaid.autoload :WatchlistScreeningEntityProgramGetRequest, 'plaid/models/watchlist_screening_entity_program_get_request' -Plaid.autoload :WatchlistScreeningEntityProgramGetResponse, 'plaid/models/watchlist_screening_entity_program_get_response' -Plaid.autoload :WatchlistScreeningEntityProgramListRequest, 'plaid/models/watchlist_screening_entity_program_list_request' -Plaid.autoload :WatchlistScreeningEntityProgramListResponse, 'plaid/models/watchlist_screening_entity_program_list_response' -Plaid.autoload :WatchlistScreeningEntityReviewCreateRequest, 'plaid/models/watchlist_screening_entity_review_create_request' -Plaid.autoload :WatchlistScreeningEntityReviewCreateResponse, 'plaid/models/watchlist_screening_entity_review_create_response' -Plaid.autoload :WatchlistScreeningEntityReviewListRequest, 'plaid/models/watchlist_screening_entity_review_list_request' -Plaid.autoload :WatchlistScreeningEntityReviewListResponse, 'plaid/models/watchlist_screening_entity_review_list_response' -Plaid.autoload :WatchlistScreeningEntityUpdateRequest, 'plaid/models/watchlist_screening_entity_update_request' -Plaid.autoload :WatchlistScreeningEntityUpdateRequestResettableField, 'plaid/models/watchlist_screening_entity_update_request_resettable_field' -Plaid.autoload :WatchlistScreeningEntityUpdateResponse, 'plaid/models/watchlist_screening_entity_update_response' -Plaid.autoload :WatchlistScreeningHit, 'plaid/models/watchlist_screening_hit' -Plaid.autoload :WatchlistScreeningHitLocations, 'plaid/models/watchlist_screening_hit_locations' -Plaid.autoload :WatchlistScreeningHitStatus, 'plaid/models/watchlist_screening_hit_status' -Plaid.autoload :WatchlistScreeningIndividual, 'plaid/models/watchlist_screening_individual' -Plaid.autoload :WatchlistScreeningIndividualCreateRequest, 'plaid/models/watchlist_screening_individual_create_request' -Plaid.autoload :WatchlistScreeningIndividualCreateResponse, 'plaid/models/watchlist_screening_individual_create_response' -Plaid.autoload :WatchlistScreeningIndividualGetRequest, 'plaid/models/watchlist_screening_individual_get_request' -Plaid.autoload :WatchlistScreeningIndividualGetResponse, 'plaid/models/watchlist_screening_individual_get_response' -Plaid.autoload :WatchlistScreeningIndividualHistoryListRequest, 'plaid/models/watchlist_screening_individual_history_list_request' -Plaid.autoload :WatchlistScreeningIndividualHistoryListResponse, 'plaid/models/watchlist_screening_individual_history_list_response' -Plaid.autoload :WatchlistScreeningIndividualHitListRequest, 'plaid/models/watchlist_screening_individual_hit_list_request' -Plaid.autoload :WatchlistScreeningIndividualHitListResponse, 'plaid/models/watchlist_screening_individual_hit_list_response' -Plaid.autoload :WatchlistScreeningIndividualListRequest, 'plaid/models/watchlist_screening_individual_list_request' -Plaid.autoload :WatchlistScreeningIndividualListResponse, 'plaid/models/watchlist_screening_individual_list_response' -Plaid.autoload :WatchlistScreeningIndividualProgramGetRequest, 'plaid/models/watchlist_screening_individual_program_get_request' -Plaid.autoload :WatchlistScreeningIndividualProgramGetResponse, 'plaid/models/watchlist_screening_individual_program_get_response' -Plaid.autoload :WatchlistScreeningIndividualProgramListRequest, 'plaid/models/watchlist_screening_individual_program_list_request' -Plaid.autoload :WatchlistScreeningIndividualProgramListResponse, 'plaid/models/watchlist_screening_individual_program_list_response' -Plaid.autoload :WatchlistScreeningIndividualReviewCreateRequest, 'plaid/models/watchlist_screening_individual_review_create_request' -Plaid.autoload :WatchlistScreeningIndividualReviewCreateResponse, 'plaid/models/watchlist_screening_individual_review_create_response' -Plaid.autoload :WatchlistScreeningIndividualReviewListRequest, 'plaid/models/watchlist_screening_individual_review_list_request' -Plaid.autoload :WatchlistScreeningIndividualReviewListResponse, 'plaid/models/watchlist_screening_individual_review_list_response' -Plaid.autoload :WatchlistScreeningIndividualUpdateRequest, 'plaid/models/watchlist_screening_individual_update_request' -Plaid.autoload :WatchlistScreeningIndividualUpdateRequestResettableField, 'plaid/models/watchlist_screening_individual_update_request_resettable_field' -Plaid.autoload :WatchlistScreeningIndividualUpdateResponse, 'plaid/models/watchlist_screening_individual_update_response' -Plaid.autoload :WatchlistScreeningRequestSearchTerms, 'plaid/models/watchlist_screening_request_search_terms' -Plaid.autoload :WatchlistScreeningReview, 'plaid/models/watchlist_screening_review' -Plaid.autoload :WatchlistScreeningSearchTerms, 'plaid/models/watchlist_screening_search_terms' -Plaid.autoload :WatchlistScreeningStatus, 'plaid/models/watchlist_screening_status' -Plaid.autoload :WeakAliasDetermination, 'plaid/models/weak_alias_determination' -Plaid.autoload :WebhookEnvironmentValues, 'plaid/models/webhook_environment_values' -Plaid.autoload :WebhookType, 'plaid/models/webhook_type' -Plaid.autoload :WebhookUpdateAcknowledgedWebhook, 'plaid/models/webhook_update_acknowledged_webhook' -Plaid.autoload :WebhookVerificationKeyGetRequest, 'plaid/models/webhook_verification_key_get_request' -Plaid.autoload :WebhookVerificationKeyGetResponse, 'plaid/models/webhook_verification_key_get_response' -Plaid.autoload :YTDGrossIncomeSummaryFieldNumber, 'plaid/models/ytd_gross_income_summary_field_number' -Plaid.autoload :YTDNetIncomeSummaryFieldNumber, 'plaid/models/ytd_net_income_summary_field_number' - -# APIs -Plaid.autoload :PlaidApi, 'plaid/api/plaid_api' - -module Plaid - class << self - # Customize default settings for the SDK using block. - # Plaid.configure do |config| - # config.username = "xxx" - # config.password = "xxx" - # end - # If no block given, return the default Configuration object. - def configure - if block_given? - yield(Configuration.default) - else - Configuration.default - end - end - end -end diff --git a/lib/plaid/api/plaid_api.rb b/lib/plaid/api/plaid_api.rb deleted file mode 100644 index 1c1901a37..000000000 --- a/lib/plaid/api/plaid_api.rb +++ /dev/null @@ -1,17226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'cgi' - -module Plaid - class PlaidApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.default) - @api_client = api_client - end - # 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. - # @param accounts_balance_get_request [AccountsBalanceGetRequest] - # @param [Hash] opts the optional parameters - # @return [AccountsGetResponse] - def accounts_balance_get(accounts_balance_get_request, opts = {}) - data, _status_code, _headers = accounts_balance_get_with_http_info(accounts_balance_get_request, opts) - data - end - - # 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. - # @param accounts_balance_get_request [AccountsBalanceGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(AccountsGetResponse, Integer, Hash)>] AccountsGetResponse data, response status code and response headers - def accounts_balance_get_with_http_info(accounts_balance_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.accounts_balance_get ...' - end - # verify the required parameter 'accounts_balance_get_request' is set - if @api_client.config.client_side_validation && accounts_balance_get_request.nil? - fail ArgumentError, "Missing the required parameter 'accounts_balance_get_request' when calling PlaidApi.accounts_balance_get" - end - # resource path - local_var_path = '/accounts/balance/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(accounts_balance_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'AccountsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.accounts_balance_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#accounts_balance_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param accounts_get_request [AccountsGetRequest] - # @param [Hash] opts the optional parameters - # @return [AccountsGetResponse] - def accounts_get(accounts_get_request, opts = {}) - data, _status_code, _headers = accounts_get_with_http_info(accounts_get_request, opts) - data - end - - # 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. - # @param accounts_get_request [AccountsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(AccountsGetResponse, Integer, Hash)>] AccountsGetResponse data, response status code and response headers - def accounts_get_with_http_info(accounts_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.accounts_get ...' - end - # verify the required parameter 'accounts_get_request' is set - if @api_client.config.client_side_validation && accounts_get_request.nil? - fail ArgumentError, "Missing the required parameter 'accounts_get_request' when calling PlaidApi.accounts_get" - end - # resource path - local_var_path = '/accounts/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(accounts_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'AccountsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.accounts_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#accounts_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve information about a Plaid application - # Allows financial institutions to retrieve information about Plaid clients for the purpose of building control-tower experiences - # @param application_get_request [ApplicationGetRequest] - # @param [Hash] opts the optional parameters - # @return [ApplicationGetResponse] - def application_get(application_get_request, opts = {}) - data, _status_code, _headers = application_get_with_http_info(application_get_request, opts) - data - end - - # Retrieve information about a Plaid application - # Allows financial institutions to retrieve information about Plaid clients for the purpose of building control-tower experiences - # @param application_get_request [ApplicationGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ApplicationGetResponse, Integer, Hash)>] ApplicationGetResponse data, response status code and response headers - def application_get_with_http_info(application_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.application_get ...' - end - # verify the required parameter 'application_get_request' is set - if @api_client.config.client_side_validation && application_get_request.nil? - fail ArgumentError, "Missing the required parameter 'application_get_request' when calling PlaidApi.application_get" - end - # resource path - local_var_path = '/application/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(application_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'ApplicationGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.application_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#application_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param asset_report_audit_copy_create_request [AssetReportAuditCopyCreateRequest] - # @param [Hash] opts the optional parameters - # @return [AssetReportAuditCopyCreateResponse] - def asset_report_audit_copy_create(asset_report_audit_copy_create_request, opts = {}) - data, _status_code, _headers = asset_report_audit_copy_create_with_http_info(asset_report_audit_copy_create_request, opts) - data - end - - # 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. - # @param asset_report_audit_copy_create_request [AssetReportAuditCopyCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(AssetReportAuditCopyCreateResponse, Integer, Hash)>] AssetReportAuditCopyCreateResponse data, response status code and response headers - def asset_report_audit_copy_create_with_http_info(asset_report_audit_copy_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.asset_report_audit_copy_create ...' - end - # verify the required parameter 'asset_report_audit_copy_create_request' is set - if @api_client.config.client_side_validation && asset_report_audit_copy_create_request.nil? - fail ArgumentError, "Missing the required parameter 'asset_report_audit_copy_create_request' when calling PlaidApi.asset_report_audit_copy_create" - end - # resource path - local_var_path = '/asset_report/audit_copy/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(asset_report_audit_copy_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'AssetReportAuditCopyCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.asset_report_audit_copy_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#asset_report_audit_copy_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`. - # @param asset_report_audit_copy_get_request [AssetReportAuditCopyGetRequest] - # @param [Hash] opts the optional parameters - # @return [AssetReportGetResponse] - def asset_report_audit_copy_get(asset_report_audit_copy_get_request, opts = {}) - data, _status_code, _headers = asset_report_audit_copy_get_with_http_info(asset_report_audit_copy_get_request, opts) - data - end - - # 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`. - # @param asset_report_audit_copy_get_request [AssetReportAuditCopyGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(AssetReportGetResponse, Integer, Hash)>] AssetReportGetResponse data, response status code and response headers - def asset_report_audit_copy_get_with_http_info(asset_report_audit_copy_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.asset_report_audit_copy_get ...' - end - # verify the required parameter 'asset_report_audit_copy_get_request' is set - if @api_client.config.client_side_validation && asset_report_audit_copy_get_request.nil? - fail ArgumentError, "Missing the required parameter 'asset_report_audit_copy_get_request' when calling PlaidApi.asset_report_audit_copy_get" - end - # resource path - local_var_path = '/asset_report/audit_copy/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(asset_report_audit_copy_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'AssetReportGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.asset_report_audit_copy_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#asset_report_audit_copy_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param asset_report_audit_copy_remove_request [AssetReportAuditCopyRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [AssetReportAuditCopyRemoveResponse] - def asset_report_audit_copy_remove(asset_report_audit_copy_remove_request, opts = {}) - data, _status_code, _headers = asset_report_audit_copy_remove_with_http_info(asset_report_audit_copy_remove_request, opts) - data - end - - # 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. - # @param asset_report_audit_copy_remove_request [AssetReportAuditCopyRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(AssetReportAuditCopyRemoveResponse, Integer, Hash)>] AssetReportAuditCopyRemoveResponse data, response status code and response headers - def asset_report_audit_copy_remove_with_http_info(asset_report_audit_copy_remove_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.asset_report_audit_copy_remove ...' - end - # verify the required parameter 'asset_report_audit_copy_remove_request' is set - if @api_client.config.client_side_validation && asset_report_audit_copy_remove_request.nil? - fail ArgumentError, "Missing the required parameter 'asset_report_audit_copy_remove_request' when calling PlaidApi.asset_report_audit_copy_remove" - end - # resource path - local_var_path = '/asset_report/audit_copy/remove' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(asset_report_audit_copy_remove_request) - - # return_type - return_type = opts[:debug_return_type] || 'AssetReportAuditCopyRemoveResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.asset_report_audit_copy_remove", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#asset_report_audit_copy_remove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param asset_report_create_request [AssetReportCreateRequest] - # @param [Hash] opts the optional parameters - # @return [AssetReportCreateResponse] - def asset_report_create(asset_report_create_request, opts = {}) - data, _status_code, _headers = asset_report_create_with_http_info(asset_report_create_request, opts) - data - end - - # 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. - # @param asset_report_create_request [AssetReportCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(AssetReportCreateResponse, Integer, Hash)>] AssetReportCreateResponse data, response status code and response headers - def asset_report_create_with_http_info(asset_report_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.asset_report_create ...' - end - # verify the required parameter 'asset_report_create_request' is set - if @api_client.config.client_side_validation && asset_report_create_request.nil? - fail ArgumentError, "Missing the required parameter 'asset_report_create_request' when calling PlaidApi.asset_report_create" - end - # resource path - local_var_path = '/asset_report/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(asset_report_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'AssetReportCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.asset_report_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#asset_report_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param asset_report_filter_request [AssetReportFilterRequest] - # @param [Hash] opts the optional parameters - # @return [AssetReportFilterResponse] - def asset_report_filter(asset_report_filter_request, opts = {}) - data, _status_code, _headers = asset_report_filter_with_http_info(asset_report_filter_request, opts) - data - end - - # 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. - # @param asset_report_filter_request [AssetReportFilterRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(AssetReportFilterResponse, Integer, Hash)>] AssetReportFilterResponse data, response status code and response headers - def asset_report_filter_with_http_info(asset_report_filter_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.asset_report_filter ...' - end - # verify the required parameter 'asset_report_filter_request' is set - if @api_client.config.client_side_validation && asset_report_filter_request.nil? - fail ArgumentError, "Missing the required parameter 'asset_report_filter_request' when calling PlaidApi.asset_report_filter" - end - # resource path - local_var_path = '/asset_report/filter' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(asset_report_filter_request) - - # return_type - return_type = opts[:debug_return_type] || 'AssetReportFilterResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.asset_report_filter", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#asset_report_filter\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param asset_report_get_request [AssetReportGetRequest] - # @param [Hash] opts the optional parameters - # @return [AssetReportGetResponse] - def asset_report_get(asset_report_get_request, opts = {}) - data, _status_code, _headers = asset_report_get_with_http_info(asset_report_get_request, opts) - data - end - - # 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. - # @param asset_report_get_request [AssetReportGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(AssetReportGetResponse, Integer, Hash)>] AssetReportGetResponse data, response status code and response headers - def asset_report_get_with_http_info(asset_report_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.asset_report_get ...' - end - # verify the required parameter 'asset_report_get_request' is set - if @api_client.config.client_side_validation && asset_report_get_request.nil? - fail ArgumentError, "Missing the required parameter 'asset_report_get_request' when calling PlaidApi.asset_report_get" - end - # resource path - local_var_path = '/asset_report/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(asset_report_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'AssetReportGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.asset_report_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#asset_report_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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). - # @param asset_report_pdf_get_request [AssetReportPDFGetRequest] - # @param [Hash] opts the optional parameters - # @return [File] - def asset_report_pdf_get(asset_report_pdf_get_request, opts = {}) - data, _status_code, _headers = asset_report_pdf_get_with_http_info(asset_report_pdf_get_request, opts) - data - end - - # 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). - # @param asset_report_pdf_get_request [AssetReportPDFGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def asset_report_pdf_get_with_http_info(asset_report_pdf_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.asset_report_pdf_get ...' - end - # verify the required parameter 'asset_report_pdf_get_request' is set - if @api_client.config.client_side_validation && asset_report_pdf_get_request.nil? - fail ArgumentError, "Missing the required parameter 'asset_report_pdf_get_request' when calling PlaidApi.asset_report_pdf_get" - end - # resource path - local_var_path = '/asset_report/pdf/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/pdf']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(asset_report_pdf_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'File' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.asset_report_pdf_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#asset_report_pdf_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param asset_report_refresh_request [AssetReportRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [AssetReportRefreshResponse] - def asset_report_refresh(asset_report_refresh_request, opts = {}) - data, _status_code, _headers = asset_report_refresh_with_http_info(asset_report_refresh_request, opts) - data - end - - # 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. - # @param asset_report_refresh_request [AssetReportRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(AssetReportRefreshResponse, Integer, Hash)>] AssetReportRefreshResponse data, response status code and response headers - def asset_report_refresh_with_http_info(asset_report_refresh_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.asset_report_refresh ...' - end - # verify the required parameter 'asset_report_refresh_request' is set - if @api_client.config.client_side_validation && asset_report_refresh_request.nil? - fail ArgumentError, "Missing the required parameter 'asset_report_refresh_request' when calling PlaidApi.asset_report_refresh" - end - # resource path - local_var_path = '/asset_report/refresh' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(asset_report_refresh_request) - - # return_type - return_type = opts[:debug_return_type] || 'AssetReportRefreshResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.asset_report_refresh", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#asset_report_refresh\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param asset_report_remove_request [AssetReportRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [AssetReportRemoveResponse] - def asset_report_remove(asset_report_remove_request, opts = {}) - data, _status_code, _headers = asset_report_remove_with_http_info(asset_report_remove_request, opts) - data - end - - # 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. - # @param asset_report_remove_request [AssetReportRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(AssetReportRemoveResponse, Integer, Hash)>] AssetReportRemoveResponse data, response status code and response headers - def asset_report_remove_with_http_info(asset_report_remove_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.asset_report_remove ...' - end - # verify the required parameter 'asset_report_remove_request' is set - if @api_client.config.client_side_validation && asset_report_remove_request.nil? - fail ArgumentError, "Missing the required parameter 'asset_report_remove_request' when calling PlaidApi.asset_report_remove" - end - # resource path - local_var_path = '/asset_report/remove' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(asset_report_remove_request) - - # return_type - return_type = opts[:debug_return_type] || 'AssetReportRemoveResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.asset_report_remove", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#asset_report_remove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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). - # @param auth_get_request [AuthGetRequest] - # @param [Hash] opts the optional parameters - # @return [AuthGetResponse] - def auth_get(auth_get_request, opts = {}) - data, _status_code, _headers = auth_get_with_http_info(auth_get_request, opts) - data - end - - # 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). - # @param auth_get_request [AuthGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(AuthGetResponse, Integer, Hash)>] AuthGetResponse data, response status code and response headers - def auth_get_with_http_info(auth_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.auth_get ...' - end - # verify the required parameter 'auth_get_request' is set - if @api_client.config.client_side_validation && auth_get_request.nil? - fail ArgumentError, "Missing the required parameter 'auth_get_request' when calling PlaidApi.auth_get" - end - # resource path - local_var_path = '/auth/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(auth_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'AuthGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.auth_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#auth_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param bank_transfer_balance_get_request [BankTransferBalanceGetRequest] - # @param [Hash] opts the optional parameters - # @return [BankTransferBalanceGetResponse] - def bank_transfer_balance_get(bank_transfer_balance_get_request, opts = {}) - data, _status_code, _headers = bank_transfer_balance_get_with_http_info(bank_transfer_balance_get_request, opts) - data - end - - # 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. - # @param bank_transfer_balance_get_request [BankTransferBalanceGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BankTransferBalanceGetResponse, Integer, Hash)>] BankTransferBalanceGetResponse data, response status code and response headers - def bank_transfer_balance_get_with_http_info(bank_transfer_balance_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.bank_transfer_balance_get ...' - end - # verify the required parameter 'bank_transfer_balance_get_request' is set - if @api_client.config.client_side_validation && bank_transfer_balance_get_request.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_balance_get_request' when calling PlaidApi.bank_transfer_balance_get" - end - # resource path - local_var_path = '/bank_transfer/balance/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(bank_transfer_balance_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'BankTransferBalanceGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.bank_transfer_balance_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#bank_transfer_balance_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`. - # @param bank_transfer_cancel_request [BankTransferCancelRequest] - # @param [Hash] opts the optional parameters - # @return [BankTransferCancelResponse] - def bank_transfer_cancel(bank_transfer_cancel_request, opts = {}) - data, _status_code, _headers = bank_transfer_cancel_with_http_info(bank_transfer_cancel_request, opts) - data - end - - # 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`. - # @param bank_transfer_cancel_request [BankTransferCancelRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BankTransferCancelResponse, Integer, Hash)>] BankTransferCancelResponse data, response status code and response headers - def bank_transfer_cancel_with_http_info(bank_transfer_cancel_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.bank_transfer_cancel ...' - end - # verify the required parameter 'bank_transfer_cancel_request' is set - if @api_client.config.client_side_validation && bank_transfer_cancel_request.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_cancel_request' when calling PlaidApi.bank_transfer_cancel" - end - # resource path - local_var_path = '/bank_transfer/cancel' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(bank_transfer_cancel_request) - - # return_type - return_type = opts[:debug_return_type] || 'BankTransferCancelResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.bank_transfer_cancel", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#bank_transfer_cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Create a bank transfer - # Use the `/bank_transfer/create` endpoint to initiate a new bank transfer. - # @param bank_transfer_create_request [BankTransferCreateRequest] - # @param [Hash] opts the optional parameters - # @return [BankTransferCreateResponse] - def bank_transfer_create(bank_transfer_create_request, opts = {}) - data, _status_code, _headers = bank_transfer_create_with_http_info(bank_transfer_create_request, opts) - data - end - - # Create a bank transfer - # Use the `/bank_transfer/create` endpoint to initiate a new bank transfer. - # @param bank_transfer_create_request [BankTransferCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BankTransferCreateResponse, Integer, Hash)>] BankTransferCreateResponse data, response status code and response headers - def bank_transfer_create_with_http_info(bank_transfer_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.bank_transfer_create ...' - end - # verify the required parameter 'bank_transfer_create_request' is set - if @api_client.config.client_side_validation && bank_transfer_create_request.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_create_request' when calling PlaidApi.bank_transfer_create" - end - # resource path - local_var_path = '/bank_transfer/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(bank_transfer_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'BankTransferCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.bank_transfer_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#bank_transfer_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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/). - # @param bank_transfer_event_list_request [BankTransferEventListRequest] - # @param [Hash] opts the optional parameters - # @return [BankTransferEventListResponse] - def bank_transfer_event_list(bank_transfer_event_list_request, opts = {}) - data, _status_code, _headers = bank_transfer_event_list_with_http_info(bank_transfer_event_list_request, opts) - data - end - - # 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/). - # @param bank_transfer_event_list_request [BankTransferEventListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BankTransferEventListResponse, Integer, Hash)>] BankTransferEventListResponse data, response status code and response headers - def bank_transfer_event_list_with_http_info(bank_transfer_event_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.bank_transfer_event_list ...' - end - # verify the required parameter 'bank_transfer_event_list_request' is set - if @api_client.config.client_side_validation && bank_transfer_event_list_request.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_event_list_request' when calling PlaidApi.bank_transfer_event_list" - end - # resource path - local_var_path = '/bank_transfer/event/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(bank_transfer_event_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'BankTransferEventListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.bank_transfer_event_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#bank_transfer_event_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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/). - # @param bank_transfer_event_sync_request [BankTransferEventSyncRequest] - # @param [Hash] opts the optional parameters - # @return [BankTransferEventSyncResponse] - def bank_transfer_event_sync(bank_transfer_event_sync_request, opts = {}) - data, _status_code, _headers = bank_transfer_event_sync_with_http_info(bank_transfer_event_sync_request, opts) - data - end - - # 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/). - # @param bank_transfer_event_sync_request [BankTransferEventSyncRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BankTransferEventSyncResponse, Integer, Hash)>] BankTransferEventSyncResponse data, response status code and response headers - def bank_transfer_event_sync_with_http_info(bank_transfer_event_sync_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.bank_transfer_event_sync ...' - end - # verify the required parameter 'bank_transfer_event_sync_request' is set - if @api_client.config.client_side_validation && bank_transfer_event_sync_request.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_event_sync_request' when calling PlaidApi.bank_transfer_event_sync" - end - # resource path - local_var_path = '/bank_transfer/event/sync' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(bank_transfer_event_sync_request) - - # return_type - return_type = opts[:debug_return_type] || 'BankTransferEventSyncResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.bank_transfer_event_sync", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#bank_transfer_event_sync\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve a bank transfer - # The `/bank_transfer/get` fetches information about the bank transfer corresponding to the given `bank_transfer_id`. - # @param bank_transfer_get_request [BankTransferGetRequest] - # @param [Hash] opts the optional parameters - # @return [BankTransferGetResponse] - def bank_transfer_get(bank_transfer_get_request, opts = {}) - data, _status_code, _headers = bank_transfer_get_with_http_info(bank_transfer_get_request, opts) - data - end - - # Retrieve a bank transfer - # The `/bank_transfer/get` fetches information about the bank transfer corresponding to the given `bank_transfer_id`. - # @param bank_transfer_get_request [BankTransferGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BankTransferGetResponse, Integer, Hash)>] BankTransferGetResponse data, response status code and response headers - def bank_transfer_get_with_http_info(bank_transfer_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.bank_transfer_get ...' - end - # verify the required parameter 'bank_transfer_get_request' is set - if @api_client.config.client_side_validation && bank_transfer_get_request.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_get_request' when calling PlaidApi.bank_transfer_get" - end - # resource path - local_var_path = '/bank_transfer/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(bank_transfer_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'BankTransferGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.bank_transfer_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#bank_transfer_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param bank_transfer_list_request [BankTransferListRequest] - # @param [Hash] opts the optional parameters - # @return [BankTransferListResponse] - def bank_transfer_list(bank_transfer_list_request, opts = {}) - data, _status_code, _headers = bank_transfer_list_with_http_info(bank_transfer_list_request, opts) - data - end - - # 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. - # @param bank_transfer_list_request [BankTransferListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BankTransferListResponse, Integer, Hash)>] BankTransferListResponse data, response status code and response headers - def bank_transfer_list_with_http_info(bank_transfer_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.bank_transfer_list ...' - end - # verify the required parameter 'bank_transfer_list_request' is set - if @api_client.config.client_side_validation && bank_transfer_list_request.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_list_request' when calling PlaidApi.bank_transfer_list" - end - # resource path - local_var_path = '/bank_transfer/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(bank_transfer_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'BankTransferListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.bank_transfer_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#bank_transfer_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param bank_transfer_migrate_account_request [BankTransferMigrateAccountRequest] - # @param [Hash] opts the optional parameters - # @return [BankTransferMigrateAccountResponse] - def bank_transfer_migrate_account(bank_transfer_migrate_account_request, opts = {}) - data, _status_code, _headers = bank_transfer_migrate_account_with_http_info(bank_transfer_migrate_account_request, opts) - data - end - - # 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. - # @param bank_transfer_migrate_account_request [BankTransferMigrateAccountRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BankTransferMigrateAccountResponse, Integer, Hash)>] BankTransferMigrateAccountResponse data, response status code and response headers - def bank_transfer_migrate_account_with_http_info(bank_transfer_migrate_account_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.bank_transfer_migrate_account ...' - end - # verify the required parameter 'bank_transfer_migrate_account_request' is set - if @api_client.config.client_side_validation && bank_transfer_migrate_account_request.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_migrate_account_request' when calling PlaidApi.bank_transfer_migrate_account" - end - # resource path - local_var_path = '/bank_transfer/migrate_account' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(bank_transfer_migrate_account_request) - - # return_type - return_type = opts[:debug_return_type] || 'BankTransferMigrateAccountResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.bank_transfer_migrate_account", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#bank_transfer_migrate_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve a sweep - # The `/bank_transfer/sweep/get` endpoint fetches information about the sweep corresponding to the given `sweep_id`. - # @param bank_transfer_sweep_get_request [BankTransferSweepGetRequest] - # @param [Hash] opts the optional parameters - # @return [BankTransferSweepGetResponse] - def bank_transfer_sweep_get(bank_transfer_sweep_get_request, opts = {}) - data, _status_code, _headers = bank_transfer_sweep_get_with_http_info(bank_transfer_sweep_get_request, opts) - data - end - - # Retrieve a sweep - # The `/bank_transfer/sweep/get` endpoint fetches information about the sweep corresponding to the given `sweep_id`. - # @param bank_transfer_sweep_get_request [BankTransferSweepGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BankTransferSweepGetResponse, Integer, Hash)>] BankTransferSweepGetResponse data, response status code and response headers - def bank_transfer_sweep_get_with_http_info(bank_transfer_sweep_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.bank_transfer_sweep_get ...' - end - # verify the required parameter 'bank_transfer_sweep_get_request' is set - if @api_client.config.client_side_validation && bank_transfer_sweep_get_request.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_sweep_get_request' when calling PlaidApi.bank_transfer_sweep_get" - end - # resource path - local_var_path = '/bank_transfer/sweep/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(bank_transfer_sweep_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'BankTransferSweepGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.bank_transfer_sweep_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#bank_transfer_sweep_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List sweeps - # The `/bank_transfer/sweep/list` endpoint fetches information about the sweeps matching the given filters. - # @param bank_transfer_sweep_list_request [BankTransferSweepListRequest] - # @param [Hash] opts the optional parameters - # @return [BankTransferSweepListResponse] - def bank_transfer_sweep_list(bank_transfer_sweep_list_request, opts = {}) - data, _status_code, _headers = bank_transfer_sweep_list_with_http_info(bank_transfer_sweep_list_request, opts) - data - end - - # List sweeps - # The `/bank_transfer/sweep/list` endpoint fetches information about the sweeps matching the given filters. - # @param bank_transfer_sweep_list_request [BankTransferSweepListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BankTransferSweepListResponse, Integer, Hash)>] BankTransferSweepListResponse data, response status code and response headers - def bank_transfer_sweep_list_with_http_info(bank_transfer_sweep_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.bank_transfer_sweep_list ...' - end - # verify the required parameter 'bank_transfer_sweep_list_request' is set - if @api_client.config.client_side_validation && bank_transfer_sweep_list_request.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_sweep_list_request' when calling PlaidApi.bank_transfer_sweep_list" - end - # resource path - local_var_path = '/bank_transfer/sweep/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(bank_transfer_sweep_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'BankTransferSweepListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.bank_transfer_sweep_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#bank_transfer_sweep_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`. - # @param base_report_get_request [BaseReportGetRequest] - # @param [Hash] opts the optional parameters - # @return [BaseReportGetResponse] - def base_report_get(base_report_get_request, opts = {}) - data, _status_code, _headers = base_report_get_with_http_info(base_report_get_request, opts) - data - end - - # 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`. - # @param base_report_get_request [BaseReportGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BaseReportGetResponse, Integer, Hash)>] BaseReportGetResponse data, response status code and response headers - def base_report_get_with_http_info(base_report_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.base_report_get ...' - end - # verify the required parameter 'base_report_get_request' is set - if @api_client.config.client_side_validation && base_report_get_request.nil? - fail ArgumentError, "Missing the required parameter 'base_report_get_request' when calling PlaidApi.base_report_get" - end - # resource path - local_var_path = '/cra/base_report/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(base_report_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'BaseReportGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.base_report_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#base_report_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`. - # @param beacon_duplicate_get_request [BeaconDuplicateGetRequest] - # @param [Hash] opts the optional parameters - # @return [BeaconDuplicateGetResponse] - def beacon_duplicate_get(beacon_duplicate_get_request, opts = {}) - data, _status_code, _headers = beacon_duplicate_get_with_http_info(beacon_duplicate_get_request, opts) - data - end - - # 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`. - # @param beacon_duplicate_get_request [BeaconDuplicateGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BeaconDuplicateGetResponse, Integer, Hash)>] BeaconDuplicateGetResponse data, response status code and response headers - def beacon_duplicate_get_with_http_info(beacon_duplicate_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.beacon_duplicate_get ...' - end - # verify the required parameter 'beacon_duplicate_get_request' is set - if @api_client.config.client_side_validation && beacon_duplicate_get_request.nil? - fail ArgumentError, "Missing the required parameter 'beacon_duplicate_get_request' when calling PlaidApi.beacon_duplicate_get" - end - # resource path - local_var_path = '/beacon/duplicate/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beacon_duplicate_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'BeaconDuplicateGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.beacon_duplicate_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#beacon_duplicate_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Create a Beacon Report - # Create a fraud report for a given Beacon User. - # @param beacon_report_create_request [BeaconReportCreateRequest] - # @param [Hash] opts the optional parameters - # @return [BeaconReportCreateResponse] - def beacon_report_create(beacon_report_create_request, opts = {}) - data, _status_code, _headers = beacon_report_create_with_http_info(beacon_report_create_request, opts) - data - end - - # Create a Beacon Report - # Create a fraud report for a given Beacon User. - # @param beacon_report_create_request [BeaconReportCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BeaconReportCreateResponse, Integer, Hash)>] BeaconReportCreateResponse data, response status code and response headers - def beacon_report_create_with_http_info(beacon_report_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.beacon_report_create ...' - end - # verify the required parameter 'beacon_report_create_request' is set - if @api_client.config.client_side_validation && beacon_report_create_request.nil? - fail ArgumentError, "Missing the required parameter 'beacon_report_create_request' when calling PlaidApi.beacon_report_create" - end - # resource path - local_var_path = '/beacon/report/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beacon_report_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'BeaconReportCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.beacon_report_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#beacon_report_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get a Beacon Report - # Returns a Beacon report for a given Beacon report id. - # @param beacon_report_get_request [BeaconReportGetRequest] - # @param [Hash] opts the optional parameters - # @return [BeaconReportGetResponse] - def beacon_report_get(beacon_report_get_request, opts = {}) - data, _status_code, _headers = beacon_report_get_with_http_info(beacon_report_get_request, opts) - data - end - - # Get a Beacon Report - # Returns a Beacon report for a given Beacon report id. - # @param beacon_report_get_request [BeaconReportGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BeaconReportGetResponse, Integer, Hash)>] BeaconReportGetResponse data, response status code and response headers - def beacon_report_get_with_http_info(beacon_report_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.beacon_report_get ...' - end - # verify the required parameter 'beacon_report_get_request' is set - if @api_client.config.client_side_validation && beacon_report_get_request.nil? - fail ArgumentError, "Missing the required parameter 'beacon_report_get_request' when calling PlaidApi.beacon_report_get" - end - # resource path - local_var_path = '/beacon/report/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beacon_report_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'BeaconReportGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.beacon_report_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#beacon_report_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param beacon_report_list_request [BeaconReportListRequest] - # @param [Hash] opts the optional parameters - # @return [BeaconReportListResponse] - def beacon_report_list(beacon_report_list_request, opts = {}) - data, _status_code, _headers = beacon_report_list_with_http_info(beacon_report_list_request, opts) - data - end - - # 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. - # @param beacon_report_list_request [BeaconReportListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BeaconReportListResponse, Integer, Hash)>] BeaconReportListResponse data, response status code and response headers - def beacon_report_list_with_http_info(beacon_report_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.beacon_report_list ...' - end - # verify the required parameter 'beacon_report_list_request' is set - if @api_client.config.client_side_validation && beacon_report_list_request.nil? - fail ArgumentError, "Missing the required parameter 'beacon_report_list_request' when calling PlaidApi.beacon_report_list" - end - # resource path - local_var_path = '/beacon/report/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beacon_report_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'BeaconReportListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.beacon_report_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#beacon_report_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get a Beacon Report Syndication - # Returns a Beacon Report Syndication for a given Beacon Report Syndication id. - # @param beacon_report_syndication_get_request [BeaconReportSyndicationGetRequest] - # @param [Hash] opts the optional parameters - # @return [BeaconReportSyndicationGetResponse] - def beacon_report_syndication_get(beacon_report_syndication_get_request, opts = {}) - data, _status_code, _headers = beacon_report_syndication_get_with_http_info(beacon_report_syndication_get_request, opts) - data - end - - # Get a Beacon Report Syndication - # Returns a Beacon Report Syndication for a given Beacon Report Syndication id. - # @param beacon_report_syndication_get_request [BeaconReportSyndicationGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BeaconReportSyndicationGetResponse, Integer, Hash)>] BeaconReportSyndicationGetResponse data, response status code and response headers - def beacon_report_syndication_get_with_http_info(beacon_report_syndication_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.beacon_report_syndication_get ...' - end - # verify the required parameter 'beacon_report_syndication_get_request' is set - if @api_client.config.client_side_validation && beacon_report_syndication_get_request.nil? - fail ArgumentError, "Missing the required parameter 'beacon_report_syndication_get_request' when calling PlaidApi.beacon_report_syndication_get" - end - # resource path - local_var_path = '/beacon/report_syndication/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beacon_report_syndication_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'BeaconReportSyndicationGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.beacon_report_syndication_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#beacon_report_syndication_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param beacon_report_syndication_list_request [BeaconReportSyndicationListRequest] - # @param [Hash] opts the optional parameters - # @return [BeaconReportSyndicationListResponse] - def beacon_report_syndication_list(beacon_report_syndication_list_request, opts = {}) - data, _status_code, _headers = beacon_report_syndication_list_with_http_info(beacon_report_syndication_list_request, opts) - data - end - - # 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. - # @param beacon_report_syndication_list_request [BeaconReportSyndicationListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BeaconReportSyndicationListResponse, Integer, Hash)>] BeaconReportSyndicationListResponse data, response status code and response headers - def beacon_report_syndication_list_with_http_info(beacon_report_syndication_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.beacon_report_syndication_list ...' - end - # verify the required parameter 'beacon_report_syndication_list_request' is set - if @api_client.config.client_side_validation && beacon_report_syndication_list_request.nil? - fail ArgumentError, "Missing the required parameter 'beacon_report_syndication_list_request' when calling PlaidApi.beacon_report_syndication_list" - end - # resource path - local_var_path = '/beacon/report_syndication/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beacon_report_syndication_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'BeaconReportSyndicationListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.beacon_report_syndication_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#beacon_report_syndication_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param beacon_user_create_request [BeaconUserCreateRequest] - # @param [Hash] opts the optional parameters - # @return [BeaconUserCreateResponse] - def beacon_user_create(beacon_user_create_request, opts = {}) - data, _status_code, _headers = beacon_user_create_with_http_info(beacon_user_create_request, opts) - data - end - - # 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. - # @param beacon_user_create_request [BeaconUserCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BeaconUserCreateResponse, Integer, Hash)>] BeaconUserCreateResponse data, response status code and response headers - def beacon_user_create_with_http_info(beacon_user_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.beacon_user_create ...' - end - # verify the required parameter 'beacon_user_create_request' is set - if @api_client.config.client_side_validation && beacon_user_create_request.nil? - fail ArgumentError, "Missing the required parameter 'beacon_user_create_request' when calling PlaidApi.beacon_user_create" - end - # resource path - local_var_path = '/beacon/user/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beacon_user_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'BeaconUserCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.beacon_user_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#beacon_user_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param beacon_user_get_request [BeaconUserGetRequest] - # @param [Hash] opts the optional parameters - # @return [BeaconUserGetResponse] - def beacon_user_get(beacon_user_get_request, opts = {}) - data, _status_code, _headers = beacon_user_get_with_http_info(beacon_user_get_request, opts) - data - end - - # 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. - # @param beacon_user_get_request [BeaconUserGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BeaconUserGetResponse, Integer, Hash)>] BeaconUserGetResponse data, response status code and response headers - def beacon_user_get_with_http_info(beacon_user_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.beacon_user_get ...' - end - # verify the required parameter 'beacon_user_get_request' is set - if @api_client.config.client_side_validation && beacon_user_get_request.nil? - fail ArgumentError, "Missing the required parameter 'beacon_user_get_request' when calling PlaidApi.beacon_user_get" - end - # resource path - local_var_path = '/beacon/user/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beacon_user_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'BeaconUserGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.beacon_user_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#beacon_user_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param beacon_user_review_request [BeaconUserReviewRequest] - # @param [Hash] opts the optional parameters - # @return [BeaconUserGetResponse] - def beacon_user_review(beacon_user_review_request, opts = {}) - data, _status_code, _headers = beacon_user_review_with_http_info(beacon_user_review_request, opts) - data - end - - # 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. - # @param beacon_user_review_request [BeaconUserReviewRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BeaconUserGetResponse, Integer, Hash)>] BeaconUserGetResponse data, response status code and response headers - def beacon_user_review_with_http_info(beacon_user_review_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.beacon_user_review ...' - end - # verify the required parameter 'beacon_user_review_request' is set - if @api_client.config.client_side_validation && beacon_user_review_request.nil? - fail ArgumentError, "Missing the required parameter 'beacon_user_review_request' when calling PlaidApi.beacon_user_review" - end - # resource path - local_var_path = '/beacon/user/review' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beacon_user_review_request) - - # return_type - return_type = opts[:debug_return_type] || 'BeaconUserGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.beacon_user_review", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#beacon_user_review\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param beacon_user_update_request [BeaconUserUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [BeaconUserUpdateResponse] - def beacon_user_update(beacon_user_update_request, opts = {}) - data, _status_code, _headers = beacon_user_update_with_http_info(beacon_user_update_request, opts) - data - end - - # 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. - # @param beacon_user_update_request [BeaconUserUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(BeaconUserUpdateResponse, Integer, Hash)>] BeaconUserUpdateResponse data, response status code and response headers - def beacon_user_update_with_http_info(beacon_user_update_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.beacon_user_update ...' - end - # verify the required parameter 'beacon_user_update_request' is set - if @api_client.config.client_side_validation && beacon_user_update_request.nil? - fail ArgumentError, "Missing the required parameter 'beacon_user_update_request' when calling PlaidApi.beacon_user_update" - end - # resource path - local_var_path = '/beacon/user/update' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(beacon_user_update_request) - - # return_type - return_type = opts[:debug_return_type] || 'BeaconUserUpdateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.beacon_user_update", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#beacon_user_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [CategoriesGetResponse] - def categories_get(body, opts = {}) - data, _status_code, _headers = categories_get_with_http_info(body, opts) - data - end - - # 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. - # @param body [Object] - # @param [Hash] opts the optional parameters - # @return [Array<(CategoriesGetResponse, Integer, Hash)>] CategoriesGetResponse data, response status code and response headers - def categories_get_with_http_info(body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.categories_get ...' - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling PlaidApi.categories_get" - end - # resource path - local_var_path = '/categories/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:debug_return_type] || 'CategoriesGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || [] - - new_options = opts.merge( - :operation => :"PlaidApi.categories_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#categories_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve information from the bank accounts used for income verification - # `/cra/bank_income/get` returns the bank income report(s) for a specified user. - # @param cra_bank_income_get_request [CraBankIncomeGetRequest] - # @param [Hash] opts the optional parameters - # @return [CraBankIncomeGetResponse] - def cra_bank_income_get(cra_bank_income_get_request, opts = {}) - data, _status_code, _headers = cra_bank_income_get_with_http_info(cra_bank_income_get_request, opts) - data - end - - # Retrieve information from the bank accounts used for income verification - # `/cra/bank_income/get` returns the bank income report(s) for a specified user. - # @param cra_bank_income_get_request [CraBankIncomeGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CraBankIncomeGetResponse, Integer, Hash)>] CraBankIncomeGetResponse data, response status code and response headers - def cra_bank_income_get_with_http_info(cra_bank_income_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.cra_bank_income_get ...' - end - # verify the required parameter 'cra_bank_income_get_request' is set - if @api_client.config.client_side_validation && cra_bank_income_get_request.nil? - fail ArgumentError, "Missing the required parameter 'cra_bank_income_get_request' when calling PlaidApi.cra_bank_income_get" - end - # resource path - local_var_path = '/cra/bank_income/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(cra_bank_income_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'CraBankIncomeGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.cra_bank_income_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#cra_bank_income_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve cash flow insights from the bank accounts used for income verification - # `/cra/partner_insights/get` returns cash flow insights for a specified user. - # @param cra_partner_insights_get_request [CraPartnerInsightsGetRequest] - # @param [Hash] opts the optional parameters - # @return [CraPartnerInsightsGetResponse] - def cra_partner_insights_get(cra_partner_insights_get_request, opts = {}) - data, _status_code, _headers = cra_partner_insights_get_with_http_info(cra_partner_insights_get_request, opts) - data - end - - # Retrieve cash flow insights from the bank accounts used for income verification - # `/cra/partner_insights/get` returns cash flow insights for a specified user. - # @param cra_partner_insights_get_request [CraPartnerInsightsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CraPartnerInsightsGetResponse, Integer, Hash)>] CraPartnerInsightsGetResponse data, response status code and response headers - def cra_partner_insights_get_with_http_info(cra_partner_insights_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.cra_partner_insights_get ...' - end - # verify the required parameter 'cra_partner_insights_get_request' is set - if @api_client.config.client_side_validation && cra_partner_insights_get_request.nil? - fail ArgumentError, "Missing the required parameter 'cra_partner_insights_get_request' when calling PlaidApi.cra_partner_insights_get" - end - # resource path - local_var_path = '/cra/partner_insights/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(cra_partner_insights_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'CraPartnerInsightsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.cra_partner_insights_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#cra_partner_insights_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param payment_initiation_payment_token_create_request [PaymentInitiationPaymentTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [PaymentInitiationPaymentTokenCreateResponse] - def create_payment_token(payment_initiation_payment_token_create_request, opts = {}) - data, _status_code, _headers = create_payment_token_with_http_info(payment_initiation_payment_token_create_request, opts) - data - end - - # 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. - # @param payment_initiation_payment_token_create_request [PaymentInitiationPaymentTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentInitiationPaymentTokenCreateResponse, Integer, Hash)>] PaymentInitiationPaymentTokenCreateResponse data, response status code and response headers - def create_payment_token_with_http_info(payment_initiation_payment_token_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.create_payment_token ...' - end - # verify the required parameter 'payment_initiation_payment_token_create_request' is set - if @api_client.config.client_side_validation && payment_initiation_payment_token_create_request.nil? - fail ArgumentError, "Missing the required parameter 'payment_initiation_payment_token_create_request' when calling PlaidApi.create_payment_token" - end - # resource path - local_var_path = '/payment_initiation/payment/token/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_initiation_payment_token_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'PaymentInitiationPaymentTokenCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.create_payment_token", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#create_payment_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param request_body [Hash] - # @param [Hash] opts the optional parameters - # @return [AssetReportFreddieGetResponse] - def credit_asset_report_freddie_mac_get(request_body, opts = {}) - data, _status_code, _headers = credit_asset_report_freddie_mac_get_with_http_info(request_body, opts) - data - end - - # 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. - # @param request_body [Hash] - # @param [Hash] opts the optional parameters - # @return [Array<(AssetReportFreddieGetResponse, Integer, Hash)>] AssetReportFreddieGetResponse data, response status code and response headers - def credit_asset_report_freddie_mac_get_with_http_info(request_body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_asset_report_freddie_mac_get ...' - end - # verify the required parameter 'request_body' is set - if @api_client.config.client_side_validation && request_body.nil? - fail ArgumentError, "Missing the required parameter 'request_body' when calling PlaidApi.credit_asset_report_freddie_mac_get" - end - # resource path - local_var_path = '/credit/asset_report/freddie_mac/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body) - - # return_type - return_type = opts[:debug_return_type] || 'AssetReportFreddieGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_asset_report_freddie_mac_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_asset_report_freddie_mac_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param credit_audit_copy_token_create_request [CreditAuditCopyTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [CreditAuditCopyTokenCreateResponse] - def credit_audit_copy_token_create(credit_audit_copy_token_create_request, opts = {}) - data, _status_code, _headers = credit_audit_copy_token_create_with_http_info(credit_audit_copy_token_create_request, opts) - data - end - - # 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. - # @param credit_audit_copy_token_create_request [CreditAuditCopyTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditAuditCopyTokenCreateResponse, Integer, Hash)>] CreditAuditCopyTokenCreateResponse data, response status code and response headers - def credit_audit_copy_token_create_with_http_info(credit_audit_copy_token_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_audit_copy_token_create ...' - end - # verify the required parameter 'credit_audit_copy_token_create_request' is set - if @api_client.config.client_side_validation && credit_audit_copy_token_create_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_audit_copy_token_create_request' when calling PlaidApi.credit_audit_copy_token_create" - end - # resource path - local_var_path = '/credit/audit_copy_token/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_audit_copy_token_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditAuditCopyTokenCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_audit_copy_token_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_audit_copy_token_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param credit_audit_copy_token_update_request [CreditAuditCopyTokenUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [CreditAuditCopyTokenUpdateResponse] - def credit_audit_copy_token_update(credit_audit_copy_token_update_request, opts = {}) - data, _status_code, _headers = credit_audit_copy_token_update_with_http_info(credit_audit_copy_token_update_request, opts) - data - end - - # 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. - # @param credit_audit_copy_token_update_request [CreditAuditCopyTokenUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditAuditCopyTokenUpdateResponse, Integer, Hash)>] CreditAuditCopyTokenUpdateResponse data, response status code and response headers - def credit_audit_copy_token_update_with_http_info(credit_audit_copy_token_update_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_audit_copy_token_update ...' - end - # verify the required parameter 'credit_audit_copy_token_update_request' is set - if @api_client.config.client_side_validation && credit_audit_copy_token_update_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_audit_copy_token_update_request' when calling PlaidApi.credit_audit_copy_token_update" - end - # resource path - local_var_path = '/credit/audit_copy_token/update' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_audit_copy_token_update_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditAuditCopyTokenUpdateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_audit_copy_token_update", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_audit_copy_token_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param credit_bank_employment_get_request [CreditBankEmploymentGetRequest] - # @param [Hash] opts the optional parameters - # @return [CreditBankEmploymentGetResponse] - def credit_bank_employment_get(credit_bank_employment_get_request, opts = {}) - data, _status_code, _headers = credit_bank_employment_get_with_http_info(credit_bank_employment_get_request, opts) - data - end - - # 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. - # @param credit_bank_employment_get_request [CreditBankEmploymentGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditBankEmploymentGetResponse, Integer, Hash)>] CreditBankEmploymentGetResponse data, response status code and response headers - def credit_bank_employment_get_with_http_info(credit_bank_employment_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_bank_employment_get ...' - end - # verify the required parameter 'credit_bank_employment_get_request' is set - if @api_client.config.client_side_validation && credit_bank_employment_get_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_bank_employment_get_request' when calling PlaidApi.credit_bank_employment_get" - end - # resource path - local_var_path = '/beta/credit/v1/bank_employment/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_bank_employment_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditBankEmploymentGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_bank_employment_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_bank_employment_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve information from the bank accounts used for income verification - # `/credit/bank_income/get` returns the bank income report(s) for a specified user. - # @param credit_bank_income_get_request [CreditBankIncomeGetRequest] - # @param [Hash] opts the optional parameters - # @return [CreditBankIncomeGetResponse] - def credit_bank_income_get(credit_bank_income_get_request, opts = {}) - data, _status_code, _headers = credit_bank_income_get_with_http_info(credit_bank_income_get_request, opts) - data - end - - # Retrieve information from the bank accounts used for income verification - # `/credit/bank_income/get` returns the bank income report(s) for a specified user. - # @param credit_bank_income_get_request [CreditBankIncomeGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditBankIncomeGetResponse, Integer, Hash)>] CreditBankIncomeGetResponse data, response status code and response headers - def credit_bank_income_get_with_http_info(credit_bank_income_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_bank_income_get ...' - end - # verify the required parameter 'credit_bank_income_get_request' is set - if @api_client.config.client_side_validation && credit_bank_income_get_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_bank_income_get_request' when calling PlaidApi.credit_bank_income_get" - end - # resource path - local_var_path = '/credit/bank_income/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_bank_income_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditBankIncomeGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_bank_income_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_bank_income_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param credit_bank_income_pdf_get_request [CreditBankIncomePDFGetRequest] - # @param [Hash] opts the optional parameters - # @return [File] - def credit_bank_income_pdf_get(credit_bank_income_pdf_get_request, opts = {}) - data, _status_code, _headers = credit_bank_income_pdf_get_with_http_info(credit_bank_income_pdf_get_request, opts) - data - end - - # 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. - # @param credit_bank_income_pdf_get_request [CreditBankIncomePDFGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def credit_bank_income_pdf_get_with_http_info(credit_bank_income_pdf_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_bank_income_pdf_get ...' - end - # verify the required parameter 'credit_bank_income_pdf_get_request' is set - if @api_client.config.client_side_validation && credit_bank_income_pdf_get_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_bank_income_pdf_get_request' when calling PlaidApi.credit_bank_income_pdf_get" - end - # resource path - local_var_path = '/credit/bank_income/pdf/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/pdf']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_bank_income_pdf_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'File' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_bank_income_pdf_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_bank_income_pdf_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Refresh a user's bank income information - # `/credit/bank_income/refresh` refreshes the bank income report data for a specific user. - # @param credit_bank_income_refresh_request [CreditBankIncomeRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [CreditBankIncomeRefreshResponse] - def credit_bank_income_refresh(credit_bank_income_refresh_request, opts = {}) - data, _status_code, _headers = credit_bank_income_refresh_with_http_info(credit_bank_income_refresh_request, opts) - data - end - - # Refresh a user's bank income information - # `/credit/bank_income/refresh` refreshes the bank income report data for a specific user. - # @param credit_bank_income_refresh_request [CreditBankIncomeRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditBankIncomeRefreshResponse, Integer, Hash)>] CreditBankIncomeRefreshResponse data, response status code and response headers - def credit_bank_income_refresh_with_http_info(credit_bank_income_refresh_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_bank_income_refresh ...' - end - # verify the required parameter 'credit_bank_income_refresh_request' is set - if @api_client.config.client_side_validation && credit_bank_income_refresh_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_bank_income_refresh_request' when calling PlaidApi.credit_bank_income_refresh" - end - # resource path - local_var_path = '/credit/bank_income/refresh' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_bank_income_refresh_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditBankIncomeRefreshResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_bank_income_refresh", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_bank_income_refresh\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param credit_bank_income_webhook_update_request [CreditBankIncomeWebhookUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [CreditBankIncomeWebhookUpdateResponse] - def credit_bank_income_webhook_update(credit_bank_income_webhook_update_request, opts = {}) - data, _status_code, _headers = credit_bank_income_webhook_update_with_http_info(credit_bank_income_webhook_update_request, opts) - data - end - - # 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. - # @param credit_bank_income_webhook_update_request [CreditBankIncomeWebhookUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditBankIncomeWebhookUpdateResponse, Integer, Hash)>] CreditBankIncomeWebhookUpdateResponse data, response status code and response headers - def credit_bank_income_webhook_update_with_http_info(credit_bank_income_webhook_update_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_bank_income_webhook_update ...' - end - # verify the required parameter 'credit_bank_income_webhook_update_request' is set - if @api_client.config.client_side_validation && credit_bank_income_webhook_update_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_bank_income_webhook_update_request' when calling PlaidApi.credit_bank_income_webhook_update" - end - # resource path - local_var_path = '/credit/bank_income/webhook/update' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_bank_income_webhook_update_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditBankIncomeWebhookUpdateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_bank_income_webhook_update", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_bank_income_webhook_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param credit_bank_statements_uploads_get_request [CreditBankStatementsUploadsGetRequest] - # @param [Hash] opts the optional parameters - # @return [CreditBankStatementsUploadsGetResponse] - def credit_bank_statements_uploads_get(credit_bank_statements_uploads_get_request, opts = {}) - data, _status_code, _headers = credit_bank_statements_uploads_get_with_http_info(credit_bank_statements_uploads_get_request, opts) - data - end - - # 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. - # @param credit_bank_statements_uploads_get_request [CreditBankStatementsUploadsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditBankStatementsUploadsGetResponse, Integer, Hash)>] CreditBankStatementsUploadsGetResponse data, response status code and response headers - def credit_bank_statements_uploads_get_with_http_info(credit_bank_statements_uploads_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_bank_statements_uploads_get ...' - end - # verify the required parameter 'credit_bank_statements_uploads_get_request' is set - if @api_client.config.client_side_validation && credit_bank_statements_uploads_get_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_bank_statements_uploads_get_request' when calling PlaidApi.credit_bank_statements_uploads_get" - end - # resource path - local_var_path = '/credit/bank_statements/uploads/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_bank_statements_uploads_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditBankStatementsUploadsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_bank_statements_uploads_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_bank_statements_uploads_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param credit_employment_get_request [CreditEmploymentGetRequest] - # @param [Hash] opts the optional parameters - # @return [CreditEmploymentGetResponse] - def credit_employment_get(credit_employment_get_request, opts = {}) - data, _status_code, _headers = credit_employment_get_with_http_info(credit_employment_get_request, opts) - data - end - - # 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. - # @param credit_employment_get_request [CreditEmploymentGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditEmploymentGetResponse, Integer, Hash)>] CreditEmploymentGetResponse data, response status code and response headers - def credit_employment_get_with_http_info(credit_employment_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_employment_get ...' - end - # verify the required parameter 'credit_employment_get_request' is set - if @api_client.config.client_side_validation && credit_employment_get_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_employment_get_request' when calling PlaidApi.credit_employment_get" - end - # resource path - local_var_path = '/credit/employment/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_employment_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditEmploymentGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_employment_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_employment_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param credit_freddie_mac_reports_get_request [CreditFreddieMacReportsGetRequest] - # @param [Hash] opts the optional parameters - # @return [CreditFreddieMacReportsGetResponse] - def credit_freddie_mac_reports_get(credit_freddie_mac_reports_get_request, opts = {}) - data, _status_code, _headers = credit_freddie_mac_reports_get_with_http_info(credit_freddie_mac_reports_get_request, opts) - data - end - - # 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. - # @param credit_freddie_mac_reports_get_request [CreditFreddieMacReportsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditFreddieMacReportsGetResponse, Integer, Hash)>] CreditFreddieMacReportsGetResponse data, response status code and response headers - def credit_freddie_mac_reports_get_with_http_info(credit_freddie_mac_reports_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_freddie_mac_reports_get ...' - end - # verify the required parameter 'credit_freddie_mac_reports_get_request' is set - if @api_client.config.client_side_validation && credit_freddie_mac_reports_get_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_freddie_mac_reports_get_request' when calling PlaidApi.credit_freddie_mac_reports_get" - end - # resource path - local_var_path = '/credit/freddie_mac/reports/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_freddie_mac_reports_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditFreddieMacReportsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_freddie_mac_reports_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_freddie_mac_reports_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param credit_payroll_income_get_request [CreditPayrollIncomeGetRequest] - # @param [Hash] opts the optional parameters - # @return [CreditPayrollIncomeGetResponse] - def credit_payroll_income_get(credit_payroll_income_get_request, opts = {}) - data, _status_code, _headers = credit_payroll_income_get_with_http_info(credit_payroll_income_get_request, opts) - data - end - - # 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. - # @param credit_payroll_income_get_request [CreditPayrollIncomeGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditPayrollIncomeGetResponse, Integer, Hash)>] CreditPayrollIncomeGetResponse data, response status code and response headers - def credit_payroll_income_get_with_http_info(credit_payroll_income_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_payroll_income_get ...' - end - # verify the required parameter 'credit_payroll_income_get_request' is set - if @api_client.config.client_side_validation && credit_payroll_income_get_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_payroll_income_get_request' when calling PlaidApi.credit_payroll_income_get" - end - # resource path - local_var_path = '/credit/payroll_income/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_payroll_income_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditPayrollIncomeGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_payroll_income_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_payroll_income_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Update the parsing configuration for a document income verification - # `/credit/payroll_income/parsing_config/update` updates the parsing configuration for a document income verification. - # @param request_body [Hash] - # @param [Hash] opts the optional parameters - # @return [CreditPayrollIncomeParsingConfigUpdateResponse] - def credit_payroll_income_parsing_config_update(request_body, opts = {}) - data, _status_code, _headers = credit_payroll_income_parsing_config_update_with_http_info(request_body, opts) - data - end - - # Update the parsing configuration for a document income verification - # `/credit/payroll_income/parsing_config/update` updates the parsing configuration for a document income verification. - # @param request_body [Hash] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditPayrollIncomeParsingConfigUpdateResponse, Integer, Hash)>] CreditPayrollIncomeParsingConfigUpdateResponse data, response status code and response headers - def credit_payroll_income_parsing_config_update_with_http_info(request_body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_payroll_income_parsing_config_update ...' - end - # verify the required parameter 'request_body' is set - if @api_client.config.client_side_validation && request_body.nil? - fail ArgumentError, "Missing the required parameter 'request_body' when calling PlaidApi.credit_payroll_income_parsing_config_update" - end - # resource path - local_var_path = '/credit/payroll_income/parsing_config/update' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body) - - # return_type - return_type = opts[:debug_return_type] || 'CreditPayrollIncomeParsingConfigUpdateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_payroll_income_parsing_config_update", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_payroll_income_parsing_config_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param credit_payroll_income_precheck_request [CreditPayrollIncomePrecheckRequest] - # @param [Hash] opts the optional parameters - # @return [CreditPayrollIncomePrecheckResponse] - def credit_payroll_income_precheck(credit_payroll_income_precheck_request, opts = {}) - data, _status_code, _headers = credit_payroll_income_precheck_with_http_info(credit_payroll_income_precheck_request, opts) - data - end - - # 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. - # @param credit_payroll_income_precheck_request [CreditPayrollIncomePrecheckRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditPayrollIncomePrecheckResponse, Integer, Hash)>] CreditPayrollIncomePrecheckResponse data, response status code and response headers - def credit_payroll_income_precheck_with_http_info(credit_payroll_income_precheck_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_payroll_income_precheck ...' - end - # verify the required parameter 'credit_payroll_income_precheck_request' is set - if @api_client.config.client_side_validation && credit_payroll_income_precheck_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_payroll_income_precheck_request' when calling PlaidApi.credit_payroll_income_precheck" - end - # resource path - local_var_path = '/credit/payroll_income/precheck' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_payroll_income_precheck_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditPayrollIncomePrecheckResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_payroll_income_precheck", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_payroll_income_precheck\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Refresh a digital payroll income verification - # `/credit/payroll_income/refresh` refreshes a given digital payroll income verification. - # @param credit_payroll_income_refresh_request [CreditPayrollIncomeRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [CreditPayrollIncomeRefreshResponse] - def credit_payroll_income_refresh(credit_payroll_income_refresh_request, opts = {}) - data, _status_code, _headers = credit_payroll_income_refresh_with_http_info(credit_payroll_income_refresh_request, opts) - data - end - - # Refresh a digital payroll income verification - # `/credit/payroll_income/refresh` refreshes a given digital payroll income verification. - # @param credit_payroll_income_refresh_request [CreditPayrollIncomeRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditPayrollIncomeRefreshResponse, Integer, Hash)>] CreditPayrollIncomeRefreshResponse data, response status code and response headers - def credit_payroll_income_refresh_with_http_info(credit_payroll_income_refresh_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_payroll_income_refresh ...' - end - # verify the required parameter 'credit_payroll_income_refresh_request' is set - if @api_client.config.client_side_validation && credit_payroll_income_refresh_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_payroll_income_refresh_request' when calling PlaidApi.credit_payroll_income_refresh" - end - # resource path - local_var_path = '/credit/payroll_income/refresh' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_payroll_income_refresh_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditPayrollIncomeRefreshResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_payroll_income_refresh", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_payroll_income_refresh\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param credit_payroll_income_risk_signals_get_request [CreditPayrollIncomeRiskSignalsGetRequest] - # @param [Hash] opts the optional parameters - # @return [CreditPayrollIncomeRiskSignalsGetResponse] - def credit_payroll_income_risk_signals_get(credit_payroll_income_risk_signals_get_request, opts = {}) - data, _status_code, _headers = credit_payroll_income_risk_signals_get_with_http_info(credit_payroll_income_risk_signals_get_request, opts) - data - end - - # 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. - # @param credit_payroll_income_risk_signals_get_request [CreditPayrollIncomeRiskSignalsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditPayrollIncomeRiskSignalsGetResponse, Integer, Hash)>] CreditPayrollIncomeRiskSignalsGetResponse data, response status code and response headers - def credit_payroll_income_risk_signals_get_with_http_info(credit_payroll_income_risk_signals_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_payroll_income_risk_signals_get ...' - end - # verify the required parameter 'credit_payroll_income_risk_signals_get_request' is set - if @api_client.config.client_side_validation && credit_payroll_income_risk_signals_get_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_payroll_income_risk_signals_get_request' when calling PlaidApi.credit_payroll_income_risk_signals_get" - end - # resource path - local_var_path = '/credit/payroll_income/risk_signals/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_payroll_income_risk_signals_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditPayrollIncomeRiskSignalsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_payroll_income_risk_signals_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_payroll_income_risk_signals_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param credit_relay_create_request [CreditRelayCreateRequest] - # @param [Hash] opts the optional parameters - # @return [CreditRelayCreateResponse] - def credit_relay_create(credit_relay_create_request, opts = {}) - data, _status_code, _headers = credit_relay_create_with_http_info(credit_relay_create_request, opts) - data - end - - # 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. - # @param credit_relay_create_request [CreditRelayCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditRelayCreateResponse, Integer, Hash)>] CreditRelayCreateResponse data, response status code and response headers - def credit_relay_create_with_http_info(credit_relay_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_relay_create ...' - end - # verify the required parameter 'credit_relay_create_request' is set - if @api_client.config.client_side_validation && credit_relay_create_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_relay_create_request' when calling PlaidApi.credit_relay_create" - end - # resource path - local_var_path = '/credit/relay/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_relay_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditRelayCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_relay_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_relay_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param credit_relay_get_request [CreditRelayGetRequest] - # @param [Hash] opts the optional parameters - # @return [AssetReportGetResponse] - def credit_relay_get(credit_relay_get_request, opts = {}) - data, _status_code, _headers = credit_relay_get_with_http_info(credit_relay_get_request, opts) - data - end - - # 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. - # @param credit_relay_get_request [CreditRelayGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(AssetReportGetResponse, Integer, Hash)>] AssetReportGetResponse data, response status code and response headers - def credit_relay_get_with_http_info(credit_relay_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_relay_get ...' - end - # verify the required parameter 'credit_relay_get_request' is set - if @api_client.config.client_side_validation && credit_relay_get_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_relay_get_request' when calling PlaidApi.credit_relay_get" - end - # resource path - local_var_path = '/credit/relay/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_relay_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'AssetReportGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_relay_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_relay_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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). - # @param credit_relay_pdf_get_request [CreditRelayPDFGetRequest] - # @param [Hash] opts the optional parameters - # @return [File] - def credit_relay_pdf_get(credit_relay_pdf_get_request, opts = {}) - data, _status_code, _headers = credit_relay_pdf_get_with_http_info(credit_relay_pdf_get_request, opts) - data - end - - # 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). - # @param credit_relay_pdf_get_request [CreditRelayPDFGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def credit_relay_pdf_get_with_http_info(credit_relay_pdf_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_relay_pdf_get ...' - end - # verify the required parameter 'credit_relay_pdf_get_request' is set - if @api_client.config.client_side_validation && credit_relay_pdf_get_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_relay_pdf_get_request' when calling PlaidApi.credit_relay_pdf_get" - end - # resource path - local_var_path = '/credit/relay/pdf/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/pdf']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_relay_pdf_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'File' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_relay_pdf_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_relay_pdf_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param credit_relay_refresh_request [CreditRelayRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [CreditRelayRefreshResponse] - def credit_relay_refresh(credit_relay_refresh_request, opts = {}) - data, _status_code, _headers = credit_relay_refresh_with_http_info(credit_relay_refresh_request, opts) - data - end - - # 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. - # @param credit_relay_refresh_request [CreditRelayRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditRelayRefreshResponse, Integer, Hash)>] CreditRelayRefreshResponse data, response status code and response headers - def credit_relay_refresh_with_http_info(credit_relay_refresh_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_relay_refresh ...' - end - # verify the required parameter 'credit_relay_refresh_request' is set - if @api_client.config.client_side_validation && credit_relay_refresh_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_relay_refresh_request' when calling PlaidApi.credit_relay_refresh" - end - # resource path - local_var_path = '/credit/relay/refresh' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_relay_refresh_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditRelayRefreshResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_relay_refresh", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_relay_refresh\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`. - # @param credit_relay_remove_request [CreditRelayRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [CreditRelayRemoveResponse] - def credit_relay_remove(credit_relay_remove_request, opts = {}) - data, _status_code, _headers = credit_relay_remove_with_http_info(credit_relay_remove_request, opts) - data - end - - # 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`. - # @param credit_relay_remove_request [CreditRelayRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditRelayRemoveResponse, Integer, Hash)>] CreditRelayRemoveResponse data, response status code and response headers - def credit_relay_remove_with_http_info(credit_relay_remove_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_relay_remove ...' - end - # verify the required parameter 'credit_relay_remove_request' is set - if @api_client.config.client_side_validation && credit_relay_remove_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_relay_remove_request' when calling PlaidApi.credit_relay_remove" - end - # resource path - local_var_path = '/credit/relay/remove' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_relay_remove_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditRelayRemoveResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_relay_remove", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_relay_remove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param credit_audit_copy_token_remove_request [CreditAuditCopyTokenRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [CreditAuditCopyTokenRemoveResponse] - def credit_report_audit_copy_remove(credit_audit_copy_token_remove_request, opts = {}) - data, _status_code, _headers = credit_report_audit_copy_remove_with_http_info(credit_audit_copy_token_remove_request, opts) - data - end - - # 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. - # @param credit_audit_copy_token_remove_request [CreditAuditCopyTokenRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditAuditCopyTokenRemoveResponse, Integer, Hash)>] CreditAuditCopyTokenRemoveResponse data, response status code and response headers - def credit_report_audit_copy_remove_with_http_info(credit_audit_copy_token_remove_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_report_audit_copy_remove ...' - end - # verify the required parameter 'credit_audit_copy_token_remove_request' is set - if @api_client.config.client_side_validation && credit_audit_copy_token_remove_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_audit_copy_token_remove_request' when calling PlaidApi.credit_report_audit_copy_remove" - end - # resource path - local_var_path = '/credit/audit_copy_token/remove' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_audit_copy_token_remove_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditAuditCopyTokenRemoveResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_report_audit_copy_remove", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_report_audit_copy_remove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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). - # @param credit_sessions_get_request [CreditSessionsGetRequest] - # @param [Hash] opts the optional parameters - # @return [CreditSessionsGetResponse] - def credit_sessions_get(credit_sessions_get_request, opts = {}) - data, _status_code, _headers = credit_sessions_get_with_http_info(credit_sessions_get_request, opts) - data - end - - # 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). - # @param credit_sessions_get_request [CreditSessionsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(CreditSessionsGetResponse, Integer, Hash)>] CreditSessionsGetResponse data, response status code and response headers - def credit_sessions_get_with_http_info(credit_sessions_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.credit_sessions_get ...' - end - # verify the required parameter 'credit_sessions_get_request' is set - if @api_client.config.client_side_validation && credit_sessions_get_request.nil? - fail ArgumentError, "Missing the required parameter 'credit_sessions_get_request' when calling PlaidApi.credit_sessions_get" - end - # resource path - local_var_path = '/credit/sessions/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(credit_sessions_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'CreditSessionsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.credit_sessions_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#credit_sessions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve a dashboard user - # Retrieve information about a dashboard user. - # @param dashboard_user_get_request [DashboardUserGetRequest] - # @param [Hash] opts the optional parameters - # @return [DashboardUserGetResponse] - def dashboard_user_get(dashboard_user_get_request, opts = {}) - data, _status_code, _headers = dashboard_user_get_with_http_info(dashboard_user_get_request, opts) - data - end - - # Retrieve a dashboard user - # Retrieve information about a dashboard user. - # @param dashboard_user_get_request [DashboardUserGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(DashboardUserGetResponse, Integer, Hash)>] DashboardUserGetResponse data, response status code and response headers - def dashboard_user_get_with_http_info(dashboard_user_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.dashboard_user_get ...' - end - # verify the required parameter 'dashboard_user_get_request' is set - if @api_client.config.client_side_validation && dashboard_user_get_request.nil? - fail ArgumentError, "Missing the required parameter 'dashboard_user_get_request' when calling PlaidApi.dashboard_user_get" - end - # resource path - local_var_path = '/dashboard_user/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(dashboard_user_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'DashboardUserGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.dashboard_user_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#dashboard_user_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List dashboard users - # List all dashboard users associated with your account. - # @param dashboard_user_list_request [DashboardUserListRequest] - # @param [Hash] opts the optional parameters - # @return [DashboardUserListResponse] - def dashboard_user_list(dashboard_user_list_request, opts = {}) - data, _status_code, _headers = dashboard_user_list_with_http_info(dashboard_user_list_request, opts) - data - end - - # List dashboard users - # List all dashboard users associated with your account. - # @param dashboard_user_list_request [DashboardUserListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(DashboardUserListResponse, Integer, Hash)>] DashboardUserListResponse data, response status code and response headers - def dashboard_user_list_with_http_info(dashboard_user_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.dashboard_user_list ...' - end - # verify the required parameter 'dashboard_user_list_request' is set - if @api_client.config.client_side_validation && dashboard_user_list_request.nil? - fail ArgumentError, "Missing the required parameter 'dashboard_user_list_request' when calling PlaidApi.dashboard_user_list" - end - # resource path - local_var_path = '/dashboard_user/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(dashboard_user_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'DashboardUserListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.dashboard_user_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#dashboard_user_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param deposit_switch_alt_create_request [DepositSwitchAltCreateRequest] - # @param [Hash] opts the optional parameters - # @return [DepositSwitchAltCreateResponse] - def deposit_switch_alt_create(deposit_switch_alt_create_request, opts = {}) - data, _status_code, _headers = deposit_switch_alt_create_with_http_info(deposit_switch_alt_create_request, opts) - data - end - - # 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. - # @param deposit_switch_alt_create_request [DepositSwitchAltCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(DepositSwitchAltCreateResponse, Integer, Hash)>] DepositSwitchAltCreateResponse data, response status code and response headers - def deposit_switch_alt_create_with_http_info(deposit_switch_alt_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.deposit_switch_alt_create ...' - end - # verify the required parameter 'deposit_switch_alt_create_request' is set - if @api_client.config.client_side_validation && deposit_switch_alt_create_request.nil? - fail ArgumentError, "Missing the required parameter 'deposit_switch_alt_create_request' when calling PlaidApi.deposit_switch_alt_create" - end - # resource path - local_var_path = '/deposit_switch/alt/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(deposit_switch_alt_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'DepositSwitchAltCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.deposit_switch_alt_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#deposit_switch_alt_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Create a deposit switch - # This endpoint creates a deposit switch entity that will be persisted throughout the lifecycle of the switch. - # @param deposit_switch_create_request [DepositSwitchCreateRequest] - # @param [Hash] opts the optional parameters - # @return [DepositSwitchCreateResponse] - def deposit_switch_create(deposit_switch_create_request, opts = {}) - data, _status_code, _headers = deposit_switch_create_with_http_info(deposit_switch_create_request, opts) - data - end - - # Create a deposit switch - # This endpoint creates a deposit switch entity that will be persisted throughout the lifecycle of the switch. - # @param deposit_switch_create_request [DepositSwitchCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(DepositSwitchCreateResponse, Integer, Hash)>] DepositSwitchCreateResponse data, response status code and response headers - def deposit_switch_create_with_http_info(deposit_switch_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.deposit_switch_create ...' - end - # verify the required parameter 'deposit_switch_create_request' is set - if @api_client.config.client_side_validation && deposit_switch_create_request.nil? - fail ArgumentError, "Missing the required parameter 'deposit_switch_create_request' when calling PlaidApi.deposit_switch_create" - end - # resource path - local_var_path = '/deposit_switch/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(deposit_switch_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'DepositSwitchCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.deposit_switch_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#deposit_switch_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param deposit_switch_get_request [DepositSwitchGetRequest] - # @param [Hash] opts the optional parameters - # @return [DepositSwitchGetResponse] - def deposit_switch_get(deposit_switch_get_request, opts = {}) - data, _status_code, _headers = deposit_switch_get_with_http_info(deposit_switch_get_request, opts) - data - end - - # 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. - # @param deposit_switch_get_request [DepositSwitchGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(DepositSwitchGetResponse, Integer, Hash)>] DepositSwitchGetResponse data, response status code and response headers - def deposit_switch_get_with_http_info(deposit_switch_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.deposit_switch_get ...' - end - # verify the required parameter 'deposit_switch_get_request' is set - if @api_client.config.client_side_validation && deposit_switch_get_request.nil? - fail ArgumentError, "Missing the required parameter 'deposit_switch_get_request' when calling PlaidApi.deposit_switch_get" - end - # resource path - local_var_path = '/deposit_switch/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(deposit_switch_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'DepositSwitchGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.deposit_switch_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#deposit_switch_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param deposit_switch_token_create_request [DepositSwitchTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [DepositSwitchTokenCreateResponse] - def deposit_switch_token_create(deposit_switch_token_create_request, opts = {}) - data, _status_code, _headers = deposit_switch_token_create_with_http_info(deposit_switch_token_create_request, opts) - data - end - - # 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. - # @param deposit_switch_token_create_request [DepositSwitchTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(DepositSwitchTokenCreateResponse, Integer, Hash)>] DepositSwitchTokenCreateResponse data, response status code and response headers - def deposit_switch_token_create_with_http_info(deposit_switch_token_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.deposit_switch_token_create ...' - end - # verify the required parameter 'deposit_switch_token_create_request' is set - if @api_client.config.client_side_validation && deposit_switch_token_create_request.nil? - fail ArgumentError, "Missing the required parameter 'deposit_switch_token_create_request' when calling PlaidApi.deposit_switch_token_create" - end - # resource path - local_var_path = '/deposit_switch/token/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(deposit_switch_token_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'DepositSwitchTokenCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.deposit_switch_token_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#deposit_switch_token_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param employers_search_request [EmployersSearchRequest] - # @param [Hash] opts the optional parameters - # @return [EmployersSearchResponse] - def employers_search(employers_search_request, opts = {}) - data, _status_code, _headers = employers_search_with_http_info(employers_search_request, opts) - data - end - - # 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. - # @param employers_search_request [EmployersSearchRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(EmployersSearchResponse, Integer, Hash)>] EmployersSearchResponse data, response status code and response headers - def employers_search_with_http_info(employers_search_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.employers_search ...' - end - # verify the required parameter 'employers_search_request' is set - if @api_client.config.client_side_validation && employers_search_request.nil? - fail ArgumentError, "Missing the required parameter 'employers_search_request' when calling PlaidApi.employers_search" - end - # resource path - local_var_path = '/employers/search' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(employers_search_request) - - # return_type - return_type = opts[:debug_return_type] || 'EmployersSearchResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.employers_search", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#employers_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # (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. - # @param employment_verification_get_request [EmploymentVerificationGetRequest] - # @param [Hash] opts the optional parameters - # @return [EmploymentVerificationGetResponse] - def employment_verification_get(employment_verification_get_request, opts = {}) - data, _status_code, _headers = employment_verification_get_with_http_info(employment_verification_get_request, opts) - data - end - - # (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. - # @param employment_verification_get_request [EmploymentVerificationGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(EmploymentVerificationGetResponse, Integer, Hash)>] EmploymentVerificationGetResponse data, response status code and response headers - def employment_verification_get_with_http_info(employment_verification_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.employment_verification_get ...' - end - # verify the required parameter 'employment_verification_get_request' is set - if @api_client.config.client_side_validation && employment_verification_get_request.nil? - fail ArgumentError, "Missing the required parameter 'employment_verification_get_request' when calling PlaidApi.employment_verification_get" - end - # resource path - local_var_path = '/employment/verification/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(employment_verification_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'EmploymentVerificationGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.employment_verification_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#employment_verification_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Webhook receiver for fdx notifications - # A generic webhook receiver endpoint for FDX Event Notifications - # @param fdx_notification [FDXNotification] - # @param [Hash] opts the optional parameters - # @return [nil] - def fdx_notifications(fdx_notification, opts = {}) - fdx_notifications_with_http_info(fdx_notification, opts) - nil - end - - # Webhook receiver for fdx notifications - # A generic webhook receiver endpoint for FDX Event Notifications - # @param fdx_notification [FDXNotification] - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def fdx_notifications_with_http_info(fdx_notification, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.fdx_notifications ...' - end - # verify the required parameter 'fdx_notification' is set - if @api_client.config.client_side_validation && fdx_notification.nil? - fail ArgumentError, "Missing the required parameter 'fdx_notification' when calling PlaidApi.fdx_notifications" - end - # resource path - local_var_path = '/fdx/notifications' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(fdx_notification) - - # return_type - return_type = opts[:debug_return_type] - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.fdx_notifications", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#fdx_notifications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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). - # @param identity_get_request [IdentityGetRequest] - # @param [Hash] opts the optional parameters - # @return [IdentityGetResponse] - def identity_get(identity_get_request, opts = {}) - data, _status_code, _headers = identity_get_with_http_info(identity_get_request, opts) - data - end - - # 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). - # @param identity_get_request [IdentityGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(IdentityGetResponse, Integer, Hash)>] IdentityGetResponse data, response status code and response headers - def identity_get_with_http_info(identity_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.identity_get ...' - end - # verify the required parameter 'identity_get_request' is set - if @api_client.config.client_side_validation && identity_get_request.nil? - fail ArgumentError, "Missing the required parameter 'identity_get_request' when calling PlaidApi.identity_get" - end - # resource path - local_var_path = '/identity/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(identity_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'IdentityGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.identity_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#identity_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param identity_match_request [IdentityMatchRequest] - # @param [Hash] opts the optional parameters - # @return [IdentityMatchResponse] - def identity_match(identity_match_request, opts = {}) - data, _status_code, _headers = identity_match_with_http_info(identity_match_request, opts) - data - end - - # 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. - # @param identity_match_request [IdentityMatchRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(IdentityMatchResponse, Integer, Hash)>] IdentityMatchResponse data, response status code and response headers - def identity_match_with_http_info(identity_match_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.identity_match ...' - end - # verify the required parameter 'identity_match_request' is set - if @api_client.config.client_side_validation && identity_match_request.nil? - fail ArgumentError, "Missing the required parameter 'identity_match_request' when calling PlaidApi.identity_match" - end - # resource path - local_var_path = '/identity/match' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(identity_match_request) - - # return_type - return_type = opts[:debug_return_type] || 'IdentityMatchResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.identity_match", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#identity_match\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param identity_refresh_request [IdentityRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [IdentityRefreshResponse] - def identity_refresh(identity_refresh_request, opts = {}) - data, _status_code, _headers = identity_refresh_with_http_info(identity_refresh_request, opts) - data - end - - # 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. - # @param identity_refresh_request [IdentityRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(IdentityRefreshResponse, Integer, Hash)>] IdentityRefreshResponse data, response status code and response headers - def identity_refresh_with_http_info(identity_refresh_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.identity_refresh ...' - end - # verify the required parameter 'identity_refresh_request' is set - if @api_client.config.client_side_validation && identity_refresh_request.nil? - fail ArgumentError, "Missing the required parameter 'identity_refresh_request' when calling PlaidApi.identity_refresh" - end - # resource path - local_var_path = '/identity/refresh' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(identity_refresh_request) - - # return_type - return_type = opts[:debug_return_type] || 'IdentityRefreshResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.identity_refresh", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#identity_refresh\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param identity_verification_autofill_create_request [IdentityVerificationAutofillCreateRequest] - # @param [Hash] opts the optional parameters - # @return [IdentityVerificationAutofillCreateResponse] - def identity_verification_autofill_create(identity_verification_autofill_create_request, opts = {}) - data, _status_code, _headers = identity_verification_autofill_create_with_http_info(identity_verification_autofill_create_request, opts) - data - end - - # 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. - # @param identity_verification_autofill_create_request [IdentityVerificationAutofillCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(IdentityVerificationAutofillCreateResponse, Integer, Hash)>] IdentityVerificationAutofillCreateResponse data, response status code and response headers - def identity_verification_autofill_create_with_http_info(identity_verification_autofill_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.identity_verification_autofill_create ...' - end - # verify the required parameter 'identity_verification_autofill_create_request' is set - if @api_client.config.client_side_validation && identity_verification_autofill_create_request.nil? - fail ArgumentError, "Missing the required parameter 'identity_verification_autofill_create_request' when calling PlaidApi.identity_verification_autofill_create" - end - # resource path - local_var_path = '/identity_verification/autofill/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(identity_verification_autofill_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'IdentityVerificationAutofillCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.identity_verification_autofill_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#identity_verification_autofill_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param identity_verification_create_request [IdentityVerificationCreateRequest] - # @param [Hash] opts the optional parameters - # @return [IdentityVerificationCreateResponse] - def identity_verification_create(identity_verification_create_request, opts = {}) - data, _status_code, _headers = identity_verification_create_with_http_info(identity_verification_create_request, opts) - data - end - - # 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. - # @param identity_verification_create_request [IdentityVerificationCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(IdentityVerificationCreateResponse, Integer, Hash)>] IdentityVerificationCreateResponse data, response status code and response headers - def identity_verification_create_with_http_info(identity_verification_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.identity_verification_create ...' - end - # verify the required parameter 'identity_verification_create_request' is set - if @api_client.config.client_side_validation && identity_verification_create_request.nil? - fail ArgumentError, "Missing the required parameter 'identity_verification_create_request' when calling PlaidApi.identity_verification_create" - end - # resource path - local_var_path = '/identity_verification/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(identity_verification_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'IdentityVerificationCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.identity_verification_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#identity_verification_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve Identity Verification - # Retrieve a previously created Identity Verification. - # @param identity_verification_get_request [IdentityVerificationGetRequest] - # @param [Hash] opts the optional parameters - # @return [IdentityVerificationGetResponse] - def identity_verification_get(identity_verification_get_request, opts = {}) - data, _status_code, _headers = identity_verification_get_with_http_info(identity_verification_get_request, opts) - data - end - - # Retrieve Identity Verification - # Retrieve a previously created Identity Verification. - # @param identity_verification_get_request [IdentityVerificationGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(IdentityVerificationGetResponse, Integer, Hash)>] IdentityVerificationGetResponse data, response status code and response headers - def identity_verification_get_with_http_info(identity_verification_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.identity_verification_get ...' - end - # verify the required parameter 'identity_verification_get_request' is set - if @api_client.config.client_side_validation && identity_verification_get_request.nil? - fail ArgumentError, "Missing the required parameter 'identity_verification_get_request' when calling PlaidApi.identity_verification_get" - end - # resource path - local_var_path = '/identity_verification/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(identity_verification_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'IdentityVerificationGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.identity_verification_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#identity_verification_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List Identity Verifications - # Filter and list Identity Verifications created by your account - # @param identity_verification_list_request [IdentityVerificationListRequest] - # @param [Hash] opts the optional parameters - # @return [IdentityVerificationListResponse] - def identity_verification_list(identity_verification_list_request, opts = {}) - data, _status_code, _headers = identity_verification_list_with_http_info(identity_verification_list_request, opts) - data - end - - # List Identity Verifications - # Filter and list Identity Verifications created by your account - # @param identity_verification_list_request [IdentityVerificationListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(IdentityVerificationListResponse, Integer, Hash)>] IdentityVerificationListResponse data, response status code and response headers - def identity_verification_list_with_http_info(identity_verification_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.identity_verification_list ...' - end - # verify the required parameter 'identity_verification_list_request' is set - if @api_client.config.client_side_validation && identity_verification_list_request.nil? - fail ArgumentError, "Missing the required parameter 'identity_verification_list_request' when calling PlaidApi.identity_verification_list" - end - # resource path - local_var_path = '/identity_verification/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(identity_verification_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'IdentityVerificationListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.identity_verification_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#identity_verification_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retry an Identity Verification - # Allow a customer to retry their Identity Verification - # @param identity_verification_retry_request [IdentityVerificationRetryRequest] - # @param [Hash] opts the optional parameters - # @return [IdentityVerificationRetryResponse] - def identity_verification_retry(identity_verification_retry_request, opts = {}) - data, _status_code, _headers = identity_verification_retry_with_http_info(identity_verification_retry_request, opts) - data - end - - # Retry an Identity Verification - # Allow a customer to retry their Identity Verification - # @param identity_verification_retry_request [IdentityVerificationRetryRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(IdentityVerificationRetryResponse, Integer, Hash)>] IdentityVerificationRetryResponse data, response status code and response headers - def identity_verification_retry_with_http_info(identity_verification_retry_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.identity_verification_retry ...' - end - # verify the required parameter 'identity_verification_retry_request' is set - if @api_client.config.client_side_validation && identity_verification_retry_request.nil? - fail ArgumentError, "Missing the required parameter 'identity_verification_retry_request' when calling PlaidApi.identity_verification_retry" - end - # resource path - local_var_path = '/identity_verification/retry' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(identity_verification_retry_request) - - # return_type - return_type = opts[:debug_return_type] || 'IdentityVerificationRetryResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.identity_verification_retry", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#identity_verification_retry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # (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. - # @param income_verification_create_request [IncomeVerificationCreateRequest] - # @param [Hash] opts the optional parameters - # @return [IncomeVerificationCreateResponse] - def income_verification_create(income_verification_create_request, opts = {}) - data, _status_code, _headers = income_verification_create_with_http_info(income_verification_create_request, opts) - data - end - - # (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. - # @param income_verification_create_request [IncomeVerificationCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(IncomeVerificationCreateResponse, Integer, Hash)>] IncomeVerificationCreateResponse data, response status code and response headers - def income_verification_create_with_http_info(income_verification_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.income_verification_create ...' - end - # verify the required parameter 'income_verification_create_request' is set - if @api_client.config.client_side_validation && income_verification_create_request.nil? - fail ArgumentError, "Missing the required parameter 'income_verification_create_request' when calling PlaidApi.income_verification_create" - end - # resource path - local_var_path = '/income/verification/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(income_verification_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'IncomeVerificationCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.income_verification_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#income_verification_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # (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. - # @param income_verification_documents_download_request [IncomeVerificationDocumentsDownloadRequest] - # @param [Hash] opts the optional parameters - # @return [File] - def income_verification_documents_download(income_verification_documents_download_request, opts = {}) - data, _status_code, _headers = income_verification_documents_download_with_http_info(income_verification_documents_download_request, opts) - data - end - - # (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. - # @param income_verification_documents_download_request [IncomeVerificationDocumentsDownloadRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def income_verification_documents_download_with_http_info(income_verification_documents_download_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.income_verification_documents_download ...' - end - # verify the required parameter 'income_verification_documents_download_request' is set - if @api_client.config.client_side_validation && income_verification_documents_download_request.nil? - fail ArgumentError, "Missing the required parameter 'income_verification_documents_download_request' when calling PlaidApi.income_verification_documents_download" - end - # resource path - local_var_path = '/income/verification/documents/download' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/zip']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(income_verification_documents_download_request) - - # return_type - return_type = opts[:debug_return_type] || 'File' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.income_verification_documents_download", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#income_verification_documents_download\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # (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. - # @param income_verification_paystubs_get_request [IncomeVerificationPaystubsGetRequest] - # @param [Hash] opts the optional parameters - # @return [IncomeVerificationPaystubsGetResponse] - def income_verification_paystubs_get(income_verification_paystubs_get_request, opts = {}) - data, _status_code, _headers = income_verification_paystubs_get_with_http_info(income_verification_paystubs_get_request, opts) - data - end - - # (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. - # @param income_verification_paystubs_get_request [IncomeVerificationPaystubsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(IncomeVerificationPaystubsGetResponse, Integer, Hash)>] IncomeVerificationPaystubsGetResponse data, response status code and response headers - def income_verification_paystubs_get_with_http_info(income_verification_paystubs_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.income_verification_paystubs_get ...' - end - # verify the required parameter 'income_verification_paystubs_get_request' is set - if @api_client.config.client_side_validation && income_verification_paystubs_get_request.nil? - fail ArgumentError, "Missing the required parameter 'income_verification_paystubs_get_request' when calling PlaidApi.income_verification_paystubs_get" - end - # resource path - local_var_path = '/income/verification/paystubs/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(income_verification_paystubs_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'IncomeVerificationPaystubsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.income_verification_paystubs_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#income_verification_paystubs_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # (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. - # @param income_verification_precheck_request [IncomeVerificationPrecheckRequest] - # @param [Hash] opts the optional parameters - # @return [IncomeVerificationPrecheckResponse] - def income_verification_precheck(income_verification_precheck_request, opts = {}) - data, _status_code, _headers = income_verification_precheck_with_http_info(income_verification_precheck_request, opts) - data - end - - # (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. - # @param income_verification_precheck_request [IncomeVerificationPrecheckRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(IncomeVerificationPrecheckResponse, Integer, Hash)>] IncomeVerificationPrecheckResponse data, response status code and response headers - def income_verification_precheck_with_http_info(income_verification_precheck_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.income_verification_precheck ...' - end - # verify the required parameter 'income_verification_precheck_request' is set - if @api_client.config.client_side_validation && income_verification_precheck_request.nil? - fail ArgumentError, "Missing the required parameter 'income_verification_precheck_request' when calling PlaidApi.income_verification_precheck" - end - # resource path - local_var_path = '/income/verification/precheck' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(income_verification_precheck_request) - - # return_type - return_type = opts[:debug_return_type] || 'IncomeVerificationPrecheckResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.income_verification_precheck", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#income_verification_precheck\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # (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. - # @param income_verification_taxforms_get_request [IncomeVerificationTaxformsGetRequest] - # @param [Hash] opts the optional parameters - # @return [IncomeVerificationTaxformsGetResponse] - def income_verification_taxforms_get(income_verification_taxforms_get_request, opts = {}) - data, _status_code, _headers = income_verification_taxforms_get_with_http_info(income_verification_taxforms_get_request, opts) - data - end - - # (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. - # @param income_verification_taxforms_get_request [IncomeVerificationTaxformsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(IncomeVerificationTaxformsGetResponse, Integer, Hash)>] IncomeVerificationTaxformsGetResponse data, response status code and response headers - def income_verification_taxforms_get_with_http_info(income_verification_taxforms_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.income_verification_taxforms_get ...' - end - # verify the required parameter 'income_verification_taxforms_get_request' is set - if @api_client.config.client_side_validation && income_verification_taxforms_get_request.nil? - fail ArgumentError, "Missing the required parameter 'income_verification_taxforms_get_request' when calling PlaidApi.income_verification_taxforms_get" - end - # resource path - local_var_path = '/income/verification/taxforms/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(income_verification_taxforms_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'IncomeVerificationTaxformsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.income_verification_taxforms_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#income_verification_taxforms_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param institutions_get_request [InstitutionsGetRequest] - # @param [Hash] opts the optional parameters - # @return [InstitutionsGetResponse] - def institutions_get(institutions_get_request, opts = {}) - data, _status_code, _headers = institutions_get_with_http_info(institutions_get_request, opts) - data - end - - # 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. - # @param institutions_get_request [InstitutionsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(InstitutionsGetResponse, Integer, Hash)>] InstitutionsGetResponse data, response status code and response headers - def institutions_get_with_http_info(institutions_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.institutions_get ...' - end - # verify the required parameter 'institutions_get_request' is set - if @api_client.config.client_side_validation && institutions_get_request.nil? - fail ArgumentError, "Missing the required parameter 'institutions_get_request' when calling PlaidApi.institutions_get" - end - # resource path - local_var_path = '/institutions/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(institutions_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'InstitutionsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.institutions_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#institutions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param institutions_get_by_id_request [InstitutionsGetByIdRequest] - # @param [Hash] opts the optional parameters - # @return [InstitutionsGetByIdResponse] - def institutions_get_by_id(institutions_get_by_id_request, opts = {}) - data, _status_code, _headers = institutions_get_by_id_with_http_info(institutions_get_by_id_request, opts) - data - end - - # 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. - # @param institutions_get_by_id_request [InstitutionsGetByIdRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(InstitutionsGetByIdResponse, Integer, Hash)>] InstitutionsGetByIdResponse data, response status code and response headers - def institutions_get_by_id_with_http_info(institutions_get_by_id_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.institutions_get_by_id ...' - end - # verify the required parameter 'institutions_get_by_id_request' is set - if @api_client.config.client_side_validation && institutions_get_by_id_request.nil? - fail ArgumentError, "Missing the required parameter 'institutions_get_by_id_request' when calling PlaidApi.institutions_get_by_id" - end - # resource path - local_var_path = '/institutions/get_by_id' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(institutions_get_by_id_request) - - # return_type - return_type = opts[:debug_return_type] || 'InstitutionsGetByIdResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.institutions_get_by_id", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#institutions_get_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param institutions_search_request [InstitutionsSearchRequest] - # @param [Hash] opts the optional parameters - # @return [InstitutionsSearchResponse] - def institutions_search(institutions_search_request, opts = {}) - data, _status_code, _headers = institutions_search_with_http_info(institutions_search_request, opts) - data - end - - # 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. - # @param institutions_search_request [InstitutionsSearchRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(InstitutionsSearchResponse, Integer, Hash)>] InstitutionsSearchResponse data, response status code and response headers - def institutions_search_with_http_info(institutions_search_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.institutions_search ...' - end - # verify the required parameter 'institutions_search_request' is set - if @api_client.config.client_side_validation && institutions_search_request.nil? - fail ArgumentError, "Missing the required parameter 'institutions_search_request' when calling PlaidApi.institutions_search" - end - # resource path - local_var_path = '/institutions/search' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(institutions_search_request) - - # return_type - return_type = opts[:debug_return_type] || 'InstitutionsSearchResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.institutions_search", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#institutions_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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 - # @param investments_auth_get_request [InvestmentsAuthGetRequest] - # @param [Hash] opts the optional parameters - # @return [InvestmentsAuthGetResponse] - def investments_auth_get(investments_auth_get_request, opts = {}) - data, _status_code, _headers = investments_auth_get_with_http_info(investments_auth_get_request, opts) - data - end - - # 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 - # @param investments_auth_get_request [InvestmentsAuthGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(InvestmentsAuthGetResponse, Integer, Hash)>] InvestmentsAuthGetResponse data, response status code and response headers - def investments_auth_get_with_http_info(investments_auth_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.investments_auth_get ...' - end - # verify the required parameter 'investments_auth_get_request' is set - if @api_client.config.client_side_validation && investments_auth_get_request.nil? - fail ArgumentError, "Missing the required parameter 'investments_auth_get_request' when calling PlaidApi.investments_auth_get" - end - # resource path - local_var_path = '/investments/auth/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(investments_auth_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'InvestmentsAuthGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.investments_auth_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#investments_auth_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get Investment holdings - # The `/investments/holdings/get` endpoint allows developers to receive user-authorized stock position data for `investment`-type accounts. - # @param investments_holdings_get_request [InvestmentsHoldingsGetRequest] - # @param [Hash] opts the optional parameters - # @return [InvestmentsHoldingsGetResponse] - def investments_holdings_get(investments_holdings_get_request, opts = {}) - data, _status_code, _headers = investments_holdings_get_with_http_info(investments_holdings_get_request, opts) - data - end - - # Get Investment holdings - # The `/investments/holdings/get` endpoint allows developers to receive user-authorized stock position data for `investment`-type accounts. - # @param investments_holdings_get_request [InvestmentsHoldingsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(InvestmentsHoldingsGetResponse, Integer, Hash)>] InvestmentsHoldingsGetResponse data, response status code and response headers - def investments_holdings_get_with_http_info(investments_holdings_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.investments_holdings_get ...' - end - # verify the required parameter 'investments_holdings_get_request' is set - if @api_client.config.client_side_validation && investments_holdings_get_request.nil? - fail ArgumentError, "Missing the required parameter 'investments_holdings_get_request' when calling PlaidApi.investments_holdings_get" - end - # resource path - local_var_path = '/investments/holdings/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(investments_holdings_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'InvestmentsHoldingsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.investments_holdings_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#investments_holdings_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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 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. - # @param investments_refresh_request [InvestmentsRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [InvestmentsRefreshResponse] - def investments_refresh(investments_refresh_request, opts = {}) - data, _status_code, _headers = investments_refresh_with_http_info(investments_refresh_request, opts) - data - end - - # 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 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. - # @param investments_refresh_request [InvestmentsRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(InvestmentsRefreshResponse, Integer, Hash)>] InvestmentsRefreshResponse data, response status code and response headers - def investments_refresh_with_http_info(investments_refresh_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.investments_refresh ...' - end - # verify the required parameter 'investments_refresh_request' is set - if @api_client.config.client_side_validation && investments_refresh_request.nil? - fail ArgumentError, "Missing the required parameter 'investments_refresh_request' when calling PlaidApi.investments_refresh" - end - # resource path - local_var_path = '/investments/refresh' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(investments_refresh_request) - - # return_type - return_type = opts[:debug_return_type] || 'InvestmentsRefreshResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.investments_refresh", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#investments_refresh\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param investments_transactions_get_request [InvestmentsTransactionsGetRequest] - # @param [Hash] opts the optional parameters - # @return [InvestmentsTransactionsGetResponse] - def investments_transactions_get(investments_transactions_get_request, opts = {}) - data, _status_code, _headers = investments_transactions_get_with_http_info(investments_transactions_get_request, opts) - data - end - - # 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. - # @param investments_transactions_get_request [InvestmentsTransactionsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(InvestmentsTransactionsGetResponse, Integer, Hash)>] InvestmentsTransactionsGetResponse data, response status code and response headers - def investments_transactions_get_with_http_info(investments_transactions_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.investments_transactions_get ...' - end - # verify the required parameter 'investments_transactions_get_request' is set - if @api_client.config.client_side_validation && investments_transactions_get_request.nil? - fail ArgumentError, "Missing the required parameter 'investments_transactions_get_request' when calling PlaidApi.investments_transactions_get" - end - # resource path - local_var_path = '/investments/transactions/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(investments_transactions_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'InvestmentsTransactionsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.investments_transactions_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#investments_transactions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`. - # @param item_access_token_invalidate_request [ItemAccessTokenInvalidateRequest] - # @param [Hash] opts the optional parameters - # @return [ItemAccessTokenInvalidateResponse] - def item_access_token_invalidate(item_access_token_invalidate_request, opts = {}) - data, _status_code, _headers = item_access_token_invalidate_with_http_info(item_access_token_invalidate_request, opts) - data - end - - # 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`. - # @param item_access_token_invalidate_request [ItemAccessTokenInvalidateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ItemAccessTokenInvalidateResponse, Integer, Hash)>] ItemAccessTokenInvalidateResponse data, response status code and response headers - def item_access_token_invalidate_with_http_info(item_access_token_invalidate_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.item_access_token_invalidate ...' - end - # verify the required parameter 'item_access_token_invalidate_request' is set - if @api_client.config.client_side_validation && item_access_token_invalidate_request.nil? - fail ArgumentError, "Missing the required parameter 'item_access_token_invalidate_request' when calling PlaidApi.item_access_token_invalidate" - end - # resource path - local_var_path = '/item/access_token/invalidate' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(item_access_token_invalidate_request) - - # return_type - return_type = opts[:debug_return_type] || 'ItemAccessTokenInvalidateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.item_access_token_invalidate", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#item_access_token_invalidate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List a historical log of user consent events - # List a historical log of user consent events - # @param item_activity_list_request [ItemActivityListRequest] - # @param [Hash] opts the optional parameters - # @return [ItemActivityListResponse] - def item_activity_list(item_activity_list_request, opts = {}) - data, _status_code, _headers = item_activity_list_with_http_info(item_activity_list_request, opts) - data - end - - # List a historical log of user consent events - # List a historical log of user consent events - # @param item_activity_list_request [ItemActivityListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ItemActivityListResponse, Integer, Hash)>] ItemActivityListResponse data, response status code and response headers - def item_activity_list_with_http_info(item_activity_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.item_activity_list ...' - end - # verify the required parameter 'item_activity_list_request' is set - if @api_client.config.client_side_validation && item_activity_list_request.nil? - fail ArgumentError, "Missing the required parameter 'item_activity_list_request' when calling PlaidApi.item_activity_list" - end - # resource path - local_var_path = '/item/activity/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(item_activity_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'ItemActivityListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.item_activity_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#item_activity_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List a user’s connected applications - # List a user’s connected applications - # @param item_application_list_request [ItemApplicationListRequest] - # @param [Hash] opts the optional parameters - # @return [ItemApplicationListResponse] - def item_application_list(item_application_list_request, opts = {}) - data, _status_code, _headers = item_application_list_with_http_info(item_application_list_request, opts) - data - end - - # List a user’s connected applications - # List a user’s connected applications - # @param item_application_list_request [ItemApplicationListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ItemApplicationListResponse, Integer, Hash)>] ItemApplicationListResponse data, response status code and response headers - def item_application_list_with_http_info(item_application_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.item_application_list ...' - end - # verify the required parameter 'item_application_list_request' is set - if @api_client.config.client_side_validation && item_application_list_request.nil? - fail ArgumentError, "Missing the required parameter 'item_application_list_request' when calling PlaidApi.item_application_list" - end - # resource path - local_var_path = '/item/application/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(item_application_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'ItemApplicationListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.item_application_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#item_application_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Update the scopes of access for a particular application - # Enable consumers to update product access on selected accounts for an application. - # @param item_application_scopes_update_request [ItemApplicationScopesUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [ItemApplicationScopesUpdateResponse] - def item_application_scopes_update(item_application_scopes_update_request, opts = {}) - data, _status_code, _headers = item_application_scopes_update_with_http_info(item_application_scopes_update_request, opts) - data - end - - # Update the scopes of access for a particular application - # Enable consumers to update product access on selected accounts for an application. - # @param item_application_scopes_update_request [ItemApplicationScopesUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ItemApplicationScopesUpdateResponse, Integer, Hash)>] ItemApplicationScopesUpdateResponse data, response status code and response headers - def item_application_scopes_update_with_http_info(item_application_scopes_update_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.item_application_scopes_update ...' - end - # verify the required parameter 'item_application_scopes_update_request' is set - if @api_client.config.client_side_validation && item_application_scopes_update_request.nil? - fail ArgumentError, "Missing the required parameter 'item_application_scopes_update_request' when calling PlaidApi.item_application_scopes_update" - end - # resource path - local_var_path = '/item/application/scopes/update' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(item_application_scopes_update_request) - - # return_type - return_type = opts[:debug_return_type] || 'ItemApplicationScopesUpdateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.item_application_scopes_update", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#item_application_scopes_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param item_application_unlink_request [ItemApplicationUnlinkRequest] - # @param [Hash] opts the optional parameters - # @return [ItemApplicationUnlinkResponse] - def item_application_unlink(item_application_unlink_request, opts = {}) - data, _status_code, _headers = item_application_unlink_with_http_info(item_application_unlink_request, opts) - data - end - - # 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. - # @param item_application_unlink_request [ItemApplicationUnlinkRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ItemApplicationUnlinkResponse, Integer, Hash)>] ItemApplicationUnlinkResponse data, response status code and response headers - def item_application_unlink_with_http_info(item_application_unlink_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.item_application_unlink ...' - end - # verify the required parameter 'item_application_unlink_request' is set - if @api_client.config.client_side_validation && item_application_unlink_request.nil? - fail ArgumentError, "Missing the required parameter 'item_application_unlink_request' when calling PlaidApi.item_application_unlink" - end - # resource path - local_var_path = '/item/application/unlink' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(item_application_unlink_request) - - # return_type - return_type = opts[:debug_return_type] || 'ItemApplicationUnlinkResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.item_application_unlink", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#item_application_unlink\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param item_public_token_create_request [ItemPublicTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [ItemPublicTokenCreateResponse] - def item_create_public_token(item_public_token_create_request, opts = {}) - data, _status_code, _headers = item_create_public_token_with_http_info(item_public_token_create_request, opts) - data - end - - # 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. - # @param item_public_token_create_request [ItemPublicTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ItemPublicTokenCreateResponse, Integer, Hash)>] ItemPublicTokenCreateResponse data, response status code and response headers - def item_create_public_token_with_http_info(item_public_token_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.item_create_public_token ...' - end - # verify the required parameter 'item_public_token_create_request' is set - if @api_client.config.client_side_validation && item_public_token_create_request.nil? - fail ArgumentError, "Missing the required parameter 'item_public_token_create_request' when calling PlaidApi.item_create_public_token" - end - # resource path - local_var_path = '/item/public_token/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(item_public_token_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'ItemPublicTokenCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.item_create_public_token", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#item_create_public_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve an Item - # Returns information about the status of an Item. - # @param item_get_request [ItemGetRequest] - # @param [Hash] opts the optional parameters - # @return [ItemGetResponse] - def item_get(item_get_request, opts = {}) - data, _status_code, _headers = item_get_with_http_info(item_get_request, opts) - data - end - - # Retrieve an Item - # Returns information about the status of an Item. - # @param item_get_request [ItemGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ItemGetResponse, Integer, Hash)>] ItemGetResponse data, response status code and response headers - def item_get_with_http_info(item_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.item_get ...' - end - # verify the required parameter 'item_get_request' is set - if @api_client.config.client_side_validation && item_get_request.nil? - fail ArgumentError, "Missing the required parameter 'item_get_request' when calling PlaidApi.item_get" - end - # resource path - local_var_path = '/item/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(item_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'ItemGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.item_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#item_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param item_import_request [ItemImportRequest] - # @param [Hash] opts the optional parameters - # @return [ItemImportResponse] - def item_import(item_import_request, opts = {}) - data, _status_code, _headers = item_import_with_http_info(item_import_request, opts) - data - end - - # 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. - # @param item_import_request [ItemImportRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ItemImportResponse, Integer, Hash)>] ItemImportResponse data, response status code and response headers - def item_import_with_http_info(item_import_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.item_import ...' - end - # verify the required parameter 'item_import_request' is set - if @api_client.config.client_side_validation && item_import_request.nil? - fail ArgumentError, "Missing the required parameter 'item_import_request' when calling PlaidApi.item_import" - end - # resource path - local_var_path = '/item/import' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(item_import_request) - - # return_type - return_type = opts[:debug_return_type] || 'ItemImportResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.item_import", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#item_import\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param item_public_token_exchange_request [ItemPublicTokenExchangeRequest] - # @param [Hash] opts the optional parameters - # @return [ItemPublicTokenExchangeResponse] - def item_public_token_exchange(item_public_token_exchange_request, opts = {}) - data, _status_code, _headers = item_public_token_exchange_with_http_info(item_public_token_exchange_request, opts) - data - end - - # 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. - # @param item_public_token_exchange_request [ItemPublicTokenExchangeRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ItemPublicTokenExchangeResponse, Integer, Hash)>] ItemPublicTokenExchangeResponse data, response status code and response headers - def item_public_token_exchange_with_http_info(item_public_token_exchange_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.item_public_token_exchange ...' - end - # verify the required parameter 'item_public_token_exchange_request' is set - if @api_client.config.client_side_validation && item_public_token_exchange_request.nil? - fail ArgumentError, "Missing the required parameter 'item_public_token_exchange_request' when calling PlaidApi.item_public_token_exchange" - end - # resource path - local_var_path = '/item/public_token/exchange' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(item_public_token_exchange_request) - - # return_type - return_type = opts[:debug_return_type] || 'ItemPublicTokenExchangeResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.item_public_token_exchange", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#item_public_token_exchange\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param item_remove_request [ItemRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [ItemRemoveResponse] - def item_remove(item_remove_request, opts = {}) - data, _status_code, _headers = item_remove_with_http_info(item_remove_request, opts) - data - end - - # 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. - # @param item_remove_request [ItemRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ItemRemoveResponse, Integer, Hash)>] ItemRemoveResponse data, response status code and response headers - def item_remove_with_http_info(item_remove_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.item_remove ...' - end - # verify the required parameter 'item_remove_request' is set - if @api_client.config.client_side_validation && item_remove_request.nil? - fail ArgumentError, "Missing the required parameter 'item_remove_request' when calling PlaidApi.item_remove" - end - # resource path - local_var_path = '/item/remove' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(item_remove_request) - - # return_type - return_type = opts[:debug_return_type] || 'ItemRemoveResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.item_remove", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#item_remove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param item_webhook_update_request [ItemWebhookUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [ItemWebhookUpdateResponse] - def item_webhook_update(item_webhook_update_request, opts = {}) - data, _status_code, _headers = item_webhook_update_with_http_info(item_webhook_update_request, opts) - data - end - - # 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. - # @param item_webhook_update_request [ItemWebhookUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ItemWebhookUpdateResponse, Integer, Hash)>] ItemWebhookUpdateResponse data, response status code and response headers - def item_webhook_update_with_http_info(item_webhook_update_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.item_webhook_update ...' - end - # verify the required parameter 'item_webhook_update_request' is set - if @api_client.config.client_side_validation && item_webhook_update_request.nil? - fail ArgumentError, "Missing the required parameter 'item_webhook_update_request' when calling PlaidApi.item_webhook_update" - end - # resource path - local_var_path = '/item/webhook/update' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(item_webhook_update_request) - - # return_type - return_type = opts[:debug_return_type] || 'ItemWebhookUpdateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.item_webhook_update", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#item_webhook_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param liabilities_get_request [LiabilitiesGetRequest] - # @param [Hash] opts the optional parameters - # @return [LiabilitiesGetResponse] - def liabilities_get(liabilities_get_request, opts = {}) - data, _status_code, _headers = liabilities_get_with_http_info(liabilities_get_request, opts) - data - end - - # 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. - # @param liabilities_get_request [LiabilitiesGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(LiabilitiesGetResponse, Integer, Hash)>] LiabilitiesGetResponse data, response status code and response headers - def liabilities_get_with_http_info(liabilities_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.liabilities_get ...' - end - # verify the required parameter 'liabilities_get_request' is set - if @api_client.config.client_side_validation && liabilities_get_request.nil? - fail ArgumentError, "Missing the required parameter 'liabilities_get_request' when calling PlaidApi.liabilities_get" - end - # resource path - local_var_path = '/liabilities/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(liabilities_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'LiabilitiesGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.liabilities_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#liabilities_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Create Hosted Link session - # Use the `/link_delivery/create` endpoint to create a Hosted Link session. - # @param link_delivery_create_request [LinkDeliveryCreateRequest] - # @param [Hash] opts the optional parameters - # @return [LinkDeliveryCreateResponse] - def link_delivery_create(link_delivery_create_request, opts = {}) - data, _status_code, _headers = link_delivery_create_with_http_info(link_delivery_create_request, opts) - data - end - - # Create Hosted Link session - # Use the `/link_delivery/create` endpoint to create a Hosted Link session. - # @param link_delivery_create_request [LinkDeliveryCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(LinkDeliveryCreateResponse, Integer, Hash)>] LinkDeliveryCreateResponse data, response status code and response headers - def link_delivery_create_with_http_info(link_delivery_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.link_delivery_create ...' - end - # verify the required parameter 'link_delivery_create_request' is set - if @api_client.config.client_side_validation && link_delivery_create_request.nil? - fail ArgumentError, "Missing the required parameter 'link_delivery_create_request' when calling PlaidApi.link_delivery_create" - end - # resource path - local_var_path = '/link_delivery/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(link_delivery_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'LinkDeliveryCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.link_delivery_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#link_delivery_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get Hosted Link session - # Use the `/link_delivery/get` endpoint to get the status of a Hosted Link session. - # @param link_delivery_get_request [LinkDeliveryGetRequest] - # @param [Hash] opts the optional parameters - # @return [LinkDeliveryGetResponse] - def link_delivery_get(link_delivery_get_request, opts = {}) - data, _status_code, _headers = link_delivery_get_with_http_info(link_delivery_get_request, opts) - data - end - - # Get Hosted Link session - # Use the `/link_delivery/get` endpoint to get the status of a Hosted Link session. - # @param link_delivery_get_request [LinkDeliveryGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(LinkDeliveryGetResponse, Integer, Hash)>] LinkDeliveryGetResponse data, response status code and response headers - def link_delivery_get_with_http_info(link_delivery_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.link_delivery_get ...' - end - # verify the required parameter 'link_delivery_get_request' is set - if @api_client.config.client_side_validation && link_delivery_get_request.nil? - fail ArgumentError, "Missing the required parameter 'link_delivery_get_request' when calling PlaidApi.link_delivery_get" - end - # resource path - local_var_path = '/link_delivery/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(link_delivery_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'LinkDeliveryGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.link_delivery_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#link_delivery_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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'. - # @param link_o_auth_correlation_id_exchange_request [LinkOAuthCorrelationIdExchangeRequest] - # @param [Hash] opts the optional parameters - # @return [LinkOAuthCorrelationIdExchangeResponse] - def link_oauth_correlation_id_exchange(link_o_auth_correlation_id_exchange_request, opts = {}) - data, _status_code, _headers = link_oauth_correlation_id_exchange_with_http_info(link_o_auth_correlation_id_exchange_request, opts) - data - end - - # 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'. - # @param link_o_auth_correlation_id_exchange_request [LinkOAuthCorrelationIdExchangeRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(LinkOAuthCorrelationIdExchangeResponse, Integer, Hash)>] LinkOAuthCorrelationIdExchangeResponse data, response status code and response headers - def link_oauth_correlation_id_exchange_with_http_info(link_o_auth_correlation_id_exchange_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.link_oauth_correlation_id_exchange ...' - end - # verify the required parameter 'link_o_auth_correlation_id_exchange_request' is set - if @api_client.config.client_side_validation && link_o_auth_correlation_id_exchange_request.nil? - fail ArgumentError, "Missing the required parameter 'link_o_auth_correlation_id_exchange_request' when calling PlaidApi.link_oauth_correlation_id_exchange" - end - # resource path - local_var_path = '/link/oauth/correlation_id/exchange' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(link_o_auth_correlation_id_exchange_request) - - # return_type - return_type = opts[:debug_return_type] || 'LinkOAuthCorrelationIdExchangeResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.link_oauth_correlation_id_exchange", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#link_oauth_correlation_id_exchange\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param link_token_create_request [LinkTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [LinkTokenCreateResponse] - def link_token_create(link_token_create_request, opts = {}) - data, _status_code, _headers = link_token_create_with_http_info(link_token_create_request, opts) - data - end - - # 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. - # @param link_token_create_request [LinkTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(LinkTokenCreateResponse, Integer, Hash)>] LinkTokenCreateResponse data, response status code and response headers - def link_token_create_with_http_info(link_token_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.link_token_create ...' - end - # verify the required parameter 'link_token_create_request' is set - if @api_client.config.client_side_validation && link_token_create_request.nil? - fail ArgumentError, "Missing the required parameter 'link_token_create_request' when calling PlaidApi.link_token_create" - end - # resource path - local_var_path = '/link/token/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(link_token_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'LinkTokenCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.link_token_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#link_token_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param link_token_get_request [LinkTokenGetRequest] - # @param [Hash] opts the optional parameters - # @return [LinkTokenGetResponse] - def link_token_get(link_token_get_request, opts = {}) - data, _status_code, _headers = link_token_get_with_http_info(link_token_get_request, opts) - data - end - - # 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. - # @param link_token_get_request [LinkTokenGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(LinkTokenGetResponse, Integer, Hash)>] LinkTokenGetResponse data, response status code and response headers - def link_token_get_with_http_info(link_token_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.link_token_get ...' - end - # verify the required parameter 'link_token_get_request' is set - if @api_client.config.client_side_validation && link_token_get_request.nil? - fail ArgumentError, "Missing the required parameter 'link_token_get_request' when calling PlaidApi.link_token_get" - end - # resource path - local_var_path = '/link/token/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(link_token_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'LinkTokenGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.link_token_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#link_token_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Creates a new end customer for a Plaid reseller. - # The `/partner/customer/create` endpoint is used by reseller partners to create end customers. - # @param partner_customer_create_request [PartnerCustomerCreateRequest] - # @param [Hash] opts the optional parameters - # @return [PartnerCustomerCreateResponse] - def partner_customer_create(partner_customer_create_request, opts = {}) - data, _status_code, _headers = partner_customer_create_with_http_info(partner_customer_create_request, opts) - data - end - - # Creates a new end customer for a Plaid reseller. - # The `/partner/customer/create` endpoint is used by reseller partners to create end customers. - # @param partner_customer_create_request [PartnerCustomerCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PartnerCustomerCreateResponse, Integer, Hash)>] PartnerCustomerCreateResponse data, response status code and response headers - def partner_customer_create_with_http_info(partner_customer_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.partner_customer_create ...' - end - # verify the required parameter 'partner_customer_create_request' is set - if @api_client.config.client_side_validation && partner_customer_create_request.nil? - fail ArgumentError, "Missing the required parameter 'partner_customer_create_request' when calling PlaidApi.partner_customer_create" - end - # resource path - local_var_path = '/partner/customer/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(partner_customer_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'PartnerCustomerCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.partner_customer_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#partner_customer_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param partner_customer_enable_request [PartnerCustomerEnableRequest] - # @param [Hash] opts the optional parameters - # @return [PartnerCustomerEnableResponse] - def partner_customer_enable(partner_customer_enable_request, opts = {}) - data, _status_code, _headers = partner_customer_enable_with_http_info(partner_customer_enable_request, opts) - data - end - - # 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. - # @param partner_customer_enable_request [PartnerCustomerEnableRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PartnerCustomerEnableResponse, Integer, Hash)>] PartnerCustomerEnableResponse data, response status code and response headers - def partner_customer_enable_with_http_info(partner_customer_enable_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.partner_customer_enable ...' - end - # verify the required parameter 'partner_customer_enable_request' is set - if @api_client.config.client_side_validation && partner_customer_enable_request.nil? - fail ArgumentError, "Missing the required parameter 'partner_customer_enable_request' when calling PlaidApi.partner_customer_enable" - end - # resource path - local_var_path = '/partner/customer/enable' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(partner_customer_enable_request) - - # return_type - return_type = opts[:debug_return_type] || 'PartnerCustomerEnableResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.partner_customer_enable", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#partner_customer_enable\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param partner_customer_get_request [PartnerCustomerGetRequest] - # @param [Hash] opts the optional parameters - # @return [PartnerCustomerGetResponse] - def partner_customer_get(partner_customer_get_request, opts = {}) - data, _status_code, _headers = partner_customer_get_with_http_info(partner_customer_get_request, opts) - data - end - - # 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. - # @param partner_customer_get_request [PartnerCustomerGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PartnerCustomerGetResponse, Integer, Hash)>] PartnerCustomerGetResponse data, response status code and response headers - def partner_customer_get_with_http_info(partner_customer_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.partner_customer_get ...' - end - # verify the required parameter 'partner_customer_get_request' is set - if @api_client.config.client_side_validation && partner_customer_get_request.nil? - fail ArgumentError, "Missing the required parameter 'partner_customer_get_request' when calling PlaidApi.partner_customer_get" - end - # resource path - local_var_path = '/partner/customer/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(partner_customer_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'PartnerCustomerGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.partner_customer_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#partner_customer_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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). - # @param partner_customer_o_auth_institutions_get_request [PartnerCustomerOAuthInstitutionsGetRequest] - # @param [Hash] opts the optional parameters - # @return [PartnerCustomerOAuthInstitutionsGetResponse] - def partner_customer_oauth_institutions_get(partner_customer_o_auth_institutions_get_request, opts = {}) - data, _status_code, _headers = partner_customer_oauth_institutions_get_with_http_info(partner_customer_o_auth_institutions_get_request, opts) - data - end - - # 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). - # @param partner_customer_o_auth_institutions_get_request [PartnerCustomerOAuthInstitutionsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PartnerCustomerOAuthInstitutionsGetResponse, Integer, Hash)>] PartnerCustomerOAuthInstitutionsGetResponse data, response status code and response headers - def partner_customer_oauth_institutions_get_with_http_info(partner_customer_o_auth_institutions_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.partner_customer_oauth_institutions_get ...' - end - # verify the required parameter 'partner_customer_o_auth_institutions_get_request' is set - if @api_client.config.client_side_validation && partner_customer_o_auth_institutions_get_request.nil? - fail ArgumentError, "Missing the required parameter 'partner_customer_o_auth_institutions_get_request' when calling PlaidApi.partner_customer_oauth_institutions_get" - end - # resource path - local_var_path = '/partner/customer/oauth_institutions/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(partner_customer_o_auth_institutions_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'PartnerCustomerOAuthInstitutionsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.partner_customer_oauth_institutions_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#partner_customer_oauth_institutions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param partner_customer_remove_request [PartnerCustomerRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [PartnerCustomerRemoveResponse] - def partner_customer_remove(partner_customer_remove_request, opts = {}) - data, _status_code, _headers = partner_customer_remove_with_http_info(partner_customer_remove_request, opts) - data - end - - # 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. - # @param partner_customer_remove_request [PartnerCustomerRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PartnerCustomerRemoveResponse, Integer, Hash)>] PartnerCustomerRemoveResponse data, response status code and response headers - def partner_customer_remove_with_http_info(partner_customer_remove_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.partner_customer_remove ...' - end - # verify the required parameter 'partner_customer_remove_request' is set - if @api_client.config.client_side_validation && partner_customer_remove_request.nil? - fail ArgumentError, "Missing the required parameter 'partner_customer_remove_request' when calling PlaidApi.partner_customer_remove" - end - # resource path - local_var_path = '/partner/customer/remove' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(partner_customer_remove_request) - - # return_type - return_type = opts[:debug_return_type] || 'PartnerCustomerRemoveResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.partner_customer_remove", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#partner_customer_remove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param payment_initiation_consent_create_request [PaymentInitiationConsentCreateRequest] - # @param [Hash] opts the optional parameters - # @return [PaymentInitiationConsentCreateResponse] - def payment_initiation_consent_create(payment_initiation_consent_create_request, opts = {}) - data, _status_code, _headers = payment_initiation_consent_create_with_http_info(payment_initiation_consent_create_request, opts) - data - end - - # 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. - # @param payment_initiation_consent_create_request [PaymentInitiationConsentCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentInitiationConsentCreateResponse, Integer, Hash)>] PaymentInitiationConsentCreateResponse data, response status code and response headers - def payment_initiation_consent_create_with_http_info(payment_initiation_consent_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.payment_initiation_consent_create ...' - end - # verify the required parameter 'payment_initiation_consent_create_request' is set - if @api_client.config.client_side_validation && payment_initiation_consent_create_request.nil? - fail ArgumentError, "Missing the required parameter 'payment_initiation_consent_create_request' when calling PlaidApi.payment_initiation_consent_create" - end - # resource path - local_var_path = '/payment_initiation/consent/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_initiation_consent_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'PaymentInitiationConsentCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.payment_initiation_consent_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#payment_initiation_consent_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param payment_initiation_consent_get_request [PaymentInitiationConsentGetRequest] - # @param [Hash] opts the optional parameters - # @return [PaymentInitiationConsentGetResponse] - def payment_initiation_consent_get(payment_initiation_consent_get_request, opts = {}) - data, _status_code, _headers = payment_initiation_consent_get_with_http_info(payment_initiation_consent_get_request, opts) - data - end - - # 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. - # @param payment_initiation_consent_get_request [PaymentInitiationConsentGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentInitiationConsentGetResponse, Integer, Hash)>] PaymentInitiationConsentGetResponse data, response status code and response headers - def payment_initiation_consent_get_with_http_info(payment_initiation_consent_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.payment_initiation_consent_get ...' - end - # verify the required parameter 'payment_initiation_consent_get_request' is set - if @api_client.config.client_side_validation && payment_initiation_consent_get_request.nil? - fail ArgumentError, "Missing the required parameter 'payment_initiation_consent_get_request' when calling PlaidApi.payment_initiation_consent_get" - end - # resource path - local_var_path = '/payment_initiation/consent/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_initiation_consent_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'PaymentInitiationConsentGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.payment_initiation_consent_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#payment_initiation_consent_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Execute a single payment using consent - # The `/payment_initiation/consent/payment/execute` endpoint can be used to execute payments using payment consent. - # @param payment_initiation_consent_payment_execute_request [PaymentInitiationConsentPaymentExecuteRequest] - # @param [Hash] opts the optional parameters - # @return [PaymentInitiationConsentPaymentExecuteResponse] - def payment_initiation_consent_payment_execute(payment_initiation_consent_payment_execute_request, opts = {}) - data, _status_code, _headers = payment_initiation_consent_payment_execute_with_http_info(payment_initiation_consent_payment_execute_request, opts) - data - end - - # Execute a single payment using consent - # The `/payment_initiation/consent/payment/execute` endpoint can be used to execute payments using payment consent. - # @param payment_initiation_consent_payment_execute_request [PaymentInitiationConsentPaymentExecuteRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentInitiationConsentPaymentExecuteResponse, Integer, Hash)>] PaymentInitiationConsentPaymentExecuteResponse data, response status code and response headers - def payment_initiation_consent_payment_execute_with_http_info(payment_initiation_consent_payment_execute_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.payment_initiation_consent_payment_execute ...' - end - # verify the required parameter 'payment_initiation_consent_payment_execute_request' is set - if @api_client.config.client_side_validation && payment_initiation_consent_payment_execute_request.nil? - fail ArgumentError, "Missing the required parameter 'payment_initiation_consent_payment_execute_request' when calling PlaidApi.payment_initiation_consent_payment_execute" - end - # resource path - local_var_path = '/payment_initiation/consent/payment/execute' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_initiation_consent_payment_execute_request) - - # return_type - return_type = opts[:debug_return_type] || 'PaymentInitiationConsentPaymentExecuteResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.payment_initiation_consent_payment_execute", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#payment_initiation_consent_payment_execute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param payment_initiation_consent_revoke_request [PaymentInitiationConsentRevokeRequest] - # @param [Hash] opts the optional parameters - # @return [PaymentInitiationConsentRevokeResponse] - def payment_initiation_consent_revoke(payment_initiation_consent_revoke_request, opts = {}) - data, _status_code, _headers = payment_initiation_consent_revoke_with_http_info(payment_initiation_consent_revoke_request, opts) - data - end - - # 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. - # @param payment_initiation_consent_revoke_request [PaymentInitiationConsentRevokeRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentInitiationConsentRevokeResponse, Integer, Hash)>] PaymentInitiationConsentRevokeResponse data, response status code and response headers - def payment_initiation_consent_revoke_with_http_info(payment_initiation_consent_revoke_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.payment_initiation_consent_revoke ...' - end - # verify the required parameter 'payment_initiation_consent_revoke_request' is set - if @api_client.config.client_side_validation && payment_initiation_consent_revoke_request.nil? - fail ArgumentError, "Missing the required parameter 'payment_initiation_consent_revoke_request' when calling PlaidApi.payment_initiation_consent_revoke" - end - # resource path - local_var_path = '/payment_initiation/consent/revoke' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_initiation_consent_revoke_request) - - # return_type - return_type = opts[:debug_return_type] || 'PaymentInitiationConsentRevokeResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.payment_initiation_consent_revoke", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#payment_initiation_consent_revoke\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param payment_initiation_payment_create_request [PaymentInitiationPaymentCreateRequest] - # @param [Hash] opts the optional parameters - # @return [PaymentInitiationPaymentCreateResponse] - def payment_initiation_payment_create(payment_initiation_payment_create_request, opts = {}) - data, _status_code, _headers = payment_initiation_payment_create_with_http_info(payment_initiation_payment_create_request, opts) - data - end - - # 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. - # @param payment_initiation_payment_create_request [PaymentInitiationPaymentCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentInitiationPaymentCreateResponse, Integer, Hash)>] PaymentInitiationPaymentCreateResponse data, response status code and response headers - def payment_initiation_payment_create_with_http_info(payment_initiation_payment_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.payment_initiation_payment_create ...' - end - # verify the required parameter 'payment_initiation_payment_create_request' is set - if @api_client.config.client_side_validation && payment_initiation_payment_create_request.nil? - fail ArgumentError, "Missing the required parameter 'payment_initiation_payment_create_request' when calling PlaidApi.payment_initiation_payment_create" - end - # resource path - local_var_path = '/payment_initiation/payment/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_initiation_payment_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'PaymentInitiationPaymentCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.payment_initiation_payment_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#payment_initiation_payment_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param payment_initiation_payment_get_request [PaymentInitiationPaymentGetRequest] - # @param [Hash] opts the optional parameters - # @return [PaymentInitiationPaymentGetResponse] - def payment_initiation_payment_get(payment_initiation_payment_get_request, opts = {}) - data, _status_code, _headers = payment_initiation_payment_get_with_http_info(payment_initiation_payment_get_request, opts) - data - end - - # 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. - # @param payment_initiation_payment_get_request [PaymentInitiationPaymentGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentInitiationPaymentGetResponse, Integer, Hash)>] PaymentInitiationPaymentGetResponse data, response status code and response headers - def payment_initiation_payment_get_with_http_info(payment_initiation_payment_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.payment_initiation_payment_get ...' - end - # verify the required parameter 'payment_initiation_payment_get_request' is set - if @api_client.config.client_side_validation && payment_initiation_payment_get_request.nil? - fail ArgumentError, "Missing the required parameter 'payment_initiation_payment_get_request' when calling PlaidApi.payment_initiation_payment_get" - end - # resource path - local_var_path = '/payment_initiation/payment/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_initiation_payment_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'PaymentInitiationPaymentGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.payment_initiation_payment_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#payment_initiation_payment_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param payment_initiation_payment_list_request [PaymentInitiationPaymentListRequest] - # @param [Hash] opts the optional parameters - # @return [PaymentInitiationPaymentListResponse] - def payment_initiation_payment_list(payment_initiation_payment_list_request, opts = {}) - data, _status_code, _headers = payment_initiation_payment_list_with_http_info(payment_initiation_payment_list_request, opts) - data - end - - # 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. - # @param payment_initiation_payment_list_request [PaymentInitiationPaymentListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentInitiationPaymentListResponse, Integer, Hash)>] PaymentInitiationPaymentListResponse data, response status code and response headers - def payment_initiation_payment_list_with_http_info(payment_initiation_payment_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.payment_initiation_payment_list ...' - end - # verify the required parameter 'payment_initiation_payment_list_request' is set - if @api_client.config.client_side_validation && payment_initiation_payment_list_request.nil? - fail ArgumentError, "Missing the required parameter 'payment_initiation_payment_list_request' when calling PlaidApi.payment_initiation_payment_list" - end - # resource path - local_var_path = '/payment_initiation/payment/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_initiation_payment_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'PaymentInitiationPaymentListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.payment_initiation_payment_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#payment_initiation_payment_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param payment_initiation_payment_reverse_request [PaymentInitiationPaymentReverseRequest] - # @param [Hash] opts the optional parameters - # @return [PaymentInitiationPaymentReverseResponse] - def payment_initiation_payment_reverse(payment_initiation_payment_reverse_request, opts = {}) - data, _status_code, _headers = payment_initiation_payment_reverse_with_http_info(payment_initiation_payment_reverse_request, opts) - data - end - - # 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. - # @param payment_initiation_payment_reverse_request [PaymentInitiationPaymentReverseRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentInitiationPaymentReverseResponse, Integer, Hash)>] PaymentInitiationPaymentReverseResponse data, response status code and response headers - def payment_initiation_payment_reverse_with_http_info(payment_initiation_payment_reverse_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.payment_initiation_payment_reverse ...' - end - # verify the required parameter 'payment_initiation_payment_reverse_request' is set - if @api_client.config.client_side_validation && payment_initiation_payment_reverse_request.nil? - fail ArgumentError, "Missing the required parameter 'payment_initiation_payment_reverse_request' when calling PlaidApi.payment_initiation_payment_reverse" - end - # resource path - local_var_path = '/payment_initiation/payment/reverse' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_initiation_payment_reverse_request) - - # return_type - return_type = opts[:debug_return_type] || 'PaymentInitiationPaymentReverseResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.payment_initiation_payment_reverse", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#payment_initiation_payment_reverse\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`. - # @param payment_initiation_recipient_create_request [PaymentInitiationRecipientCreateRequest] - # @param [Hash] opts the optional parameters - # @return [PaymentInitiationRecipientCreateResponse] - def payment_initiation_recipient_create(payment_initiation_recipient_create_request, opts = {}) - data, _status_code, _headers = payment_initiation_recipient_create_with_http_info(payment_initiation_recipient_create_request, opts) - data - end - - # 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`. - # @param payment_initiation_recipient_create_request [PaymentInitiationRecipientCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentInitiationRecipientCreateResponse, Integer, Hash)>] PaymentInitiationRecipientCreateResponse data, response status code and response headers - def payment_initiation_recipient_create_with_http_info(payment_initiation_recipient_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.payment_initiation_recipient_create ...' - end - # verify the required parameter 'payment_initiation_recipient_create_request' is set - if @api_client.config.client_side_validation && payment_initiation_recipient_create_request.nil? - fail ArgumentError, "Missing the required parameter 'payment_initiation_recipient_create_request' when calling PlaidApi.payment_initiation_recipient_create" - end - # resource path - local_var_path = '/payment_initiation/recipient/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_initiation_recipient_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'PaymentInitiationRecipientCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.payment_initiation_recipient_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#payment_initiation_recipient_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get payment recipient - # Get details about a payment recipient you have previously created. - # @param payment_initiation_recipient_get_request [PaymentInitiationRecipientGetRequest] - # @param [Hash] opts the optional parameters - # @return [PaymentInitiationRecipientGetResponse] - def payment_initiation_recipient_get(payment_initiation_recipient_get_request, opts = {}) - data, _status_code, _headers = payment_initiation_recipient_get_with_http_info(payment_initiation_recipient_get_request, opts) - data - end - - # Get payment recipient - # Get details about a payment recipient you have previously created. - # @param payment_initiation_recipient_get_request [PaymentInitiationRecipientGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentInitiationRecipientGetResponse, Integer, Hash)>] PaymentInitiationRecipientGetResponse data, response status code and response headers - def payment_initiation_recipient_get_with_http_info(payment_initiation_recipient_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.payment_initiation_recipient_get ...' - end - # verify the required parameter 'payment_initiation_recipient_get_request' is set - if @api_client.config.client_side_validation && payment_initiation_recipient_get_request.nil? - fail ArgumentError, "Missing the required parameter 'payment_initiation_recipient_get_request' when calling PlaidApi.payment_initiation_recipient_get" - end - # resource path - local_var_path = '/payment_initiation/recipient/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_initiation_recipient_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'PaymentInitiationRecipientGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.payment_initiation_recipient_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#payment_initiation_recipient_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List payment recipients - # The `/payment_initiation/recipient/list` endpoint list the payment recipients that you have previously created. - # @param payment_initiation_recipient_list_request [PaymentInitiationRecipientListRequest] - # @param [Hash] opts the optional parameters - # @return [PaymentInitiationRecipientListResponse] - def payment_initiation_recipient_list(payment_initiation_recipient_list_request, opts = {}) - data, _status_code, _headers = payment_initiation_recipient_list_with_http_info(payment_initiation_recipient_list_request, opts) - data - end - - # List payment recipients - # The `/payment_initiation/recipient/list` endpoint list the payment recipients that you have previously created. - # @param payment_initiation_recipient_list_request [PaymentInitiationRecipientListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentInitiationRecipientListResponse, Integer, Hash)>] PaymentInitiationRecipientListResponse data, response status code and response headers - def payment_initiation_recipient_list_with_http_info(payment_initiation_recipient_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.payment_initiation_recipient_list ...' - end - # verify the required parameter 'payment_initiation_recipient_list_request' is set - if @api_client.config.client_side_validation && payment_initiation_recipient_list_request.nil? - fail ArgumentError, "Missing the required parameter 'payment_initiation_recipient_list_request' when calling PlaidApi.payment_initiation_recipient_list" - end - # resource path - local_var_path = '/payment_initiation/recipient/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_initiation_recipient_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'PaymentInitiationRecipientListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.payment_initiation_recipient_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#payment_initiation_recipient_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`. - # @param payment_profile_create_request [PaymentProfileCreateRequest] - # @param [Hash] opts the optional parameters - # @return [PaymentProfileCreateResponse] - def payment_profile_create(payment_profile_create_request, opts = {}) - data, _status_code, _headers = payment_profile_create_with_http_info(payment_profile_create_request, opts) - data - end - - # 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`. - # @param payment_profile_create_request [PaymentProfileCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentProfileCreateResponse, Integer, Hash)>] PaymentProfileCreateResponse data, response status code and response headers - def payment_profile_create_with_http_info(payment_profile_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.payment_profile_create ...' - end - # verify the required parameter 'payment_profile_create_request' is set - if @api_client.config.client_side_validation && payment_profile_create_request.nil? - fail ArgumentError, "Missing the required parameter 'payment_profile_create_request' when calling PlaidApi.payment_profile_create" - end - # resource path - local_var_path = '/payment_profile/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_profile_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'PaymentProfileCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.payment_profile_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#payment_profile_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get payment profile - # Use `/payment_profile/get` endpoint to get the status of a given Payment Profile. - # @param payment_profile_get_request [PaymentProfileGetRequest] - # @param [Hash] opts the optional parameters - # @return [PaymentProfileGetResponse] - def payment_profile_get(payment_profile_get_request, opts = {}) - data, _status_code, _headers = payment_profile_get_with_http_info(payment_profile_get_request, opts) - data - end - - # Get payment profile - # Use `/payment_profile/get` endpoint to get the status of a given Payment Profile. - # @param payment_profile_get_request [PaymentProfileGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentProfileGetResponse, Integer, Hash)>] PaymentProfileGetResponse data, response status code and response headers - def payment_profile_get_with_http_info(payment_profile_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.payment_profile_get ...' - end - # verify the required parameter 'payment_profile_get_request' is set - if @api_client.config.client_side_validation && payment_profile_get_request.nil? - fail ArgumentError, "Missing the required parameter 'payment_profile_get_request' when calling PlaidApi.payment_profile_get" - end - # resource path - local_var_path = '/payment_profile/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_profile_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'PaymentProfileGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.payment_profile_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#payment_profile_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param payment_profile_remove_request [PaymentProfileRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [PaymentProfileRemoveResponse] - def payment_profile_remove(payment_profile_remove_request, opts = {}) - data, _status_code, _headers = payment_profile_remove_with_http_info(payment_profile_remove_request, opts) - data - end - - # 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. - # @param payment_profile_remove_request [PaymentProfileRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentProfileRemoveResponse, Integer, Hash)>] PaymentProfileRemoveResponse data, response status code and response headers - def payment_profile_remove_with_http_info(payment_profile_remove_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.payment_profile_remove ...' - end - # verify the required parameter 'payment_profile_remove_request' is set - if @api_client.config.client_side_validation && payment_profile_remove_request.nil? - fail ArgumentError, "Missing the required parameter 'payment_profile_remove_request' when calling PlaidApi.payment_profile_remove" - end - # resource path - local_var_path = '/payment_profile/remove' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(payment_profile_remove_request) - - # return_type - return_type = opts[:debug_return_type] || 'PaymentProfileRemoveResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.payment_profile_remove", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#payment_profile_remove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param processor_account_get_request [ProcessorAccountGetRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorAccountGetResponse] - def processor_account_get(processor_account_get_request, opts = {}) - data, _status_code, _headers = processor_account_get_with_http_info(processor_account_get_request, opts) - data - end - - # 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. - # @param processor_account_get_request [ProcessorAccountGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorAccountGetResponse, Integer, Hash)>] ProcessorAccountGetResponse data, response status code and response headers - def processor_account_get_with_http_info(processor_account_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_account_get ...' - end - # verify the required parameter 'processor_account_get_request' is set - if @api_client.config.client_side_validation && processor_account_get_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_account_get_request' when calling PlaidApi.processor_account_get" - end - # resource path - local_var_path = '/processor/account/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_account_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorAccountGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_account_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_account_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Create Apex bank account token - # Used to create a token suitable for sending to Apex to enable Plaid-Apex integrations. - # @param processor_apex_processor_token_create_request [ProcessorApexProcessorTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorTokenCreateResponse] - def processor_apex_processor_token_create(processor_apex_processor_token_create_request, opts = {}) - data, _status_code, _headers = processor_apex_processor_token_create_with_http_info(processor_apex_processor_token_create_request, opts) - data - end - - # Create Apex bank account token - # Used to create a token suitable for sending to Apex to enable Plaid-Apex integrations. - # @param processor_apex_processor_token_create_request [ProcessorApexProcessorTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorTokenCreateResponse, Integer, Hash)>] ProcessorTokenCreateResponse data, response status code and response headers - def processor_apex_processor_token_create_with_http_info(processor_apex_processor_token_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_apex_processor_token_create ...' - end - # verify the required parameter 'processor_apex_processor_token_create_request' is set - if @api_client.config.client_side_validation && processor_apex_processor_token_create_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_apex_processor_token_create_request' when calling PlaidApi.processor_apex_processor_token_create" - end - # resource path - local_var_path = '/processor/apex/processor_token/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_apex_processor_token_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorTokenCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_apex_processor_token_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_apex_processor_token_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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). - # @param processor_auth_get_request [ProcessorAuthGetRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorAuthGetResponse] - def processor_auth_get(processor_auth_get_request, opts = {}) - data, _status_code, _headers = processor_auth_get_with_http_info(processor_auth_get_request, opts) - data - end - - # 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). - # @param processor_auth_get_request [ProcessorAuthGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorAuthGetResponse, Integer, Hash)>] ProcessorAuthGetResponse data, response status code and response headers - def processor_auth_get_with_http_info(processor_auth_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_auth_get ...' - end - # verify the required parameter 'processor_auth_get_request' is set - if @api_client.config.client_side_validation && processor_auth_get_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_auth_get_request' when calling PlaidApi.processor_auth_get" - end - # resource path - local_var_path = '/processor/auth/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_auth_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorAuthGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_auth_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_auth_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param processor_balance_get_request [ProcessorBalanceGetRequest] The `/processor/balance/get` endpoint returns the real-time balance for the account associated with a given `processor_token`. The current balance is the total amount of funds in the account. The available balance is the current balance less any outstanding holds or debits that have not yet posted to the account. Note that not all institutions calculate the available balance. In the event that available balance is unavailable from the institution, Plaid will return an available balance value of `null`. - # @param [Hash] opts the optional parameters - # @return [ProcessorBalanceGetResponse] - def processor_balance_get(processor_balance_get_request, opts = {}) - data, _status_code, _headers = processor_balance_get_with_http_info(processor_balance_get_request, opts) - data - end - - # 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. - # @param processor_balance_get_request [ProcessorBalanceGetRequest] The `/processor/balance/get` endpoint returns the real-time balance for the account associated with a given `processor_token`. The current balance is the total amount of funds in the account. The available balance is the current balance less any outstanding holds or debits that have not yet posted to the account. Note that not all institutions calculate the available balance. In the event that available balance is unavailable from the institution, Plaid will return an available balance value of `null`. - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorBalanceGetResponse, Integer, Hash)>] ProcessorBalanceGetResponse data, response status code and response headers - def processor_balance_get_with_http_info(processor_balance_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_balance_get ...' - end - # verify the required parameter 'processor_balance_get_request' is set - if @api_client.config.client_side_validation && processor_balance_get_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_balance_get_request' when calling PlaidApi.processor_balance_get" - end - # resource path - local_var_path = '/processor/balance/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_balance_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorBalanceGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_balance_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_balance_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Create a bank transfer as a processor - # Use the `/processor/bank_transfer/create` endpoint to initiate a new bank transfer as a processor - # @param processor_bank_transfer_create_request [ProcessorBankTransferCreateRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorBankTransferCreateResponse] - def processor_bank_transfer_create(processor_bank_transfer_create_request, opts = {}) - data, _status_code, _headers = processor_bank_transfer_create_with_http_info(processor_bank_transfer_create_request, opts) - data - end - - # Create a bank transfer as a processor - # Use the `/processor/bank_transfer/create` endpoint to initiate a new bank transfer as a processor - # @param processor_bank_transfer_create_request [ProcessorBankTransferCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorBankTransferCreateResponse, Integer, Hash)>] ProcessorBankTransferCreateResponse data, response status code and response headers - def processor_bank_transfer_create_with_http_info(processor_bank_transfer_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_bank_transfer_create ...' - end - # verify the required parameter 'processor_bank_transfer_create_request' is set - if @api_client.config.client_side_validation && processor_bank_transfer_create_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_bank_transfer_create_request' when calling PlaidApi.processor_bank_transfer_create" - end - # resource path - local_var_path = '/processor/bank_transfer/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_bank_transfer_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorBankTransferCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_bank_transfer_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_bank_transfer_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param processor_identity_get_request [ProcessorIdentityGetRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorIdentityGetResponse] - def processor_identity_get(processor_identity_get_request, opts = {}) - data, _status_code, _headers = processor_identity_get_with_http_info(processor_identity_get_request, opts) - data - end - - # 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. - # @param processor_identity_get_request [ProcessorIdentityGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorIdentityGetResponse, Integer, Hash)>] ProcessorIdentityGetResponse data, response status code and response headers - def processor_identity_get_with_http_info(processor_identity_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_identity_get ...' - end - # verify the required parameter 'processor_identity_get_request' is set - if @api_client.config.client_side_validation && processor_identity_get_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_identity_get_request' when calling PlaidApi.processor_identity_get" - end - # resource path - local_var_path = '/processor/identity/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_identity_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorIdentityGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_identity_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_identity_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param processor_identity_match_request [ProcessorIdentityMatchRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorIdentityMatchResponse] - def processor_identity_match(processor_identity_match_request, opts = {}) - data, _status_code, _headers = processor_identity_match_with_http_info(processor_identity_match_request, opts) - data - end - - # 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. - # @param processor_identity_match_request [ProcessorIdentityMatchRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorIdentityMatchResponse, Integer, Hash)>] ProcessorIdentityMatchResponse data, response status code and response headers - def processor_identity_match_with_http_info(processor_identity_match_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_identity_match ...' - end - # verify the required parameter 'processor_identity_match_request' is set - if @api_client.config.client_side_validation && processor_identity_match_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_identity_match_request' when calling PlaidApi.processor_identity_match" - end - # resource path - local_var_path = '/processor/identity/match' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_identity_match_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorIdentityMatchResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_identity_match", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_identity_match\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param processor_liabilities_get_request [ProcessorLiabilitiesGetRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorLiabilitiesGetResponse] - def processor_liabilities_get(processor_liabilities_get_request, opts = {}) - data, _status_code, _headers = processor_liabilities_get_with_http_info(processor_liabilities_get_request, opts) - data - end - - # 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. - # @param processor_liabilities_get_request [ProcessorLiabilitiesGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorLiabilitiesGetResponse, Integer, Hash)>] ProcessorLiabilitiesGetResponse data, response status code and response headers - def processor_liabilities_get_with_http_info(processor_liabilities_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_liabilities_get ...' - end - # verify the required parameter 'processor_liabilities_get_request' is set - if @api_client.config.client_side_validation && processor_liabilities_get_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_liabilities_get_request' when calling PlaidApi.processor_liabilities_get" - end - # resource path - local_var_path = '/processor/liabilities/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_liabilities_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorLiabilitiesGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_liabilities_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_liabilities_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param processor_signal_decision_report_request [ProcessorSignalDecisionReportRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorSignalDecisionReportResponse] - def processor_signal_decision_report(processor_signal_decision_report_request, opts = {}) - data, _status_code, _headers = processor_signal_decision_report_with_http_info(processor_signal_decision_report_request, opts) - data - end - - # 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. - # @param processor_signal_decision_report_request [ProcessorSignalDecisionReportRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorSignalDecisionReportResponse, Integer, Hash)>] ProcessorSignalDecisionReportResponse data, response status code and response headers - def processor_signal_decision_report_with_http_info(processor_signal_decision_report_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_signal_decision_report ...' - end - # verify the required parameter 'processor_signal_decision_report_request' is set - if @api_client.config.client_side_validation && processor_signal_decision_report_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_signal_decision_report_request' when calling PlaidApi.processor_signal_decision_report" - end - # resource path - local_var_path = '/processor/signal/decision/report' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_signal_decision_report_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorSignalDecisionReportResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_signal_decision_report", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_signal_decision_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param processor_signal_evaluate_request [ProcessorSignalEvaluateRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorSignalEvaluateResponse] - def processor_signal_evaluate(processor_signal_evaluate_request, opts = {}) - data, _status_code, _headers = processor_signal_evaluate_with_http_info(processor_signal_evaluate_request, opts) - data - end - - # 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. - # @param processor_signal_evaluate_request [ProcessorSignalEvaluateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorSignalEvaluateResponse, Integer, Hash)>] ProcessorSignalEvaluateResponse data, response status code and response headers - def processor_signal_evaluate_with_http_info(processor_signal_evaluate_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_signal_evaluate ...' - end - # verify the required parameter 'processor_signal_evaluate_request' is set - if @api_client.config.client_side_validation && processor_signal_evaluate_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_signal_evaluate_request' when calling PlaidApi.processor_signal_evaluate" - end - # resource path - local_var_path = '/processor/signal/evaluate' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_signal_evaluate_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorSignalEvaluateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_signal_evaluate", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_signal_evaluate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param processor_signal_prepare_request [ProcessorSignalPrepareRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorSignalPrepareResponse] - def processor_signal_prepare(processor_signal_prepare_request, opts = {}) - data, _status_code, _headers = processor_signal_prepare_with_http_info(processor_signal_prepare_request, opts) - data - end - - # 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. - # @param processor_signal_prepare_request [ProcessorSignalPrepareRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorSignalPrepareResponse, Integer, Hash)>] ProcessorSignalPrepareResponse data, response status code and response headers - def processor_signal_prepare_with_http_info(processor_signal_prepare_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_signal_prepare ...' - end - # verify the required parameter 'processor_signal_prepare_request' is set - if @api_client.config.client_side_validation && processor_signal_prepare_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_signal_prepare_request' when calling PlaidApi.processor_signal_prepare" - end - # resource path - local_var_path = '/processor/signal/prepare' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_signal_prepare_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorSignalPrepareResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_signal_prepare", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_signal_prepare\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param processor_signal_return_report_request [ProcessorSignalReturnReportRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorSignalReturnReportResponse] - def processor_signal_return_report(processor_signal_return_report_request, opts = {}) - data, _status_code, _headers = processor_signal_return_report_with_http_info(processor_signal_return_report_request, opts) - data - end - - # 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. - # @param processor_signal_return_report_request [ProcessorSignalReturnReportRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorSignalReturnReportResponse, Integer, Hash)>] ProcessorSignalReturnReportResponse data, response status code and response headers - def processor_signal_return_report_with_http_info(processor_signal_return_report_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_signal_return_report ...' - end - # verify the required parameter 'processor_signal_return_report_request' is set - if @api_client.config.client_side_validation && processor_signal_return_report_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_signal_return_report_request' when calling PlaidApi.processor_signal_return_report" - end - # resource path - local_var_path = '/processor/signal/return/report' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_signal_return_report_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorSignalReturnReportResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_signal_return_report", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_signal_return_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`. - # @param processor_stripe_bank_account_token_create_request [ProcessorStripeBankAccountTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorStripeBankAccountTokenCreateResponse] - def processor_stripe_bank_account_token_create(processor_stripe_bank_account_token_create_request, opts = {}) - data, _status_code, _headers = processor_stripe_bank_account_token_create_with_http_info(processor_stripe_bank_account_token_create_request, opts) - data - end - - # 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`. - # @param processor_stripe_bank_account_token_create_request [ProcessorStripeBankAccountTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorStripeBankAccountTokenCreateResponse, Integer, Hash)>] ProcessorStripeBankAccountTokenCreateResponse data, response status code and response headers - def processor_stripe_bank_account_token_create_with_http_info(processor_stripe_bank_account_token_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_stripe_bank_account_token_create ...' - end - # verify the required parameter 'processor_stripe_bank_account_token_create_request' is set - if @api_client.config.client_side_validation && processor_stripe_bank_account_token_create_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_stripe_bank_account_token_create_request' when calling PlaidApi.processor_stripe_bank_account_token_create" - end - # resource path - local_var_path = '/processor/stripe/bank_account_token/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_stripe_bank_account_token_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorStripeBankAccountTokenCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_stripe_bank_account_token_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_stripe_bank_account_token_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`. - # @param processor_token_create_request [ProcessorTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorTokenCreateResponse] - def processor_token_create(processor_token_create_request, opts = {}) - data, _status_code, _headers = processor_token_create_with_http_info(processor_token_create_request, opts) - data - end - - # 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`. - # @param processor_token_create_request [ProcessorTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorTokenCreateResponse, Integer, Hash)>] ProcessorTokenCreateResponse data, response status code and response headers - def processor_token_create_with_http_info(processor_token_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_token_create ...' - end - # verify the required parameter 'processor_token_create_request' is set - if @api_client.config.client_side_validation && processor_token_create_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_token_create_request' when calling PlaidApi.processor_token_create" - end - # resource path - local_var_path = '/processor/token/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_token_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorTokenCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_token_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_token_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param processor_token_permissions_get_request [ProcessorTokenPermissionsGetRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorTokenPermissionsGetResponse] - def processor_token_permissions_get(processor_token_permissions_get_request, opts = {}) - data, _status_code, _headers = processor_token_permissions_get_with_http_info(processor_token_permissions_get_request, opts) - data - end - - # 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. - # @param processor_token_permissions_get_request [ProcessorTokenPermissionsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorTokenPermissionsGetResponse, Integer, Hash)>] ProcessorTokenPermissionsGetResponse data, response status code and response headers - def processor_token_permissions_get_with_http_info(processor_token_permissions_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_token_permissions_get ...' - end - # verify the required parameter 'processor_token_permissions_get_request' is set - if @api_client.config.client_side_validation && processor_token_permissions_get_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_token_permissions_get_request' when calling PlaidApi.processor_token_permissions_get" - end - # resource path - local_var_path = '/processor/token/permissions/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_token_permissions_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorTokenPermissionsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_token_permissions_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_token_permissions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param processor_token_permissions_set_request [ProcessorTokenPermissionsSetRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorTokenPermissionsSetResponse] - def processor_token_permissions_set(processor_token_permissions_set_request, opts = {}) - data, _status_code, _headers = processor_token_permissions_set_with_http_info(processor_token_permissions_set_request, opts) - data - end - - # 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. - # @param processor_token_permissions_set_request [ProcessorTokenPermissionsSetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorTokenPermissionsSetResponse, Integer, Hash)>] ProcessorTokenPermissionsSetResponse data, response status code and response headers - def processor_token_permissions_set_with_http_info(processor_token_permissions_set_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_token_permissions_set ...' - end - # verify the required parameter 'processor_token_permissions_set_request' is set - if @api_client.config.client_side_validation && processor_token_permissions_set_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_token_permissions_set_request' when calling PlaidApi.processor_token_permissions_set" - end - # resource path - local_var_path = '/processor/token/permissions/set' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_token_permissions_set_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorTokenPermissionsSetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_token_permissions_set", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_token_permissions_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param processor_token_webhook_update_request [ProcessorTokenWebhookUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorTokenWebhookUpdateResponse] - def processor_token_webhook_update(processor_token_webhook_update_request, opts = {}) - data, _status_code, _headers = processor_token_webhook_update_with_http_info(processor_token_webhook_update_request, opts) - data - end - - # 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. - # @param processor_token_webhook_update_request [ProcessorTokenWebhookUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorTokenWebhookUpdateResponse, Integer, Hash)>] ProcessorTokenWebhookUpdateResponse data, response status code and response headers - def processor_token_webhook_update_with_http_info(processor_token_webhook_update_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_token_webhook_update ...' - end - # verify the required parameter 'processor_token_webhook_update_request' is set - if @api_client.config.client_side_validation && processor_token_webhook_update_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_token_webhook_update_request' when calling PlaidApi.processor_token_webhook_update" - end - # resource path - local_var_path = '/processor/token/webhook/update' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_token_webhook_update_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorTokenWebhookUpdateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_token_webhook_update", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_token_webhook_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param processor_transactions_get_request [ProcessorTransactionsGetRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorTransactionsGetResponse] - def processor_transactions_get(processor_transactions_get_request, opts = {}) - data, _status_code, _headers = processor_transactions_get_with_http_info(processor_transactions_get_request, opts) - data - end - - # 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. - # @param processor_transactions_get_request [ProcessorTransactionsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorTransactionsGetResponse, Integer, Hash)>] ProcessorTransactionsGetResponse data, response status code and response headers - def processor_transactions_get_with_http_info(processor_transactions_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_transactions_get ...' - end - # verify the required parameter 'processor_transactions_get_request' is set - if @api_client.config.client_side_validation && processor_transactions_get_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_transactions_get_request' when calling PlaidApi.processor_transactions_get" - end - # resource path - local_var_path = '/processor/transactions/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_transactions_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorTransactionsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_transactions_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_transactions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param processor_transactions_recurring_get_request [ProcessorTransactionsRecurringGetRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorTransactionsRecurringGetResponse] - def processor_transactions_recurring_get(processor_transactions_recurring_get_request, opts = {}) - data, _status_code, _headers = processor_transactions_recurring_get_with_http_info(processor_transactions_recurring_get_request, opts) - data - end - - # 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. - # @param processor_transactions_recurring_get_request [ProcessorTransactionsRecurringGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorTransactionsRecurringGetResponse, Integer, Hash)>] ProcessorTransactionsRecurringGetResponse data, response status code and response headers - def processor_transactions_recurring_get_with_http_info(processor_transactions_recurring_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_transactions_recurring_get ...' - end - # verify the required parameter 'processor_transactions_recurring_get_request' is set - if @api_client.config.client_side_validation && processor_transactions_recurring_get_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_transactions_recurring_get_request' when calling PlaidApi.processor_transactions_recurring_get" - end - # resource path - local_var_path = '/processor/transactions/recurring/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_transactions_recurring_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorTransactionsRecurringGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_transactions_recurring_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_transactions_recurring_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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 `/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. 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. - # @param processor_transactions_refresh_request [ProcessorTransactionsRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorTransactionsRefreshResponse] - def processor_transactions_refresh(processor_transactions_refresh_request, opts = {}) - data, _status_code, _headers = processor_transactions_refresh_with_http_info(processor_transactions_refresh_request, opts) - data - end - - # 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 `/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. 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. - # @param processor_transactions_refresh_request [ProcessorTransactionsRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorTransactionsRefreshResponse, Integer, Hash)>] ProcessorTransactionsRefreshResponse data, response status code and response headers - def processor_transactions_refresh_with_http_info(processor_transactions_refresh_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_transactions_refresh ...' - end - # verify the required parameter 'processor_transactions_refresh_request' is set - if @api_client.config.client_side_validation && processor_transactions_refresh_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_transactions_refresh_request' when calling PlaidApi.processor_transactions_refresh" - end - # resource path - local_var_path = '/processor/transactions/refresh' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_transactions_refresh_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorTransactionsRefreshResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_transactions_refresh", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_transactions_refresh\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param processor_transactions_sync_request [ProcessorTransactionsSyncRequest] - # @param [Hash] opts the optional parameters - # @return [ProcessorTransactionsSyncResponse] - def processor_transactions_sync(processor_transactions_sync_request, opts = {}) - data, _status_code, _headers = processor_transactions_sync_with_http_info(processor_transactions_sync_request, opts) - data - end - - # 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. - # @param processor_transactions_sync_request [ProcessorTransactionsSyncRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProcessorTransactionsSyncResponse, Integer, Hash)>] ProcessorTransactionsSyncResponse data, response status code and response headers - def processor_transactions_sync_with_http_info(processor_transactions_sync_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.processor_transactions_sync ...' - end - # verify the required parameter 'processor_transactions_sync_request' is set - if @api_client.config.client_side_validation && processor_transactions_sync_request.nil? - fail ArgumentError, "Missing the required parameter 'processor_transactions_sync_request' when calling PlaidApi.processor_transactions_sync" - end - # resource path - local_var_path = '/processor/transactions/sync' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_transactions_sync_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProcessorTransactionsSyncResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.processor_transactions_sync", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#processor_transactions_sync\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve a Profile - # Returns user permissioned profile data including identity and item access tokens. - # @param profile_get_request [ProfileGetRequest] - # @param [Hash] opts the optional parameters - # @return [ProfileGetResponse] - def profile_get(profile_get_request, opts = {}) - data, _status_code, _headers = profile_get_with_http_info(profile_get_request, opts) - data - end - - # Retrieve a Profile - # Returns user permissioned profile data including identity and item access tokens. - # @param profile_get_request [ProfileGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(ProfileGetResponse, Integer, Hash)>] ProfileGetResponse data, response status code and response headers - def profile_get_with_http_info(profile_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.profile_get ...' - end - # verify the required parameter 'profile_get_request' is set - if @api_client.config.client_side_validation && profile_get_request.nil? - fail ArgumentError, "Missing the required parameter 'profile_get_request' when calling PlaidApi.profile_get" - end - # resource path - local_var_path = '/profile/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'ProfileGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.profile_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#profile_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_bank_income_fire_webhook_request [SandboxBankIncomeFireWebhookRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxBankIncomeFireWebhookResponse] - def sandbox_bank_income_fire_webhook(sandbox_bank_income_fire_webhook_request, opts = {}) - data, _status_code, _headers = sandbox_bank_income_fire_webhook_with_http_info(sandbox_bank_income_fire_webhook_request, opts) - data - end - - # 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. - # @param sandbox_bank_income_fire_webhook_request [SandboxBankIncomeFireWebhookRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxBankIncomeFireWebhookResponse, Integer, Hash)>] SandboxBankIncomeFireWebhookResponse data, response status code and response headers - def sandbox_bank_income_fire_webhook_with_http_info(sandbox_bank_income_fire_webhook_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_bank_income_fire_webhook ...' - end - # verify the required parameter 'sandbox_bank_income_fire_webhook_request' is set - if @api_client.config.client_side_validation && sandbox_bank_income_fire_webhook_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_bank_income_fire_webhook_request' when calling PlaidApi.sandbox_bank_income_fire_webhook" - end - # resource path - local_var_path = '/sandbox/bank_income/fire_webhook' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_bank_income_fire_webhook_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxBankIncomeFireWebhookResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_bank_income_fire_webhook", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_bank_income_fire_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_bank_transfer_fire_webhook_request [SandboxBankTransferFireWebhookRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxBankTransferFireWebhookResponse] - def sandbox_bank_transfer_fire_webhook(sandbox_bank_transfer_fire_webhook_request, opts = {}) - data, _status_code, _headers = sandbox_bank_transfer_fire_webhook_with_http_info(sandbox_bank_transfer_fire_webhook_request, opts) - data - end - - # 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. - # @param sandbox_bank_transfer_fire_webhook_request [SandboxBankTransferFireWebhookRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxBankTransferFireWebhookResponse, Integer, Hash)>] SandboxBankTransferFireWebhookResponse data, response status code and response headers - def sandbox_bank_transfer_fire_webhook_with_http_info(sandbox_bank_transfer_fire_webhook_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_bank_transfer_fire_webhook ...' - end - # verify the required parameter 'sandbox_bank_transfer_fire_webhook_request' is set - if @api_client.config.client_side_validation && sandbox_bank_transfer_fire_webhook_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_bank_transfer_fire_webhook_request' when calling PlaidApi.sandbox_bank_transfer_fire_webhook" - end - # resource path - local_var_path = '/sandbox/bank_transfer/fire_webhook' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_bank_transfer_fire_webhook_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxBankTransferFireWebhookResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_bank_transfer_fire_webhook", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_bank_transfer_fire_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_bank_transfer_simulate_request [SandboxBankTransferSimulateRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxBankTransferSimulateResponse] - def sandbox_bank_transfer_simulate(sandbox_bank_transfer_simulate_request, opts = {}) - data, _status_code, _headers = sandbox_bank_transfer_simulate_with_http_info(sandbox_bank_transfer_simulate_request, opts) - data - end - - # 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. - # @param sandbox_bank_transfer_simulate_request [SandboxBankTransferSimulateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxBankTransferSimulateResponse, Integer, Hash)>] SandboxBankTransferSimulateResponse data, response status code and response headers - def sandbox_bank_transfer_simulate_with_http_info(sandbox_bank_transfer_simulate_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_bank_transfer_simulate ...' - end - # verify the required parameter 'sandbox_bank_transfer_simulate_request' is set - if @api_client.config.client_side_validation && sandbox_bank_transfer_simulate_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_bank_transfer_simulate_request' when calling PlaidApi.sandbox_bank_transfer_simulate" - end - # resource path - local_var_path = '/sandbox/bank_transfer/simulate' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_bank_transfer_simulate_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxBankTransferSimulateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_bank_transfer_simulate", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_bank_transfer_simulate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_income_fire_webhook_request [SandboxIncomeFireWebhookRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxIncomeFireWebhookResponse] - def sandbox_income_fire_webhook(sandbox_income_fire_webhook_request, opts = {}) - data, _status_code, _headers = sandbox_income_fire_webhook_with_http_info(sandbox_income_fire_webhook_request, opts) - data - end - - # 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. - # @param sandbox_income_fire_webhook_request [SandboxIncomeFireWebhookRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxIncomeFireWebhookResponse, Integer, Hash)>] SandboxIncomeFireWebhookResponse data, response status code and response headers - def sandbox_income_fire_webhook_with_http_info(sandbox_income_fire_webhook_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_income_fire_webhook ...' - end - # verify the required parameter 'sandbox_income_fire_webhook_request' is set - if @api_client.config.client_side_validation && sandbox_income_fire_webhook_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_income_fire_webhook_request' when calling PlaidApi.sandbox_income_fire_webhook" - end - # resource path - local_var_path = '/sandbox/income/fire_webhook' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_income_fire_webhook_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxIncomeFireWebhookResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_income_fire_webhook", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_income_fire_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`). - # @param sandbox_item_fire_webhook_request [SandboxItemFireWebhookRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxItemFireWebhookResponse] - def sandbox_item_fire_webhook(sandbox_item_fire_webhook_request, opts = {}) - data, _status_code, _headers = sandbox_item_fire_webhook_with_http_info(sandbox_item_fire_webhook_request, opts) - data - end - - # 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`). - # @param sandbox_item_fire_webhook_request [SandboxItemFireWebhookRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxItemFireWebhookResponse, Integer, Hash)>] SandboxItemFireWebhookResponse data, response status code and response headers - def sandbox_item_fire_webhook_with_http_info(sandbox_item_fire_webhook_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_item_fire_webhook ...' - end - # verify the required parameter 'sandbox_item_fire_webhook_request' is set - if @api_client.config.client_side_validation && sandbox_item_fire_webhook_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_item_fire_webhook_request' when calling PlaidApi.sandbox_item_fire_webhook" - end - # resource path - local_var_path = '/sandbox/item/fire_webhook' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_item_fire_webhook_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxItemFireWebhookResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_item_fire_webhook", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_item_fire_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_item_reset_login_request [SandboxItemResetLoginRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxItemResetLoginResponse] - def sandbox_item_reset_login(sandbox_item_reset_login_request, opts = {}) - data, _status_code, _headers = sandbox_item_reset_login_with_http_info(sandbox_item_reset_login_request, opts) - data - end - - # 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. - # @param sandbox_item_reset_login_request [SandboxItemResetLoginRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxItemResetLoginResponse, Integer, Hash)>] SandboxItemResetLoginResponse data, response status code and response headers - def sandbox_item_reset_login_with_http_info(sandbox_item_reset_login_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_item_reset_login ...' - end - # verify the required parameter 'sandbox_item_reset_login_request' is set - if @api_client.config.client_side_validation && sandbox_item_reset_login_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_item_reset_login_request' when calling PlaidApi.sandbox_item_reset_login" - end - # resource path - local_var_path = '/sandbox/item/reset_login' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_item_reset_login_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxItemResetLoginResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_item_reset_login", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_item_reset_login\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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#). - # @param sandbox_item_set_verification_status_request [SandboxItemSetVerificationStatusRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxItemSetVerificationStatusResponse] - def sandbox_item_set_verification_status(sandbox_item_set_verification_status_request, opts = {}) - data, _status_code, _headers = sandbox_item_set_verification_status_with_http_info(sandbox_item_set_verification_status_request, opts) - data - end - - # 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#). - # @param sandbox_item_set_verification_status_request [SandboxItemSetVerificationStatusRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxItemSetVerificationStatusResponse, Integer, Hash)>] SandboxItemSetVerificationStatusResponse data, response status code and response headers - def sandbox_item_set_verification_status_with_http_info(sandbox_item_set_verification_status_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_item_set_verification_status ...' - end - # verify the required parameter 'sandbox_item_set_verification_status_request' is set - if @api_client.config.client_side_validation && sandbox_item_set_verification_status_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_item_set_verification_status_request' when calling PlaidApi.sandbox_item_set_verification_status" - end - # resource path - local_var_path = '/sandbox/item/set_verification_status' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_item_set_verification_status_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxItemSetVerificationStatusResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_item_set_verification_status", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_item_set_verification_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Save the selected accounts when connecting to the Platypus Oauth institution - # Save the selected accounts when connecting to the Platypus Oauth institution - # @param sandbox_oauth_select_accounts_request [SandboxOauthSelectAccountsRequest] - # @param [Hash] opts the optional parameters - # @return [Hash] - def sandbox_oauth_select_accounts(sandbox_oauth_select_accounts_request, opts = {}) - data, _status_code, _headers = sandbox_oauth_select_accounts_with_http_info(sandbox_oauth_select_accounts_request, opts) - data - end - - # Save the selected accounts when connecting to the Platypus Oauth institution - # Save the selected accounts when connecting to the Platypus Oauth institution - # @param sandbox_oauth_select_accounts_request [SandboxOauthSelectAccountsRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(Hash, Integer, Hash)>] Hash data, response status code and response headers - def sandbox_oauth_select_accounts_with_http_info(sandbox_oauth_select_accounts_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_oauth_select_accounts ...' - end - # verify the required parameter 'sandbox_oauth_select_accounts_request' is set - if @api_client.config.client_side_validation && sandbox_oauth_select_accounts_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_oauth_select_accounts_request' when calling PlaidApi.sandbox_oauth_select_accounts" - end - # resource path - local_var_path = '/sandbox/oauth/select_accounts' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_oauth_select_accounts_request) - - # return_type - return_type = opts[:debug_return_type] || 'Hash' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_oauth_select_accounts", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_oauth_select_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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). - # @param sandbox_payment_profile_reset_login_request [SandboxPaymentProfileResetLoginRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxPaymentProfileResetLoginResponse] - def sandbox_payment_profile_reset_login(sandbox_payment_profile_reset_login_request, opts = {}) - data, _status_code, _headers = sandbox_payment_profile_reset_login_with_http_info(sandbox_payment_profile_reset_login_request, opts) - data - end - - # 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). - # @param sandbox_payment_profile_reset_login_request [SandboxPaymentProfileResetLoginRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxPaymentProfileResetLoginResponse, Integer, Hash)>] SandboxPaymentProfileResetLoginResponse data, response status code and response headers - def sandbox_payment_profile_reset_login_with_http_info(sandbox_payment_profile_reset_login_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_payment_profile_reset_login ...' - end - # verify the required parameter 'sandbox_payment_profile_reset_login_request' is set - if @api_client.config.client_side_validation && sandbox_payment_profile_reset_login_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_payment_profile_reset_login_request' when calling PlaidApi.sandbox_payment_profile_reset_login" - end - # resource path - local_var_path = '/sandbox/payment_profile/reset_login' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_payment_profile_reset_login_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxPaymentProfileResetLoginResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_payment_profile_reset_login", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_payment_profile_reset_login\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_processor_token_create_request [SandboxProcessorTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxProcessorTokenCreateResponse] - def sandbox_processor_token_create(sandbox_processor_token_create_request, opts = {}) - data, _status_code, _headers = sandbox_processor_token_create_with_http_info(sandbox_processor_token_create_request, opts) - data - end - - # 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. - # @param sandbox_processor_token_create_request [SandboxProcessorTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxProcessorTokenCreateResponse, Integer, Hash)>] SandboxProcessorTokenCreateResponse data, response status code and response headers - def sandbox_processor_token_create_with_http_info(sandbox_processor_token_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_processor_token_create ...' - end - # verify the required parameter 'sandbox_processor_token_create_request' is set - if @api_client.config.client_side_validation && sandbox_processor_token_create_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_processor_token_create_request' when calling PlaidApi.sandbox_processor_token_create" - end - # resource path - local_var_path = '/sandbox/processor_token/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_processor_token_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxProcessorTokenCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_processor_token_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_processor_token_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_public_token_create_request [SandboxPublicTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxPublicTokenCreateResponse] - def sandbox_public_token_create(sandbox_public_token_create_request, opts = {}) - data, _status_code, _headers = sandbox_public_token_create_with_http_info(sandbox_public_token_create_request, opts) - data - end - - # 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. - # @param sandbox_public_token_create_request [SandboxPublicTokenCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxPublicTokenCreateResponse, Integer, Hash)>] SandboxPublicTokenCreateResponse data, response status code and response headers - def sandbox_public_token_create_with_http_info(sandbox_public_token_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_public_token_create ...' - end - # verify the required parameter 'sandbox_public_token_create_request' is set - if @api_client.config.client_side_validation && sandbox_public_token_create_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_public_token_create_request' when calling PlaidApi.sandbox_public_token_create" - end - # resource path - local_var_path = '/sandbox/public_token/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_public_token_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxPublicTokenCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_public_token_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_public_token_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Manually fire a Transfer webhook - # Use the `/sandbox/transfer/fire_webhook` endpoint to manually trigger a `TRANSFER_EVENTS_UPDATE` webhook in the Sandbox environment. - # @param sandbox_transfer_fire_webhook_request [SandboxTransferFireWebhookRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxTransferFireWebhookResponse] - def sandbox_transfer_fire_webhook(sandbox_transfer_fire_webhook_request, opts = {}) - data, _status_code, _headers = sandbox_transfer_fire_webhook_with_http_info(sandbox_transfer_fire_webhook_request, opts) - data - end - - # Manually fire a Transfer webhook - # Use the `/sandbox/transfer/fire_webhook` endpoint to manually trigger a `TRANSFER_EVENTS_UPDATE` webhook in the Sandbox environment. - # @param sandbox_transfer_fire_webhook_request [SandboxTransferFireWebhookRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxTransferFireWebhookResponse, Integer, Hash)>] SandboxTransferFireWebhookResponse data, response status code and response headers - def sandbox_transfer_fire_webhook_with_http_info(sandbox_transfer_fire_webhook_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_transfer_fire_webhook ...' - end - # verify the required parameter 'sandbox_transfer_fire_webhook_request' is set - if @api_client.config.client_side_validation && sandbox_transfer_fire_webhook_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_transfer_fire_webhook_request' when calling PlaidApi.sandbox_transfer_fire_webhook" - end - # resource path - local_var_path = '/sandbox/transfer/fire_webhook' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_transfer_fire_webhook_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxTransferFireWebhookResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_transfer_fire_webhook", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_transfer_fire_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_transfer_ledger_deposit_simulate_request [SandboxTransferLedgerDepositSimulateRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxTransferLedgerDepositSimulateResponse] - def sandbox_transfer_ledger_deposit_simulate(sandbox_transfer_ledger_deposit_simulate_request, opts = {}) - data, _status_code, _headers = sandbox_transfer_ledger_deposit_simulate_with_http_info(sandbox_transfer_ledger_deposit_simulate_request, opts) - data - end - - # 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. - # @param sandbox_transfer_ledger_deposit_simulate_request [SandboxTransferLedgerDepositSimulateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxTransferLedgerDepositSimulateResponse, Integer, Hash)>] SandboxTransferLedgerDepositSimulateResponse data, response status code and response headers - def sandbox_transfer_ledger_deposit_simulate_with_http_info(sandbox_transfer_ledger_deposit_simulate_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_transfer_ledger_deposit_simulate ...' - end - # verify the required parameter 'sandbox_transfer_ledger_deposit_simulate_request' is set - if @api_client.config.client_side_validation && sandbox_transfer_ledger_deposit_simulate_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_transfer_ledger_deposit_simulate_request' when calling PlaidApi.sandbox_transfer_ledger_deposit_simulate" - end - # resource path - local_var_path = '/sandbox/transfer/ledger/deposit/simulate' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_transfer_ledger_deposit_simulate_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxTransferLedgerDepositSimulateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_transfer_ledger_deposit_simulate", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_transfer_ledger_deposit_simulate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_transfer_ledger_simulate_available_request [SandboxTransferLedgerSimulateAvailableRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxTransferLedgerSimulateAvailableResponse] - def sandbox_transfer_ledger_simulate_available(sandbox_transfer_ledger_simulate_available_request, opts = {}) - data, _status_code, _headers = sandbox_transfer_ledger_simulate_available_with_http_info(sandbox_transfer_ledger_simulate_available_request, opts) - data - end - - # 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. - # @param sandbox_transfer_ledger_simulate_available_request [SandboxTransferLedgerSimulateAvailableRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxTransferLedgerSimulateAvailableResponse, Integer, Hash)>] SandboxTransferLedgerSimulateAvailableResponse data, response status code and response headers - def sandbox_transfer_ledger_simulate_available_with_http_info(sandbox_transfer_ledger_simulate_available_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_transfer_ledger_simulate_available ...' - end - # verify the required parameter 'sandbox_transfer_ledger_simulate_available_request' is set - if @api_client.config.client_side_validation && sandbox_transfer_ledger_simulate_available_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_transfer_ledger_simulate_available_request' when calling PlaidApi.sandbox_transfer_ledger_simulate_available" - end - # resource path - local_var_path = '/sandbox/transfer/ledger/simulate_available' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_transfer_ledger_simulate_available_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxTransferLedgerSimulateAvailableResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_transfer_ledger_simulate_available", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_transfer_ledger_simulate_available\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_transfer_ledger_withdraw_simulate_request [SandboxTransferLedgerWithdrawSimulateRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxTransferLedgerWithdrawSimulateResponse] - def sandbox_transfer_ledger_withdraw_simulate(sandbox_transfer_ledger_withdraw_simulate_request, opts = {}) - data, _status_code, _headers = sandbox_transfer_ledger_withdraw_simulate_with_http_info(sandbox_transfer_ledger_withdraw_simulate_request, opts) - data - end - - # 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. - # @param sandbox_transfer_ledger_withdraw_simulate_request [SandboxTransferLedgerWithdrawSimulateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxTransferLedgerWithdrawSimulateResponse, Integer, Hash)>] SandboxTransferLedgerWithdrawSimulateResponse data, response status code and response headers - def sandbox_transfer_ledger_withdraw_simulate_with_http_info(sandbox_transfer_ledger_withdraw_simulate_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_transfer_ledger_withdraw_simulate ...' - end - # verify the required parameter 'sandbox_transfer_ledger_withdraw_simulate_request' is set - if @api_client.config.client_side_validation && sandbox_transfer_ledger_withdraw_simulate_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_transfer_ledger_withdraw_simulate_request' when calling PlaidApi.sandbox_transfer_ledger_withdraw_simulate" - end - # resource path - local_var_path = '/sandbox/transfer/ledger/withdraw/simulate' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_transfer_ledger_withdraw_simulate_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxTransferLedgerWithdrawSimulateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_transfer_ledger_withdraw_simulate", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_transfer_ledger_withdraw_simulate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_transfer_refund_simulate_request [SandboxTransferRefundSimulateRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxTransferRefundSimulateResponse] - def sandbox_transfer_refund_simulate(sandbox_transfer_refund_simulate_request, opts = {}) - data, _status_code, _headers = sandbox_transfer_refund_simulate_with_http_info(sandbox_transfer_refund_simulate_request, opts) - data - end - - # 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. - # @param sandbox_transfer_refund_simulate_request [SandboxTransferRefundSimulateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxTransferRefundSimulateResponse, Integer, Hash)>] SandboxTransferRefundSimulateResponse data, response status code and response headers - def sandbox_transfer_refund_simulate_with_http_info(sandbox_transfer_refund_simulate_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_transfer_refund_simulate ...' - end - # verify the required parameter 'sandbox_transfer_refund_simulate_request' is set - if @api_client.config.client_side_validation && sandbox_transfer_refund_simulate_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_transfer_refund_simulate_request' when calling PlaidApi.sandbox_transfer_refund_simulate" - end - # resource path - local_var_path = '/sandbox/transfer/refund/simulate' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_transfer_refund_simulate_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxTransferRefundSimulateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_transfer_refund_simulate", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_transfer_refund_simulate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_transfer_repayment_simulate_request [SandboxTransferRepaymentSimulateRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxTransferRepaymentSimulateResponse] - def sandbox_transfer_repayment_simulate(sandbox_transfer_repayment_simulate_request, opts = {}) - data, _status_code, _headers = sandbox_transfer_repayment_simulate_with_http_info(sandbox_transfer_repayment_simulate_request, opts) - data - end - - # 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. - # @param sandbox_transfer_repayment_simulate_request [SandboxTransferRepaymentSimulateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxTransferRepaymentSimulateResponse, Integer, Hash)>] SandboxTransferRepaymentSimulateResponse data, response status code and response headers - def sandbox_transfer_repayment_simulate_with_http_info(sandbox_transfer_repayment_simulate_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_transfer_repayment_simulate ...' - end - # verify the required parameter 'sandbox_transfer_repayment_simulate_request' is set - if @api_client.config.client_side_validation && sandbox_transfer_repayment_simulate_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_transfer_repayment_simulate_request' when calling PlaidApi.sandbox_transfer_repayment_simulate" - end - # resource path - local_var_path = '/sandbox/transfer/repayment/simulate' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_transfer_repayment_simulate_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxTransferRepaymentSimulateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_transfer_repayment_simulate", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_transfer_repayment_simulate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_transfer_simulate_request [SandboxTransferSimulateRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxTransferSimulateResponse] - def sandbox_transfer_simulate(sandbox_transfer_simulate_request, opts = {}) - data, _status_code, _headers = sandbox_transfer_simulate_with_http_info(sandbox_transfer_simulate_request, opts) - data - end - - # 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. - # @param sandbox_transfer_simulate_request [SandboxTransferSimulateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxTransferSimulateResponse, Integer, Hash)>] SandboxTransferSimulateResponse data, response status code and response headers - def sandbox_transfer_simulate_with_http_info(sandbox_transfer_simulate_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_transfer_simulate ...' - end - # verify the required parameter 'sandbox_transfer_simulate_request' is set - if @api_client.config.client_side_validation && sandbox_transfer_simulate_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_transfer_simulate_request' when calling PlaidApi.sandbox_transfer_simulate" - end - # resource path - local_var_path = '/sandbox/transfer/simulate' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_transfer_simulate_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxTransferSimulateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_transfer_simulate", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_transfer_simulate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`. - # @param sandbox_transfer_sweep_simulate_request [SandboxTransferSweepSimulateRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxTransferSweepSimulateResponse] - def sandbox_transfer_sweep_simulate(sandbox_transfer_sweep_simulate_request, opts = {}) - data, _status_code, _headers = sandbox_transfer_sweep_simulate_with_http_info(sandbox_transfer_sweep_simulate_request, opts) - data - end - - # 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`. - # @param sandbox_transfer_sweep_simulate_request [SandboxTransferSweepSimulateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxTransferSweepSimulateResponse, Integer, Hash)>] SandboxTransferSweepSimulateResponse data, response status code and response headers - def sandbox_transfer_sweep_simulate_with_http_info(sandbox_transfer_sweep_simulate_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_transfer_sweep_simulate ...' - end - # verify the required parameter 'sandbox_transfer_sweep_simulate_request' is set - if @api_client.config.client_side_validation && sandbox_transfer_sweep_simulate_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_transfer_sweep_simulate_request' when calling PlaidApi.sandbox_transfer_sweep_simulate" - end - # resource path - local_var_path = '/sandbox/transfer/sweep/simulate' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_transfer_sweep_simulate_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxTransferSweepSimulateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_transfer_sweep_simulate", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_transfer_sweep_simulate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_transfer_test_clock_advance_request [SandboxTransferTestClockAdvanceRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxTransferTestClockAdvanceResponse] - def sandbox_transfer_test_clock_advance(sandbox_transfer_test_clock_advance_request, opts = {}) - data, _status_code, _headers = sandbox_transfer_test_clock_advance_with_http_info(sandbox_transfer_test_clock_advance_request, opts) - data - end - - # 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. - # @param sandbox_transfer_test_clock_advance_request [SandboxTransferTestClockAdvanceRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxTransferTestClockAdvanceResponse, Integer, Hash)>] SandboxTransferTestClockAdvanceResponse data, response status code and response headers - def sandbox_transfer_test_clock_advance_with_http_info(sandbox_transfer_test_clock_advance_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_transfer_test_clock_advance ...' - end - # verify the required parameter 'sandbox_transfer_test_clock_advance_request' is set - if @api_client.config.client_side_validation && sandbox_transfer_test_clock_advance_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_transfer_test_clock_advance_request' when calling PlaidApi.sandbox_transfer_test_clock_advance" - end - # resource path - local_var_path = '/sandbox/transfer/test_clock/advance' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_transfer_test_clock_advance_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxTransferTestClockAdvanceResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_transfer_test_clock_advance", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_transfer_test_clock_advance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_transfer_test_clock_create_request [SandboxTransferTestClockCreateRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxTransferTestClockCreateResponse] - def sandbox_transfer_test_clock_create(sandbox_transfer_test_clock_create_request, opts = {}) - data, _status_code, _headers = sandbox_transfer_test_clock_create_with_http_info(sandbox_transfer_test_clock_create_request, opts) - data - end - - # 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. - # @param sandbox_transfer_test_clock_create_request [SandboxTransferTestClockCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxTransferTestClockCreateResponse, Integer, Hash)>] SandboxTransferTestClockCreateResponse data, response status code and response headers - def sandbox_transfer_test_clock_create_with_http_info(sandbox_transfer_test_clock_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_transfer_test_clock_create ...' - end - # verify the required parameter 'sandbox_transfer_test_clock_create_request' is set - if @api_client.config.client_side_validation && sandbox_transfer_test_clock_create_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_transfer_test_clock_create_request' when calling PlaidApi.sandbox_transfer_test_clock_create" - end - # resource path - local_var_path = '/sandbox/transfer/test_clock/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_transfer_test_clock_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxTransferTestClockCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_transfer_test_clock_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_transfer_test_clock_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get a test clock - # Use the `/sandbox/transfer/test_clock/get` endpoint to get a `test_clock` in the Sandbox environment. - # @param sandbox_transfer_test_clock_get_request [SandboxTransferTestClockGetRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxTransferTestClockGetResponse] - def sandbox_transfer_test_clock_get(sandbox_transfer_test_clock_get_request, opts = {}) - data, _status_code, _headers = sandbox_transfer_test_clock_get_with_http_info(sandbox_transfer_test_clock_get_request, opts) - data - end - - # Get a test clock - # Use the `/sandbox/transfer/test_clock/get` endpoint to get a `test_clock` in the Sandbox environment. - # @param sandbox_transfer_test_clock_get_request [SandboxTransferTestClockGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxTransferTestClockGetResponse, Integer, Hash)>] SandboxTransferTestClockGetResponse data, response status code and response headers - def sandbox_transfer_test_clock_get_with_http_info(sandbox_transfer_test_clock_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_transfer_test_clock_get ...' - end - # verify the required parameter 'sandbox_transfer_test_clock_get_request' is set - if @api_client.config.client_side_validation && sandbox_transfer_test_clock_get_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_transfer_test_clock_get_request' when calling PlaidApi.sandbox_transfer_test_clock_get" - end - # resource path - local_var_path = '/sandbox/transfer/test_clock/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_transfer_test_clock_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxTransferTestClockGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_transfer_test_clock_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_transfer_test_clock_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param sandbox_transfer_test_clock_list_request [SandboxTransferTestClockListRequest] - # @param [Hash] opts the optional parameters - # @return [SandboxTransferTestClockListResponse] - def sandbox_transfer_test_clock_list(sandbox_transfer_test_clock_list_request, opts = {}) - data, _status_code, _headers = sandbox_transfer_test_clock_list_with_http_info(sandbox_transfer_test_clock_list_request, opts) - data - end - - # 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. - # @param sandbox_transfer_test_clock_list_request [SandboxTransferTestClockListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SandboxTransferTestClockListResponse, Integer, Hash)>] SandboxTransferTestClockListResponse data, response status code and response headers - def sandbox_transfer_test_clock_list_with_http_info(sandbox_transfer_test_clock_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.sandbox_transfer_test_clock_list ...' - end - # verify the required parameter 'sandbox_transfer_test_clock_list_request' is set - if @api_client.config.client_side_validation && sandbox_transfer_test_clock_list_request.nil? - fail ArgumentError, "Missing the required parameter 'sandbox_transfer_test_clock_list_request' when calling PlaidApi.sandbox_transfer_test_clock_list" - end - # resource path - local_var_path = '/sandbox/transfer/test_clock/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(sandbox_transfer_test_clock_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'SandboxTransferTestClockListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.sandbox_transfer_test_clock_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#sandbox_transfer_test_clock_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Report whether you initiated an ACH transaction - # After calling `/signal/evaluate`, call `/signal/decision/report` to report whether the transaction was initiated. - # @param signal_decision_report_request [SignalDecisionReportRequest] - # @param [Hash] opts the optional parameters - # @return [SignalDecisionReportResponse] - def signal_decision_report(signal_decision_report_request, opts = {}) - data, _status_code, _headers = signal_decision_report_with_http_info(signal_decision_report_request, opts) - data - end - - # Report whether you initiated an ACH transaction - # After calling `/signal/evaluate`, call `/signal/decision/report` to report whether the transaction was initiated. - # @param signal_decision_report_request [SignalDecisionReportRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SignalDecisionReportResponse, Integer, Hash)>] SignalDecisionReportResponse data, response status code and response headers - def signal_decision_report_with_http_info(signal_decision_report_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.signal_decision_report ...' - end - # verify the required parameter 'signal_decision_report_request' is set - if @api_client.config.client_side_validation && signal_decision_report_request.nil? - fail ArgumentError, "Missing the required parameter 'signal_decision_report_request' when calling PlaidApi.signal_decision_report" - end - # resource path - local_var_path = '/signal/decision/report' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(signal_decision_report_request) - - # return_type - return_type = opts[:debug_return_type] || 'SignalDecisionReportResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.signal_decision_report", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#signal_decision_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param signal_evaluate_request [SignalEvaluateRequest] - # @param [Hash] opts the optional parameters - # @return [SignalEvaluateResponse] - def signal_evaluate(signal_evaluate_request, opts = {}) - data, _status_code, _headers = signal_evaluate_with_http_info(signal_evaluate_request, opts) - data - end - - # 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. - # @param signal_evaluate_request [SignalEvaluateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SignalEvaluateResponse, Integer, Hash)>] SignalEvaluateResponse data, response status code and response headers - def signal_evaluate_with_http_info(signal_evaluate_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.signal_evaluate ...' - end - # verify the required parameter 'signal_evaluate_request' is set - if @api_client.config.client_side_validation && signal_evaluate_request.nil? - fail ArgumentError, "Missing the required parameter 'signal_evaluate_request' when calling PlaidApi.signal_evaluate" - end - # resource path - local_var_path = '/signal/evaluate' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(signal_evaluate_request) - - # return_type - return_type = opts[:debug_return_type] || 'SignalEvaluateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.signal_evaluate", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#signal_evaluate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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 run on an Item that is already initialized with Signal, this endpoint will return a 200 response and will not modify the Item. - # @param signal_prepare_request [SignalPrepareRequest] - # @param [Hash] opts the optional parameters - # @return [SignalPrepareResponse] - def signal_prepare(signal_prepare_request, opts = {}) - data, _status_code, _headers = signal_prepare_with_http_info(signal_prepare_request, opts) - data - end - - # 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 run on an Item that is already initialized with Signal, this endpoint will return a 200 response and will not modify the Item. - # @param signal_prepare_request [SignalPrepareRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SignalPrepareResponse, Integer, Hash)>] SignalPrepareResponse data, response status code and response headers - def signal_prepare_with_http_info(signal_prepare_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.signal_prepare ...' - end - # verify the required parameter 'signal_prepare_request' is set - if @api_client.config.client_side_validation && signal_prepare_request.nil? - fail ArgumentError, "Missing the required parameter 'signal_prepare_request' when calling PlaidApi.signal_prepare" - end - # resource path - local_var_path = '/signal/prepare' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(signal_prepare_request) - - # return_type - return_type = opts[:debug_return_type] || 'SignalPrepareResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.signal_prepare", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#signal_prepare\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param signal_return_report_request [SignalReturnReportRequest] - # @param [Hash] opts the optional parameters - # @return [SignalReturnReportResponse] - def signal_return_report(signal_return_report_request, opts = {}) - data, _status_code, _headers = signal_return_report_with_http_info(signal_return_report_request, opts) - data - end - - # 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. - # @param signal_return_report_request [SignalReturnReportRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(SignalReturnReportResponse, Integer, Hash)>] SignalReturnReportResponse data, response status code and response headers - def signal_return_report_with_http_info(signal_return_report_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.signal_return_report ...' - end - # verify the required parameter 'signal_return_report_request' is set - if @api_client.config.client_side_validation && signal_return_report_request.nil? - fail ArgumentError, "Missing the required parameter 'signal_return_report_request' when calling PlaidApi.signal_return_report" - end - # resource path - local_var_path = '/signal/return/report' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(signal_return_report_request) - - # return_type - return_type = opts[:debug_return_type] || 'SignalReturnReportResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.signal_return_report", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#signal_return_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param statements_download_request [StatementsDownloadRequest] - # @param [Hash] opts the optional parameters - # @return [File] - def statements_download(statements_download_request, opts = {}) - data, _status_code, _headers = statements_download_with_http_info(statements_download_request, opts) - data - end - - # 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. - # @param statements_download_request [StatementsDownloadRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def statements_download_with_http_info(statements_download_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.statements_download ...' - end - # verify the required parameter 'statements_download_request' is set - if @api_client.config.client_side_validation && statements_download_request.nil? - fail ArgumentError, "Missing the required parameter 'statements_download_request' when calling PlaidApi.statements_download" - end - # resource path - local_var_path = '/statements/download' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(statements_download_request) - - # return_type - return_type = opts[:debug_return_type] || 'File' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.statements_download", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#statements_download\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param statements_list_request [StatementsListRequest] - # @param [Hash] opts the optional parameters - # @return [StatementsListResponse] - def statements_list(statements_list_request, opts = {}) - data, _status_code, _headers = statements_list_with_http_info(statements_list_request, opts) - data - end - - # 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. - # @param statements_list_request [StatementsListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(StatementsListResponse, Integer, Hash)>] StatementsListResponse data, response status code and response headers - def statements_list_with_http_info(statements_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.statements_list ...' - end - # verify the required parameter 'statements_list_request' is set - if @api_client.config.client_side_validation && statements_list_request.nil? - fail ArgumentError, "Missing the required parameter 'statements_list_request' when calling PlaidApi.statements_list" - end - # resource path - local_var_path = '/statements/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(statements_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'StatementsListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.statements_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#statements_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Refresh statements data. - # `/statements/refresh` initiates an on-demand extraction to fetch the statements for the provided dates. - # @param statements_refresh_request [StatementsRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [StatementsRefreshResponse] - def statements_refresh(statements_refresh_request, opts = {}) - data, _status_code, _headers = statements_refresh_with_http_info(statements_refresh_request, opts) - data - end - - # Refresh statements data. - # `/statements/refresh` initiates an on-demand extraction to fetch the statements for the provided dates. - # @param statements_refresh_request [StatementsRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(StatementsRefreshResponse, Integer, Hash)>] StatementsRefreshResponse data, response status code and response headers - def statements_refresh_with_http_info(statements_refresh_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.statements_refresh ...' - end - # verify the required parameter 'statements_refresh_request' is set - if @api_client.config.client_side_validation && statements_refresh_request.nil? - fail ArgumentError, "Missing the required parameter 'statements_refresh_request' when calling PlaidApi.statements_refresh" - end - # resource path - local_var_path = '/statements/refresh' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(statements_refresh_request) - - # return_type - return_type = opts[:debug_return_type] || 'StatementsRefreshResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.statements_refresh", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#statements_refresh\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transactions_enhance_get_request [TransactionsEnhanceGetRequest] - # @param [Hash] opts the optional parameters - # @return [TransactionsEnhanceGetResponse] - def transactions_enhance(transactions_enhance_get_request, opts = {}) - data, _status_code, _headers = transactions_enhance_with_http_info(transactions_enhance_get_request, opts) - data - end - - # 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. - # @param transactions_enhance_get_request [TransactionsEnhanceGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransactionsEnhanceGetResponse, Integer, Hash)>] TransactionsEnhanceGetResponse data, response status code and response headers - def transactions_enhance_with_http_info(transactions_enhance_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transactions_enhance ...' - end - # verify the required parameter 'transactions_enhance_get_request' is set - if @api_client.config.client_side_validation && transactions_enhance_get_request.nil? - fail ArgumentError, "Missing the required parameter 'transactions_enhance_get_request' when calling PlaidApi.transactions_enhance" - end - # resource path - local_var_path = '/beta/transactions/v1/enhance' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transactions_enhance_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransactionsEnhanceGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transactions_enhance", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transactions_enhance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transactions_enrich_request [TransactionsEnrichRequest] - # @param [Hash] opts the optional parameters - # @return [TransactionsEnrichResponse] - def transactions_enrich(transactions_enrich_request, opts = {}) - data, _status_code, _headers = transactions_enrich_with_http_info(transactions_enrich_request, opts) - data - end - - # 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. - # @param transactions_enrich_request [TransactionsEnrichRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransactionsEnrichResponse, Integer, Hash)>] TransactionsEnrichResponse data, response status code and response headers - def transactions_enrich_with_http_info(transactions_enrich_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transactions_enrich ...' - end - # verify the required parameter 'transactions_enrich_request' is set - if @api_client.config.client_side_validation && transactions_enrich_request.nil? - fail ArgumentError, "Missing the required parameter 'transactions_enrich_request' when calling PlaidApi.transactions_enrich" - end - # resource path - local_var_path = '/transactions/enrich' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transactions_enrich_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransactionsEnrichResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transactions_enrich", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transactions_enrich\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transactions_get_request [TransactionsGetRequest] - # @param [Hash] opts the optional parameters - # @return [TransactionsGetResponse] - def transactions_get(transactions_get_request, opts = {}) - data, _status_code, _headers = transactions_get_with_http_info(transactions_get_request, opts) - data - end - - # 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. - # @param transactions_get_request [TransactionsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransactionsGetResponse, Integer, Hash)>] TransactionsGetResponse data, response status code and response headers - def transactions_get_with_http_info(transactions_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transactions_get ...' - end - # verify the required parameter 'transactions_get_request' is set - if @api_client.config.client_side_validation && transactions_get_request.nil? - fail ArgumentError, "Missing the required parameter 'transactions_get_request' when calling PlaidApi.transactions_get" - end - # resource path - local_var_path = '/transactions/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transactions_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransactionsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transactions_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transactions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transactions_recurring_get_request [TransactionsRecurringGetRequest] - # @param [Hash] opts the optional parameters - # @return [TransactionsRecurringGetResponse] - def transactions_recurring_get(transactions_recurring_get_request, opts = {}) - data, _status_code, _headers = transactions_recurring_get_with_http_info(transactions_recurring_get_request, opts) - data - end - - # 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. - # @param transactions_recurring_get_request [TransactionsRecurringGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransactionsRecurringGetResponse, Integer, Hash)>] TransactionsRecurringGetResponse data, response status code and response headers - def transactions_recurring_get_with_http_info(transactions_recurring_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transactions_recurring_get ...' - end - # verify the required parameter 'transactions_recurring_get_request' is set - if @api_client.config.client_side_validation && transactions_recurring_get_request.nil? - fail ArgumentError, "Missing the required parameter 'transactions_recurring_get_request' when calling PlaidApi.transactions_recurring_get" - end - # resource path - local_var_path = '/transactions/recurring/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transactions_recurring_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransactionsRecurringGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transactions_recurring_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transactions_recurring_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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 one or more times per 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. 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 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. - # @param transactions_refresh_request [TransactionsRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [TransactionsRefreshResponse] - def transactions_refresh(transactions_refresh_request, opts = {}) - data, _status_code, _headers = transactions_refresh_with_http_info(transactions_refresh_request, opts) - data - end - - # 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 one or more times per 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. 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 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. - # @param transactions_refresh_request [TransactionsRefreshRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransactionsRefreshResponse, Integer, Hash)>] TransactionsRefreshResponse data, response status code and response headers - def transactions_refresh_with_http_info(transactions_refresh_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transactions_refresh ...' - end - # verify the required parameter 'transactions_refresh_request' is set - if @api_client.config.client_side_validation && transactions_refresh_request.nil? - fail ArgumentError, "Missing the required parameter 'transactions_refresh_request' when calling PlaidApi.transactions_refresh" - end - # resource path - local_var_path = '/transactions/refresh' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transactions_refresh_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransactionsRefreshResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transactions_refresh", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transactions_refresh\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transactions_rules_create_request [TransactionsRulesCreateRequest] - # @param [Hash] opts the optional parameters - # @return [TransactionsRulesCreateResponse] - def transactions_rules_create(transactions_rules_create_request, opts = {}) - data, _status_code, _headers = transactions_rules_create_with_http_info(transactions_rules_create_request, opts) - data - end - - # 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. - # @param transactions_rules_create_request [TransactionsRulesCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransactionsRulesCreateResponse, Integer, Hash)>] TransactionsRulesCreateResponse data, response status code and response headers - def transactions_rules_create_with_http_info(transactions_rules_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transactions_rules_create ...' - end - # verify the required parameter 'transactions_rules_create_request' is set - if @api_client.config.client_side_validation && transactions_rules_create_request.nil? - fail ArgumentError, "Missing the required parameter 'transactions_rules_create_request' when calling PlaidApi.transactions_rules_create" - end - # resource path - local_var_path = '/beta/transactions/rules/v1/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transactions_rules_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransactionsRulesCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transactions_rules_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transactions_rules_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transactions_rules_list_request [TransactionsRulesListRequest] - # @param [Hash] opts the optional parameters - # @return [TransactionsRulesListResponse] - def transactions_rules_list(transactions_rules_list_request, opts = {}) - data, _status_code, _headers = transactions_rules_list_with_http_info(transactions_rules_list_request, opts) - data - end - - # 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. - # @param transactions_rules_list_request [TransactionsRulesListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransactionsRulesListResponse, Integer, Hash)>] TransactionsRulesListResponse data, response status code and response headers - def transactions_rules_list_with_http_info(transactions_rules_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transactions_rules_list ...' - end - # verify the required parameter 'transactions_rules_list_request' is set - if @api_client.config.client_side_validation && transactions_rules_list_request.nil? - fail ArgumentError, "Missing the required parameter 'transactions_rules_list_request' when calling PlaidApi.transactions_rules_list" - end - # resource path - local_var_path = '/beta/transactions/rules/v1/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transactions_rules_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransactionsRulesListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transactions_rules_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transactions_rules_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Remove transaction rule - # The `/transactions/rules/v1/remove` endpoint is used to remove a transaction rule. - # @param transactions_rules_remove_request [TransactionsRulesRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [TransactionsRulesRemoveResponse] - def transactions_rules_remove(transactions_rules_remove_request, opts = {}) - data, _status_code, _headers = transactions_rules_remove_with_http_info(transactions_rules_remove_request, opts) - data - end - - # Remove transaction rule - # The `/transactions/rules/v1/remove` endpoint is used to remove a transaction rule. - # @param transactions_rules_remove_request [TransactionsRulesRemoveRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransactionsRulesRemoveResponse, Integer, Hash)>] TransactionsRulesRemoveResponse data, response status code and response headers - def transactions_rules_remove_with_http_info(transactions_rules_remove_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transactions_rules_remove ...' - end - # verify the required parameter 'transactions_rules_remove_request' is set - if @api_client.config.client_side_validation && transactions_rules_remove_request.nil? - fail ArgumentError, "Missing the required parameter 'transactions_rules_remove_request' when calling PlaidApi.transactions_rules_remove" - end - # resource path - local_var_path = '/beta/transactions/rules/v1/remove' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transactions_rules_remove_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransactionsRulesRemoveResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transactions_rules_remove", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transactions_rules_remove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transactions_sync_request [TransactionsSyncRequest] - # @param [Hash] opts the optional parameters - # @return [TransactionsSyncResponse] - def transactions_sync(transactions_sync_request, opts = {}) - data, _status_code, _headers = transactions_sync_with_http_info(transactions_sync_request, opts) - data - end - - # 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. - # @param transactions_sync_request [TransactionsSyncRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransactionsSyncResponse, Integer, Hash)>] TransactionsSyncResponse data, response status code and response headers - def transactions_sync_with_http_info(transactions_sync_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transactions_sync ...' - end - # verify the required parameter 'transactions_sync_request' is set - if @api_client.config.client_side_validation && transactions_sync_request.nil? - fail ArgumentError, "Missing the required parameter 'transactions_sync_request' when calling PlaidApi.transactions_sync" - end - # resource path - local_var_path = '/transactions/sync' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transactions_sync_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransactionsSyncResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transactions_sync", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transactions_sync\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transactions_user_insights_get_request [TransactionsUserInsightsGetRequest] - # @param [Hash] opts the optional parameters - # @return [TransactionsUserInsightsGetResponse] - def transactions_user_insights_get(transactions_user_insights_get_request, opts = {}) - data, _status_code, _headers = transactions_user_insights_get_with_http_info(transactions_user_insights_get_request, opts) - data - end - - # 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. - # @param transactions_user_insights_get_request [TransactionsUserInsightsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransactionsUserInsightsGetResponse, Integer, Hash)>] TransactionsUserInsightsGetResponse data, response status code and response headers - def transactions_user_insights_get_with_http_info(transactions_user_insights_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transactions_user_insights_get ...' - end - # verify the required parameter 'transactions_user_insights_get_request' is set - if @api_client.config.client_side_validation && transactions_user_insights_get_request.nil? - fail ArgumentError, "Missing the required parameter 'transactions_user_insights_get_request' when calling PlaidApi.transactions_user_insights_get" - end - # resource path - local_var_path = '/beta/transactions/user_insights/v1/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transactions_user_insights_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransactionsUserInsightsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transactions_user_insights_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transactions_user_insights_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_authorization_create_request [TransferAuthorizationCreateRequest] - # @param [Hash] opts the optional parameters - # @return [TransferAuthorizationCreateResponse] - def transfer_authorization_create(transfer_authorization_create_request, opts = {}) - data, _status_code, _headers = transfer_authorization_create_with_http_info(transfer_authorization_create_request, opts) - data - end - - # 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. - # @param transfer_authorization_create_request [TransferAuthorizationCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferAuthorizationCreateResponse, Integer, Hash)>] TransferAuthorizationCreateResponse data, response status code and response headers - def transfer_authorization_create_with_http_info(transfer_authorization_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_authorization_create ...' - end - # verify the required parameter 'transfer_authorization_create_request' is set - if @api_client.config.client_side_validation && transfer_authorization_create_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_authorization_create_request' when calling PlaidApi.transfer_authorization_create" - end - # resource path - local_var_path = '/transfer/authorization/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_authorization_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferAuthorizationCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_authorization_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_authorization_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve a balance held with Plaid - # Use the `/transfer/balance/get` endpoint to view a balance held with Plaid. - # @param transfer_balance_get_request [TransferBalanceGetRequest] - # @param [Hash] opts the optional parameters - # @return [TransferBalanceGetResponse] - def transfer_balance_get(transfer_balance_get_request, opts = {}) - data, _status_code, _headers = transfer_balance_get_with_http_info(transfer_balance_get_request, opts) - data - end - - # Retrieve a balance held with Plaid - # Use the `/transfer/balance/get` endpoint to view a balance held with Plaid. - # @param transfer_balance_get_request [TransferBalanceGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferBalanceGetResponse, Integer, Hash)>] TransferBalanceGetResponse data, response status code and response headers - def transfer_balance_get_with_http_info(transfer_balance_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_balance_get ...' - end - # verify the required parameter 'transfer_balance_get_request' is set - if @api_client.config.client_side_validation && transfer_balance_get_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_balance_get_request' when calling PlaidApi.transfer_balance_get" - end - # resource path - local_var_path = '/transfer/balance/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_balance_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferBalanceGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_balance_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_balance_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`. - # @param transfer_cancel_request [TransferCancelRequest] - # @param [Hash] opts the optional parameters - # @return [TransferCancelResponse] - def transfer_cancel(transfer_cancel_request, opts = {}) - data, _status_code, _headers = transfer_cancel_with_http_info(transfer_cancel_request, opts) - data - end - - # 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`. - # @param transfer_cancel_request [TransferCancelRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferCancelResponse, Integer, Hash)>] TransferCancelResponse data, response status code and response headers - def transfer_cancel_with_http_info(transfer_cancel_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_cancel ...' - end - # verify the required parameter 'transfer_cancel_request' is set - if @api_client.config.client_side_validation && transfer_cancel_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_cancel_request' when calling PlaidApi.transfer_cancel" - end - # resource path - local_var_path = '/transfer/cancel' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_cancel_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferCancelResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_cancel", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`. - # @param transfer_capabilities_get_request [TransferCapabilitiesGetRequest] - # @param [Hash] opts the optional parameters - # @return [TransferCapabilitiesGetResponse] - def transfer_capabilities_get(transfer_capabilities_get_request, opts = {}) - data, _status_code, _headers = transfer_capabilities_get_with_http_info(transfer_capabilities_get_request, opts) - data - end - - # 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`. - # @param transfer_capabilities_get_request [TransferCapabilitiesGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferCapabilitiesGetResponse, Integer, Hash)>] TransferCapabilitiesGetResponse data, response status code and response headers - def transfer_capabilities_get_with_http_info(transfer_capabilities_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_capabilities_get ...' - end - # verify the required parameter 'transfer_capabilities_get_request' is set - if @api_client.config.client_side_validation && transfer_capabilities_get_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_capabilities_get_request' when calling PlaidApi.transfer_capabilities_get" - end - # resource path - local_var_path = '/transfer/capabilities/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_capabilities_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferCapabilitiesGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_capabilities_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_capabilities_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get transfer product configuration - # Use the `/transfer/configuration/get` endpoint to view your transfer product configurations. - # @param transfer_configuration_get_request [TransferConfigurationGetRequest] - # @param [Hash] opts the optional parameters - # @return [TransferConfigurationGetResponse] - def transfer_configuration_get(transfer_configuration_get_request, opts = {}) - data, _status_code, _headers = transfer_configuration_get_with_http_info(transfer_configuration_get_request, opts) - data - end - - # Get transfer product configuration - # Use the `/transfer/configuration/get` endpoint to view your transfer product configurations. - # @param transfer_configuration_get_request [TransferConfigurationGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferConfigurationGetResponse, Integer, Hash)>] TransferConfigurationGetResponse data, response status code and response headers - def transfer_configuration_get_with_http_info(transfer_configuration_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_configuration_get ...' - end - # verify the required parameter 'transfer_configuration_get_request' is set - if @api_client.config.client_side_validation && transfer_configuration_get_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_configuration_get_request' when calling PlaidApi.transfer_configuration_get" - end - # resource path - local_var_path = '/transfer/configuration/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_configuration_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferConfigurationGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_configuration_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_configuration_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Create a transfer - # Use the `/transfer/create` endpoint to initiate a new transfer. - # @param transfer_create_request [TransferCreateRequest] - # @param [Hash] opts the optional parameters - # @return [TransferCreateResponse] - def transfer_create(transfer_create_request, opts = {}) - data, _status_code, _headers = transfer_create_with_http_info(transfer_create_request, opts) - data - end - - # Create a transfer - # Use the `/transfer/create` endpoint to initiate a new transfer. - # @param transfer_create_request [TransferCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferCreateResponse, Integer, Hash)>] TransferCreateResponse data, response status code and response headers - def transfer_create_with_http_info(transfer_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_create ...' - end - # verify the required parameter 'transfer_create_request' is set - if @api_client.config.client_side_validation && transfer_create_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_create_request' when calling PlaidApi.transfer_create" - end - # resource path - local_var_path = '/transfer/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_diligence_document_upload_request [TransferDiligenceDocumentUploadRequest] - # @param [Hash] opts the optional parameters - # @return [TransferDiligenceDocumentUploadResponse] - def transfer_diligence_document_upload(transfer_diligence_document_upload_request, opts = {}) - data, _status_code, _headers = transfer_diligence_document_upload_with_http_info(transfer_diligence_document_upload_request, opts) - data - end - - # 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. - # @param transfer_diligence_document_upload_request [TransferDiligenceDocumentUploadRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferDiligenceDocumentUploadResponse, Integer, Hash)>] TransferDiligenceDocumentUploadResponse data, response status code and response headers - def transfer_diligence_document_upload_with_http_info(transfer_diligence_document_upload_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_diligence_document_upload ...' - end - # verify the required parameter 'transfer_diligence_document_upload_request' is set - if @api_client.config.client_side_validation && transfer_diligence_document_upload_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_diligence_document_upload_request' when calling PlaidApi.transfer_diligence_document_upload" - end - # resource path - local_var_path = '/transfer/diligence/document/upload' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_diligence_document_upload_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferDiligenceDocumentUploadResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_diligence_document_upload", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_diligence_document_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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). - # @param transfer_diligence_submit_request [TransferDiligenceSubmitRequest] - # @param [Hash] opts the optional parameters - # @return [TransferDiligenceSubmitResponse] - def transfer_diligence_submit(transfer_diligence_submit_request, opts = {}) - data, _status_code, _headers = transfer_diligence_submit_with_http_info(transfer_diligence_submit_request, opts) - data - end - - # 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). - # @param transfer_diligence_submit_request [TransferDiligenceSubmitRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferDiligenceSubmitResponse, Integer, Hash)>] TransferDiligenceSubmitResponse data, response status code and response headers - def transfer_diligence_submit_with_http_info(transfer_diligence_submit_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_diligence_submit ...' - end - # verify the required parameter 'transfer_diligence_submit_request' is set - if @api_client.config.client_side_validation && transfer_diligence_submit_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_diligence_submit_request' when calling PlaidApi.transfer_diligence_submit" - end - # resource path - local_var_path = '/transfer/diligence/submit' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_diligence_submit_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferDiligenceSubmitResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_diligence_submit", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_diligence_submit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List transfer events - # Use the `/transfer/event/list` endpoint to get a list of transfer events based on specified filter criteria. - # @param transfer_event_list_request [TransferEventListRequest] - # @param [Hash] opts the optional parameters - # @return [TransferEventListResponse] - def transfer_event_list(transfer_event_list_request, opts = {}) - data, _status_code, _headers = transfer_event_list_with_http_info(transfer_event_list_request, opts) - data - end - - # List transfer events - # Use the `/transfer/event/list` endpoint to get a list of transfer events based on specified filter criteria. - # @param transfer_event_list_request [TransferEventListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferEventListResponse, Integer, Hash)>] TransferEventListResponse data, response status code and response headers - def transfer_event_list_with_http_info(transfer_event_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_event_list ...' - end - # verify the required parameter 'transfer_event_list_request' is set - if @api_client.config.client_side_validation && transfer_event_list_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_event_list_request' when calling PlaidApi.transfer_event_list" - end - # resource path - local_var_path = '/transfer/event/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_event_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferEventListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_event_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_event_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_event_sync_request [TransferEventSyncRequest] - # @param [Hash] opts the optional parameters - # @return [TransferEventSyncResponse] - def transfer_event_sync(transfer_event_sync_request, opts = {}) - data, _status_code, _headers = transfer_event_sync_with_http_info(transfer_event_sync_request, opts) - data - end - - # 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. - # @param transfer_event_sync_request [TransferEventSyncRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferEventSyncResponse, Integer, Hash)>] TransferEventSyncResponse data, response status code and response headers - def transfer_event_sync_with_http_info(transfer_event_sync_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_event_sync ...' - end - # verify the required parameter 'transfer_event_sync_request' is set - if @api_client.config.client_side_validation && transfer_event_sync_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_event_sync_request' when calling PlaidApi.transfer_event_sync" - end - # resource path - local_var_path = '/transfer/event/sync' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_event_sync_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferEventSyncResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_event_sync", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_event_sync\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve a transfer - # The `/transfer/get` endpoint fetches information about the transfer corresponding to the given `transfer_id`. - # @param transfer_get_request [TransferGetRequest] - # @param [Hash] opts the optional parameters - # @return [TransferGetResponse] - def transfer_get(transfer_get_request, opts = {}) - data, _status_code, _headers = transfer_get_with_http_info(transfer_get_request, opts) - data - end - - # Retrieve a transfer - # The `/transfer/get` endpoint fetches information about the transfer corresponding to the given `transfer_id`. - # @param transfer_get_request [TransferGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferGetResponse, Integer, Hash)>] TransferGetResponse data, response status code and response headers - def transfer_get_with_http_info(transfer_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_get ...' - end - # verify the required parameter 'transfer_get_request' is set - if @api_client.config.client_side_validation && transfer_get_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_get_request' when calling PlaidApi.transfer_get" - end - # resource path - local_var_path = '/transfer/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_intent_create_request [TransferIntentCreateRequest] - # @param [Hash] opts the optional parameters - # @return [TransferIntentCreateResponse] - def transfer_intent_create(transfer_intent_create_request, opts = {}) - data, _status_code, _headers = transfer_intent_create_with_http_info(transfer_intent_create_request, opts) - data - end - - # 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. - # @param transfer_intent_create_request [TransferIntentCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferIntentCreateResponse, Integer, Hash)>] TransferIntentCreateResponse data, response status code and response headers - def transfer_intent_create_with_http_info(transfer_intent_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_intent_create ...' - end - # verify the required parameter 'transfer_intent_create_request' is set - if @api_client.config.client_side_validation && transfer_intent_create_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_intent_create_request' when calling PlaidApi.transfer_intent_create" - end - # resource path - local_var_path = '/transfer/intent/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_intent_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferIntentCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_intent_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_intent_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve more information about a transfer intent - # Use the `/transfer/intent/get` endpoint to retrieve more information about a transfer intent. - # @param request_body [Hash] - # @param [Hash] opts the optional parameters - # @return [TransferIntentGetResponse] - def transfer_intent_get(request_body, opts = {}) - data, _status_code, _headers = transfer_intent_get_with_http_info(request_body, opts) - data - end - - # Retrieve more information about a transfer intent - # Use the `/transfer/intent/get` endpoint to retrieve more information about a transfer intent. - # @param request_body [Hash] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferIntentGetResponse, Integer, Hash)>] TransferIntentGetResponse data, response status code and response headers - def transfer_intent_get_with_http_info(request_body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_intent_get ...' - end - # verify the required parameter 'request_body' is set - if @api_client.config.client_side_validation && request_body.nil? - fail ArgumentError, "Missing the required parameter 'request_body' when calling PlaidApi.transfer_intent_get" - end - # resource path - local_var_path = '/transfer/intent/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body) - - # return_type - return_type = opts[:debug_return_type] || 'TransferIntentGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_intent_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_intent_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Deposit funds into a Plaid Ledger balance - # Use the `/transfer/ledger/deposit` endpoint to deposit funds into Plaid Ledger. - # @param transfer_ledger_deposit_request [TransferLedgerDepositRequest] - # @param [Hash] opts the optional parameters - # @return [TransferLedgerDepositResponse] - def transfer_ledger_deposit(transfer_ledger_deposit_request, opts = {}) - data, _status_code, _headers = transfer_ledger_deposit_with_http_info(transfer_ledger_deposit_request, opts) - data - end - - # Deposit funds into a Plaid Ledger balance - # Use the `/transfer/ledger/deposit` endpoint to deposit funds into Plaid Ledger. - # @param transfer_ledger_deposit_request [TransferLedgerDepositRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferLedgerDepositResponse, Integer, Hash)>] TransferLedgerDepositResponse data, response status code and response headers - def transfer_ledger_deposit_with_http_info(transfer_ledger_deposit_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_ledger_deposit ...' - end - # verify the required parameter 'transfer_ledger_deposit_request' is set - if @api_client.config.client_side_validation && transfer_ledger_deposit_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_ledger_deposit_request' when calling PlaidApi.transfer_ledger_deposit" - end - # resource path - local_var_path = '/transfer/ledger/deposit' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_ledger_deposit_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferLedgerDepositResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_ledger_deposit", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_ledger_deposit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_ledger_distribute_request [TransferLedgerDistributeRequest] - # @param [Hash] opts the optional parameters - # @return [TransferLedgerDistributeResponse] - def transfer_ledger_distribute(transfer_ledger_distribute_request, opts = {}) - data, _status_code, _headers = transfer_ledger_distribute_with_http_info(transfer_ledger_distribute_request, opts) - data - end - - # 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. - # @param transfer_ledger_distribute_request [TransferLedgerDistributeRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferLedgerDistributeResponse, Integer, Hash)>] TransferLedgerDistributeResponse data, response status code and response headers - def transfer_ledger_distribute_with_http_info(transfer_ledger_distribute_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_ledger_distribute ...' - end - # verify the required parameter 'transfer_ledger_distribute_request' is set - if @api_client.config.client_side_validation && transfer_ledger_distribute_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_ledger_distribute_request' when calling PlaidApi.transfer_ledger_distribute" - end - # resource path - local_var_path = '/transfer/ledger/distribute' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_ledger_distribute_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferLedgerDistributeResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_ledger_distribute", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_ledger_distribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve Plaid Ledger balance - # Use the `/transfer/ledger/get` endpoint to view a balance on the ledger held with Plaid. - # @param transfer_ledger_get_request [TransferLedgerGetRequest] - # @param [Hash] opts the optional parameters - # @return [TransferLedgerGetResponse] - def transfer_ledger_get(transfer_ledger_get_request, opts = {}) - data, _status_code, _headers = transfer_ledger_get_with_http_info(transfer_ledger_get_request, opts) - data - end - - # Retrieve Plaid Ledger balance - # Use the `/transfer/ledger/get` endpoint to view a balance on the ledger held with Plaid. - # @param transfer_ledger_get_request [TransferLedgerGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferLedgerGetResponse, Integer, Hash)>] TransferLedgerGetResponse data, response status code and response headers - def transfer_ledger_get_with_http_info(transfer_ledger_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_ledger_get ...' - end - # verify the required parameter 'transfer_ledger_get_request' is set - if @api_client.config.client_side_validation && transfer_ledger_get_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_ledger_get_request' when calling PlaidApi.transfer_ledger_get" - end - # resource path - local_var_path = '/transfer/ledger/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_ledger_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferLedgerGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_ledger_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_ledger_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Withdraw funds from a Plaid Ledger balance - # Use the `/transfer/ledger/withdraw` endpoint to withdraw funds from a Plaid Ledger balance. - # @param transfer_ledger_withdraw_request [TransferLedgerWithdrawRequest] - # @param [Hash] opts the optional parameters - # @return [TransferLedgerWithdrawResponse] - def transfer_ledger_withdraw(transfer_ledger_withdraw_request, opts = {}) - data, _status_code, _headers = transfer_ledger_withdraw_with_http_info(transfer_ledger_withdraw_request, opts) - data - end - - # Withdraw funds from a Plaid Ledger balance - # Use the `/transfer/ledger/withdraw` endpoint to withdraw funds from a Plaid Ledger balance. - # @param transfer_ledger_withdraw_request [TransferLedgerWithdrawRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferLedgerWithdrawResponse, Integer, Hash)>] TransferLedgerWithdrawResponse data, response status code and response headers - def transfer_ledger_withdraw_with_http_info(transfer_ledger_withdraw_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_ledger_withdraw ...' - end - # verify the required parameter 'transfer_ledger_withdraw_request' is set - if @api_client.config.client_side_validation && transfer_ledger_withdraw_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_ledger_withdraw_request' when calling PlaidApi.transfer_ledger_withdraw" - end - # resource path - local_var_path = '/transfer/ledger/withdraw' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_ledger_withdraw_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferLedgerWithdrawResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_ledger_withdraw", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_ledger_withdraw\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_list_request [TransferListRequest] - # @param [Hash] opts the optional parameters - # @return [TransferListResponse] - def transfer_list(transfer_list_request, opts = {}) - data, _status_code, _headers = transfer_list_with_http_info(transfer_list_request, opts) - data - end - - # 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. - # @param transfer_list_request [TransferListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferListResponse, Integer, Hash)>] TransferListResponse data, response status code and response headers - def transfer_list_with_http_info(transfer_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_list ...' - end - # verify the required parameter 'transfer_list_request' is set - if @api_client.config.client_side_validation && transfer_list_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_list_request' when calling PlaidApi.transfer_list" - end - # resource path - local_var_path = '/transfer/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get transfer product usage metrics - # Use the `/transfer/metrics/get` endpoint to view your transfer product usage metrics. - # @param transfer_metrics_get_request [TransferMetricsGetRequest] - # @param [Hash] opts the optional parameters - # @return [TransferMetricsGetResponse] - def transfer_metrics_get(transfer_metrics_get_request, opts = {}) - data, _status_code, _headers = transfer_metrics_get_with_http_info(transfer_metrics_get_request, opts) - data - end - - # Get transfer product usage metrics - # Use the `/transfer/metrics/get` endpoint to view your transfer product usage metrics. - # @param transfer_metrics_get_request [TransferMetricsGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferMetricsGetResponse, Integer, Hash)>] TransferMetricsGetResponse data, response status code and response headers - def transfer_metrics_get_with_http_info(transfer_metrics_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_metrics_get ...' - end - # verify the required parameter 'transfer_metrics_get_request' is set - if @api_client.config.client_side_validation && transfer_metrics_get_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_metrics_get_request' when calling PlaidApi.transfer_metrics_get" - end - # resource path - local_var_path = '/transfer/metrics/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_metrics_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferMetricsGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_metrics_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_metrics_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. 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. - # @param transfer_migrate_account_request [TransferMigrateAccountRequest] - # @param [Hash] opts the optional parameters - # @return [TransferMigrateAccountResponse] - def transfer_migrate_account(transfer_migrate_account_request, opts = {}) - data, _status_code, _headers = transfer_migrate_account_with_http_info(transfer_migrate_account_request, opts) - data - end - - # 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. 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. - # @param transfer_migrate_account_request [TransferMigrateAccountRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferMigrateAccountResponse, Integer, Hash)>] TransferMigrateAccountResponse data, response status code and response headers - def transfer_migrate_account_with_http_info(transfer_migrate_account_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_migrate_account ...' - end - # verify the required parameter 'transfer_migrate_account_request' is set - if @api_client.config.client_side_validation && transfer_migrate_account_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_migrate_account_request' when calling PlaidApi.transfer_migrate_account" - end - # resource path - local_var_path = '/transfer/migrate_account' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_migrate_account_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferMigrateAccountResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_migrate_account", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_migrate_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Create a new originator - # Use the `/transfer/originator/create` endpoint to create a new originator and return an `originator_client_id`. - # @param transfer_originator_create_request [TransferOriginatorCreateRequest] - # @param [Hash] opts the optional parameters - # @return [TransferOriginatorCreateResponse] - def transfer_originator_create(transfer_originator_create_request, opts = {}) - data, _status_code, _headers = transfer_originator_create_with_http_info(transfer_originator_create_request, opts) - data - end - - # Create a new originator - # Use the `/transfer/originator/create` endpoint to create a new originator and return an `originator_client_id`. - # @param transfer_originator_create_request [TransferOriginatorCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferOriginatorCreateResponse, Integer, Hash)>] TransferOriginatorCreateResponse data, response status code and response headers - def transfer_originator_create_with_http_info(transfer_originator_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_originator_create ...' - end - # verify the required parameter 'transfer_originator_create_request' is set - if @api_client.config.client_side_validation && transfer_originator_create_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_originator_create_request' when calling PlaidApi.transfer_originator_create" - end - # resource path - local_var_path = '/transfer/originator/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_originator_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferOriginatorCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_originator_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_originator_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_originator_funding_account_update_request [TransferOriginatorFundingAccountUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [TransferOriginatorFundingAccountUpdateResponse] - def transfer_originator_funding_account_update(transfer_originator_funding_account_update_request, opts = {}) - data, _status_code, _headers = transfer_originator_funding_account_update_with_http_info(transfer_originator_funding_account_update_request, opts) - data - end - - # 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. - # @param transfer_originator_funding_account_update_request [TransferOriginatorFundingAccountUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferOriginatorFundingAccountUpdateResponse, Integer, Hash)>] TransferOriginatorFundingAccountUpdateResponse data, response status code and response headers - def transfer_originator_funding_account_update_with_http_info(transfer_originator_funding_account_update_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_originator_funding_account_update ...' - end - # verify the required parameter 'transfer_originator_funding_account_update_request' is set - if @api_client.config.client_side_validation && transfer_originator_funding_account_update_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_originator_funding_account_update_request' when calling PlaidApi.transfer_originator_funding_account_update" - end - # resource path - local_var_path = '/transfer/originator/funding_account/update' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_originator_funding_account_update_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferOriginatorFundingAccountUpdateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_originator_funding_account_update", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_originator_funding_account_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_originator_get_request [TransferOriginatorGetRequest] - # @param [Hash] opts the optional parameters - # @return [TransferOriginatorGetResponse] - def transfer_originator_get(transfer_originator_get_request, opts = {}) - data, _status_code, _headers = transfer_originator_get_with_http_info(transfer_originator_get_request, opts) - data - end - - # 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. - # @param transfer_originator_get_request [TransferOriginatorGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferOriginatorGetResponse, Integer, Hash)>] TransferOriginatorGetResponse data, response status code and response headers - def transfer_originator_get_with_http_info(transfer_originator_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_originator_get ...' - end - # verify the required parameter 'transfer_originator_get_request' is set - if @api_client.config.client_side_validation && transfer_originator_get_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_originator_get_request' when calling PlaidApi.transfer_originator_get" - end - # resource path - local_var_path = '/transfer/originator/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json', 'examples']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_originator_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferOriginatorGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_originator_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_originator_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_originator_list_request [TransferOriginatorListRequest] - # @param [Hash] opts the optional parameters - # @return [TransferOriginatorListResponse] - def transfer_originator_list(transfer_originator_list_request, opts = {}) - data, _status_code, _headers = transfer_originator_list_with_http_info(transfer_originator_list_request, opts) - data - end - - # 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. - # @param transfer_originator_list_request [TransferOriginatorListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferOriginatorListResponse, Integer, Hash)>] TransferOriginatorListResponse data, response status code and response headers - def transfer_originator_list_with_http_info(transfer_originator_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_originator_list ...' - end - # verify the required parameter 'transfer_originator_list_request' is set - if @api_client.config.client_side_validation && transfer_originator_list_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_originator_list_request' when calling PlaidApi.transfer_originator_list" - end - # resource path - local_var_path = '/transfer/originator/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_originator_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferOriginatorListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_originator_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_originator_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_questionnaire_create_request [TransferQuestionnaireCreateRequest] - # @param [Hash] opts the optional parameters - # @return [TransferQuestionnaireCreateResponse] - def transfer_questionnaire_create(transfer_questionnaire_create_request, opts = {}) - data, _status_code, _headers = transfer_questionnaire_create_with_http_info(transfer_questionnaire_create_request, opts) - data - end - - # 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. - # @param transfer_questionnaire_create_request [TransferQuestionnaireCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferQuestionnaireCreateResponse, Integer, Hash)>] TransferQuestionnaireCreateResponse data, response status code and response headers - def transfer_questionnaire_create_with_http_info(transfer_questionnaire_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_questionnaire_create ...' - end - # verify the required parameter 'transfer_questionnaire_create_request' is set - if @api_client.config.client_side_validation && transfer_questionnaire_create_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_questionnaire_create_request' when calling PlaidApi.transfer_questionnaire_create" - end - # resource path - local_var_path = '/transfer/questionnaire/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_questionnaire_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferQuestionnaireCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_questionnaire_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_questionnaire_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_recurring_cancel_request [TransferRecurringCancelRequest] - # @param [Hash] opts the optional parameters - # @return [TransferRecurringCancelResponse] - def transfer_recurring_cancel(transfer_recurring_cancel_request, opts = {}) - data, _status_code, _headers = transfer_recurring_cancel_with_http_info(transfer_recurring_cancel_request, opts) - data - end - - # 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. - # @param transfer_recurring_cancel_request [TransferRecurringCancelRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferRecurringCancelResponse, Integer, Hash)>] TransferRecurringCancelResponse data, response status code and response headers - def transfer_recurring_cancel_with_http_info(transfer_recurring_cancel_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_recurring_cancel ...' - end - # verify the required parameter 'transfer_recurring_cancel_request' is set - if @api_client.config.client_side_validation && transfer_recurring_cancel_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_recurring_cancel_request' when calling PlaidApi.transfer_recurring_cancel" - end - # resource path - local_var_path = '/transfer/recurring/cancel' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_recurring_cancel_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferRecurringCancelResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_recurring_cancel", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_recurring_cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_recurring_create_request [TransferRecurringCreateRequest] - # @param [Hash] opts the optional parameters - # @return [TransferRecurringCreateResponse] - def transfer_recurring_create(transfer_recurring_create_request, opts = {}) - data, _status_code, _headers = transfer_recurring_create_with_http_info(transfer_recurring_create_request, opts) - data - end - - # 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. - # @param transfer_recurring_create_request [TransferRecurringCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferRecurringCreateResponse, Integer, Hash)>] TransferRecurringCreateResponse data, response status code and response headers - def transfer_recurring_create_with_http_info(transfer_recurring_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_recurring_create ...' - end - # verify the required parameter 'transfer_recurring_create_request' is set - if @api_client.config.client_side_validation && transfer_recurring_create_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_recurring_create_request' when calling PlaidApi.transfer_recurring_create" - end - # resource path - local_var_path = '/transfer/recurring/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_recurring_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferRecurringCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_recurring_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_recurring_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve a recurring transfer - # The `/transfer/recurring/get` fetches information about the recurring transfer corresponding to the given `recurring_transfer_id`. - # @param transfer_recurring_get_request [TransferRecurringGetRequest] - # @param [Hash] opts the optional parameters - # @return [TransferRecurringGetResponse] - def transfer_recurring_get(transfer_recurring_get_request, opts = {}) - data, _status_code, _headers = transfer_recurring_get_with_http_info(transfer_recurring_get_request, opts) - data - end - - # Retrieve a recurring transfer - # The `/transfer/recurring/get` fetches information about the recurring transfer corresponding to the given `recurring_transfer_id`. - # @param transfer_recurring_get_request [TransferRecurringGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferRecurringGetResponse, Integer, Hash)>] TransferRecurringGetResponse data, response status code and response headers - def transfer_recurring_get_with_http_info(transfer_recurring_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_recurring_get ...' - end - # verify the required parameter 'transfer_recurring_get_request' is set - if @api_client.config.client_side_validation && transfer_recurring_get_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_recurring_get_request' when calling PlaidApi.transfer_recurring_get" - end - # resource path - local_var_path = '/transfer/recurring/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_recurring_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferRecurringGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_recurring_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_recurring_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_recurring_list_request [TransferRecurringListRequest] - # @param [Hash] opts the optional parameters - # @return [TransferRecurringListResponse] - def transfer_recurring_list(transfer_recurring_list_request, opts = {}) - data, _status_code, _headers = transfer_recurring_list_with_http_info(transfer_recurring_list_request, opts) - data - end - - # 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. - # @param transfer_recurring_list_request [TransferRecurringListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferRecurringListResponse, Integer, Hash)>] TransferRecurringListResponse data, response status code and response headers - def transfer_recurring_list_with_http_info(transfer_recurring_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_recurring_list ...' - end - # verify the required parameter 'transfer_recurring_list_request' is set - if @api_client.config.client_side_validation && transfer_recurring_list_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_recurring_list_request' when calling PlaidApi.transfer_recurring_list" - end - # resource path - local_var_path = '/transfer/recurring/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_recurring_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferRecurringListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_recurring_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_recurring_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_refund_cancel_request [TransferRefundCancelRequest] - # @param [Hash] opts the optional parameters - # @return [TransferRefundCancelResponse] - def transfer_refund_cancel(transfer_refund_cancel_request, opts = {}) - data, _status_code, _headers = transfer_refund_cancel_with_http_info(transfer_refund_cancel_request, opts) - data - end - - # 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. - # @param transfer_refund_cancel_request [TransferRefundCancelRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferRefundCancelResponse, Integer, Hash)>] TransferRefundCancelResponse data, response status code and response headers - def transfer_refund_cancel_with_http_info(transfer_refund_cancel_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_refund_cancel ...' - end - # verify the required parameter 'transfer_refund_cancel_request' is set - if @api_client.config.client_side_validation && transfer_refund_cancel_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_refund_cancel_request' when calling PlaidApi.transfer_refund_cancel" - end - # resource path - local_var_path = '/transfer/refund/cancel' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_refund_cancel_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferRefundCancelResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_refund_cancel", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_refund_cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_refund_create_request [TransferRefundCreateRequest] - # @param [Hash] opts the optional parameters - # @return [TransferRefundCreateResponse] - def transfer_refund_create(transfer_refund_create_request, opts = {}) - data, _status_code, _headers = transfer_refund_create_with_http_info(transfer_refund_create_request, opts) - data - end - - # 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. - # @param transfer_refund_create_request [TransferRefundCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferRefundCreateResponse, Integer, Hash)>] TransferRefundCreateResponse data, response status code and response headers - def transfer_refund_create_with_http_info(transfer_refund_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_refund_create ...' - end - # verify the required parameter 'transfer_refund_create_request' is set - if @api_client.config.client_side_validation && transfer_refund_create_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_refund_create_request' when calling PlaidApi.transfer_refund_create" - end - # resource path - local_var_path = '/transfer/refund/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_refund_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferRefundCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_refund_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_refund_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve a refund - # The `/transfer/refund/get` endpoint fetches information about the refund corresponding to the given `refund_id`. - # @param transfer_refund_get_request [TransferRefundGetRequest] - # @param [Hash] opts the optional parameters - # @return [TransferRefundGetResponse] - def transfer_refund_get(transfer_refund_get_request, opts = {}) - data, _status_code, _headers = transfer_refund_get_with_http_info(transfer_refund_get_request, opts) - data - end - - # Retrieve a refund - # The `/transfer/refund/get` endpoint fetches information about the refund corresponding to the given `refund_id`. - # @param transfer_refund_get_request [TransferRefundGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferRefundGetResponse, Integer, Hash)>] TransferRefundGetResponse data, response status code and response headers - def transfer_refund_get_with_http_info(transfer_refund_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_refund_get ...' - end - # verify the required parameter 'transfer_refund_get_request' is set - if @api_client.config.client_side_validation && transfer_refund_get_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_refund_get_request' when calling PlaidApi.transfer_refund_get" - end - # resource path - local_var_path = '/transfer/refund/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_refund_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferRefundGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_refund_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_refund_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`. - # @param transfer_repayment_list_request [TransferRepaymentListRequest] - # @param [Hash] opts the optional parameters - # @return [TransferRepaymentListResponse] - def transfer_repayment_list(transfer_repayment_list_request, opts = {}) - data, _status_code, _headers = transfer_repayment_list_with_http_info(transfer_repayment_list_request, opts) - data - end - - # 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`. - # @param transfer_repayment_list_request [TransferRepaymentListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferRepaymentListResponse, Integer, Hash)>] TransferRepaymentListResponse data, response status code and response headers - def transfer_repayment_list_with_http_info(transfer_repayment_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_repayment_list ...' - end - # verify the required parameter 'transfer_repayment_list_request' is set - if @api_client.config.client_side_validation && transfer_repayment_list_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_repayment_list_request' when calling PlaidApi.transfer_repayment_list" - end - # resource path - local_var_path = '/transfer/repayment/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_repayment_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferRepaymentListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_repayment_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_repayment_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param transfer_repayment_return_list_request [TransferRepaymentReturnListRequest] - # @param [Hash] opts the optional parameters - # @return [TransferRepaymentReturnListResponse] - def transfer_repayment_return_list(transfer_repayment_return_list_request, opts = {}) - data, _status_code, _headers = transfer_repayment_return_list_with_http_info(transfer_repayment_return_list_request, opts) - data - end - - # 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. - # @param transfer_repayment_return_list_request [TransferRepaymentReturnListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferRepaymentReturnListResponse, Integer, Hash)>] TransferRepaymentReturnListResponse data, response status code and response headers - def transfer_repayment_return_list_with_http_info(transfer_repayment_return_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_repayment_return_list ...' - end - # verify the required parameter 'transfer_repayment_return_list_request' is set - if @api_client.config.client_side_validation && transfer_repayment_return_list_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_repayment_return_list_request' when calling PlaidApi.transfer_repayment_return_list" - end - # resource path - local_var_path = '/transfer/repayment/return/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_repayment_return_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferRepaymentReturnListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_repayment_return_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_repayment_return_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve a sweep - # The `/transfer/sweep/get` endpoint fetches a sweep corresponding to the given `sweep_id`. - # @param transfer_sweep_get_request [TransferSweepGetRequest] - # @param [Hash] opts the optional parameters - # @return [TransferSweepGetResponse] - def transfer_sweep_get(transfer_sweep_get_request, opts = {}) - data, _status_code, _headers = transfer_sweep_get_with_http_info(transfer_sweep_get_request, opts) - data - end - - # Retrieve a sweep - # The `/transfer/sweep/get` endpoint fetches a sweep corresponding to the given `sweep_id`. - # @param transfer_sweep_get_request [TransferSweepGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferSweepGetResponse, Integer, Hash)>] TransferSweepGetResponse data, response status code and response headers - def transfer_sweep_get_with_http_info(transfer_sweep_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_sweep_get ...' - end - # verify the required parameter 'transfer_sweep_get_request' is set - if @api_client.config.client_side_validation && transfer_sweep_get_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_sweep_get_request' when calling PlaidApi.transfer_sweep_get" - end - # resource path - local_var_path = '/transfer/sweep/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_sweep_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferSweepGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_sweep_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_sweep_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List sweeps - # The `/transfer/sweep/list` endpoint fetches sweeps matching the given filters. - # @param transfer_sweep_list_request [TransferSweepListRequest] - # @param [Hash] opts the optional parameters - # @return [TransferSweepListResponse] - def transfer_sweep_list(transfer_sweep_list_request, opts = {}) - data, _status_code, _headers = transfer_sweep_list_with_http_info(transfer_sweep_list_request, opts) - data - end - - # List sweeps - # The `/transfer/sweep/list` endpoint fetches sweeps matching the given filters. - # @param transfer_sweep_list_request [TransferSweepListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(TransferSweepListResponse, Integer, Hash)>] TransferSweepListResponse data, response status code and response headers - def transfer_sweep_list_with_http_info(transfer_sweep_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.transfer_sweep_list ...' - end - # verify the required parameter 'transfer_sweep_list_request' is set - if @api_client.config.client_side_validation && transfer_sweep_list_request.nil? - fail ArgumentError, "Missing the required parameter 'transfer_sweep_list_request' when calling PlaidApi.transfer_sweep_list" - end - # resource path - local_var_path = '/transfer/sweep/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_sweep_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'TransferSweepListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.transfer_sweep_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#transfer_sweep_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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`. - # @param user_create_request [UserCreateRequest] - # @param [Hash] opts the optional parameters - # @return [UserCreateResponse] - def user_create(user_create_request, opts = {}) - data, _status_code, _headers = user_create_with_http_info(user_create_request, opts) - data - end - - # 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`. - # @param user_create_request [UserCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(UserCreateResponse, Integer, Hash)>] UserCreateResponse data, response status code and response headers - def user_create_with_http_info(user_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.user_create ...' - end - # verify the required parameter 'user_create_request' is set - if @api_client.config.client_side_validation && user_create_request.nil? - fail ArgumentError, "Missing the required parameter 'user_create_request' when calling PlaidApi.user_create" - end - # resource path - local_var_path = '/user/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.user_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#user_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param user_update_request [UserUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [UserUpdateResponse] - def user_update(user_update_request, opts = {}) - data, _status_code, _headers = user_update_with_http_info(user_update_request, opts) - data - end - - # 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. - # @param user_update_request [UserUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(UserUpdateResponse, Integer, Hash)>] UserUpdateResponse data, response status code and response headers - def user_update_with_http_info(user_update_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.user_update ...' - end - # verify the required parameter 'user_update_request' is set - if @api_client.config.client_side_validation && user_update_request.nil? - fail ArgumentError, "Missing the required parameter 'user_update_request' when calling PlaidApi.user_update" - end - # resource path - local_var_path = '/user/update' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(user_update_request) - - # return_type - return_type = opts[:debug_return_type] || 'UserUpdateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.user_update", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#user_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Create an e-wallet - # Create an e-wallet. The response is the newly created e-wallet object. - # @param wallet_create_request [WalletCreateRequest] - # @param [Hash] opts the optional parameters - # @return [WalletCreateResponse] - def wallet_create(wallet_create_request, opts = {}) - data, _status_code, _headers = wallet_create_with_http_info(wallet_create_request, opts) - data - end - - # Create an e-wallet - # Create an e-wallet. The response is the newly created e-wallet object. - # @param wallet_create_request [WalletCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WalletCreateResponse, Integer, Hash)>] WalletCreateResponse data, response status code and response headers - def wallet_create_with_http_info(wallet_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.wallet_create ...' - end - # verify the required parameter 'wallet_create_request' is set - if @api_client.config.client_side_validation && wallet_create_request.nil? - fail ArgumentError, "Missing the required parameter 'wallet_create_request' when calling PlaidApi.wallet_create" - end - # resource path - local_var_path = '/wallet/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(wallet_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'WalletCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.wallet_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#wallet_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Fetch an e-wallet - # Fetch an e-wallet. The response includes the current balance. - # @param wallet_get_request [WalletGetRequest] - # @param [Hash] opts the optional parameters - # @return [WalletGetResponse] - def wallet_get(wallet_get_request, opts = {}) - data, _status_code, _headers = wallet_get_with_http_info(wallet_get_request, opts) - data - end - - # Fetch an e-wallet - # Fetch an e-wallet. The response includes the current balance. - # @param wallet_get_request [WalletGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WalletGetResponse, Integer, Hash)>] WalletGetResponse data, response status code and response headers - def wallet_get_with_http_info(wallet_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.wallet_get ...' - end - # verify the required parameter 'wallet_get_request' is set - if @api_client.config.client_side_validation && wallet_get_request.nil? - fail ArgumentError, "Missing the required parameter 'wallet_get_request' when calling PlaidApi.wallet_get" - end - # resource path - local_var_path = '/wallet/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(wallet_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'WalletGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.wallet_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#wallet_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Fetch a list of e-wallets - # This endpoint lists all e-wallets in descending order of creation. - # @param wallet_list_request [WalletListRequest] - # @param [Hash] opts the optional parameters - # @return [WalletListResponse] - def wallet_list(wallet_list_request, opts = {}) - data, _status_code, _headers = wallet_list_with_http_info(wallet_list_request, opts) - data - end - - # Fetch a list of e-wallets - # This endpoint lists all e-wallets in descending order of creation. - # @param wallet_list_request [WalletListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WalletListResponse, Integer, Hash)>] WalletListResponse data, response status code and response headers - def wallet_list_with_http_info(wallet_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.wallet_list ...' - end - # verify the required parameter 'wallet_list_request' is set - if @api_client.config.client_side_validation && wallet_list_request.nil? - fail ArgumentError, "Missing the required parameter 'wallet_list_request' when calling PlaidApi.wallet_list" - end - # resource path - local_var_path = '/wallet/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(wallet_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'WalletListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.wallet_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#wallet_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param wallet_transaction_execute_request [WalletTransactionExecuteRequest] - # @param [Hash] opts the optional parameters - # @return [WalletTransactionExecuteResponse] - def wallet_transaction_execute(wallet_transaction_execute_request, opts = {}) - data, _status_code, _headers = wallet_transaction_execute_with_http_info(wallet_transaction_execute_request, opts) - data - end - - # 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. - # @param wallet_transaction_execute_request [WalletTransactionExecuteRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WalletTransactionExecuteResponse, Integer, Hash)>] WalletTransactionExecuteResponse data, response status code and response headers - def wallet_transaction_execute_with_http_info(wallet_transaction_execute_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.wallet_transaction_execute ...' - end - # verify the required parameter 'wallet_transaction_execute_request' is set - if @api_client.config.client_side_validation && wallet_transaction_execute_request.nil? - fail ArgumentError, "Missing the required parameter 'wallet_transaction_execute_request' when calling PlaidApi.wallet_transaction_execute" - end - # resource path - local_var_path = '/wallet/transaction/execute' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(wallet_transaction_execute_request) - - # return_type - return_type = opts[:debug_return_type] || 'WalletTransactionExecuteResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.wallet_transaction_execute", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#wallet_transaction_execute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Fetch an e-wallet transaction - # Fetch a specific e-wallet transaction - # @param wallet_transaction_get_request [WalletTransactionGetRequest] - # @param [Hash] opts the optional parameters - # @return [WalletTransactionGetResponse] - def wallet_transaction_get(wallet_transaction_get_request, opts = {}) - data, _status_code, _headers = wallet_transaction_get_with_http_info(wallet_transaction_get_request, opts) - data - end - - # Fetch an e-wallet transaction - # Fetch a specific e-wallet transaction - # @param wallet_transaction_get_request [WalletTransactionGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WalletTransactionGetResponse, Integer, Hash)>] WalletTransactionGetResponse data, response status code and response headers - def wallet_transaction_get_with_http_info(wallet_transaction_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.wallet_transaction_get ...' - end - # verify the required parameter 'wallet_transaction_get_request' is set - if @api_client.config.client_side_validation && wallet_transaction_get_request.nil? - fail ArgumentError, "Missing the required parameter 'wallet_transaction_get_request' when calling PlaidApi.wallet_transaction_get" - end - # resource path - local_var_path = '/wallet/transaction/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(wallet_transaction_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'WalletTransactionGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.wallet_transaction_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#wallet_transaction_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param wallet_transaction_list_request [WalletTransactionListRequest] - # @param [Hash] opts the optional parameters - # @return [WalletTransactionListResponse] - def wallet_transaction_list(wallet_transaction_list_request, opts = {}) - data, _status_code, _headers = wallet_transaction_list_with_http_info(wallet_transaction_list_request, opts) - data - end - - # 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. - # @param wallet_transaction_list_request [WalletTransactionListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WalletTransactionListResponse, Integer, Hash)>] WalletTransactionListResponse data, response status code and response headers - def wallet_transaction_list_with_http_info(wallet_transaction_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.wallet_transaction_list ...' - end - # verify the required parameter 'wallet_transaction_list_request' is set - if @api_client.config.client_side_validation && wallet_transaction_list_request.nil? - fail ArgumentError, "Missing the required parameter 'wallet_transaction_list_request' when calling PlaidApi.wallet_transaction_list" - end - # resource path - local_var_path = '/wallet/transaction/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(wallet_transaction_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'WalletTransactionListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.wallet_transaction_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#wallet_transaction_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param watchlist_screening_entity_create_request [WatchlistScreeningEntityCreateRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningEntityCreateResponse] - def watchlist_screening_entity_create(watchlist_screening_entity_create_request, opts = {}) - data, _status_code, _headers = watchlist_screening_entity_create_with_http_info(watchlist_screening_entity_create_request, opts) - data - end - - # 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. - # @param watchlist_screening_entity_create_request [WatchlistScreeningEntityCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningEntityCreateResponse, Integer, Hash)>] WatchlistScreeningEntityCreateResponse data, response status code and response headers - def watchlist_screening_entity_create_with_http_info(watchlist_screening_entity_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_entity_create ...' - end - # verify the required parameter 'watchlist_screening_entity_create_request' is set - if @api_client.config.client_side_validation && watchlist_screening_entity_create_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_entity_create_request' when calling PlaidApi.watchlist_screening_entity_create" - end - # resource path - local_var_path = '/watchlist_screening/entity/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_entity_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningEntityCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_entity_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_entity_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get an entity screening - # Retrieve an entity watchlist screening. - # @param watchlist_screening_entity_get_request [WatchlistScreeningEntityGetRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningEntityGetResponse] - def watchlist_screening_entity_get(watchlist_screening_entity_get_request, opts = {}) - data, _status_code, _headers = watchlist_screening_entity_get_with_http_info(watchlist_screening_entity_get_request, opts) - data - end - - # Get an entity screening - # Retrieve an entity watchlist screening. - # @param watchlist_screening_entity_get_request [WatchlistScreeningEntityGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningEntityGetResponse, Integer, Hash)>] WatchlistScreeningEntityGetResponse data, response status code and response headers - def watchlist_screening_entity_get_with_http_info(watchlist_screening_entity_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_entity_get ...' - end - # verify the required parameter 'watchlist_screening_entity_get_request' is set - if @api_client.config.client_side_validation && watchlist_screening_entity_get_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_entity_get_request' when calling PlaidApi.watchlist_screening_entity_get" - end - # resource path - local_var_path = '/watchlist_screening/entity/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_entity_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningEntityGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_entity_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_entity_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param watchlist_screening_entity_history_list_request [WatchlistScreeningEntityHistoryListRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningEntityHistoryListResponse] - def watchlist_screening_entity_history_list(watchlist_screening_entity_history_list_request, opts = {}) - data, _status_code, _headers = watchlist_screening_entity_history_list_with_http_info(watchlist_screening_entity_history_list_request, opts) - data - end - - # 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. - # @param watchlist_screening_entity_history_list_request [WatchlistScreeningEntityHistoryListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningEntityHistoryListResponse, Integer, Hash)>] WatchlistScreeningEntityHistoryListResponse data, response status code and response headers - def watchlist_screening_entity_history_list_with_http_info(watchlist_screening_entity_history_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_entity_history_list ...' - end - # verify the required parameter 'watchlist_screening_entity_history_list_request' is set - if @api_client.config.client_side_validation && watchlist_screening_entity_history_list_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_entity_history_list_request' when calling PlaidApi.watchlist_screening_entity_history_list" - end - # resource path - local_var_path = '/watchlist_screening/entity/history/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_entity_history_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningEntityHistoryListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_entity_history_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_entity_history_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List hits for entity watchlist screenings - # List all hits for the entity watchlist screening. - # @param watchlist_screening_entity_hit_list_request [WatchlistScreeningEntityHitListRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningEntityHitListResponse] - def watchlist_screening_entity_hit_list(watchlist_screening_entity_hit_list_request, opts = {}) - data, _status_code, _headers = watchlist_screening_entity_hit_list_with_http_info(watchlist_screening_entity_hit_list_request, opts) - data - end - - # List hits for entity watchlist screenings - # List all hits for the entity watchlist screening. - # @param watchlist_screening_entity_hit_list_request [WatchlistScreeningEntityHitListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningEntityHitListResponse, Integer, Hash)>] WatchlistScreeningEntityHitListResponse data, response status code and response headers - def watchlist_screening_entity_hit_list_with_http_info(watchlist_screening_entity_hit_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_entity_hit_list ...' - end - # verify the required parameter 'watchlist_screening_entity_hit_list_request' is set - if @api_client.config.client_side_validation && watchlist_screening_entity_hit_list_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_entity_hit_list_request' when calling PlaidApi.watchlist_screening_entity_hit_list" - end - # resource path - local_var_path = '/watchlist_screening/entity/hit/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_entity_hit_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningEntityHitListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_entity_hit_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_entity_hit_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List entity watchlist screenings - # List all entity screenings. - # @param watchlist_screening_entity_list_request [WatchlistScreeningEntityListRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningEntityListResponse] - def watchlist_screening_entity_list(watchlist_screening_entity_list_request, opts = {}) - data, _status_code, _headers = watchlist_screening_entity_list_with_http_info(watchlist_screening_entity_list_request, opts) - data - end - - # List entity watchlist screenings - # List all entity screenings. - # @param watchlist_screening_entity_list_request [WatchlistScreeningEntityListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningEntityListResponse, Integer, Hash)>] WatchlistScreeningEntityListResponse data, response status code and response headers - def watchlist_screening_entity_list_with_http_info(watchlist_screening_entity_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_entity_list ...' - end - # verify the required parameter 'watchlist_screening_entity_list_request' is set - if @api_client.config.client_side_validation && watchlist_screening_entity_list_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_entity_list_request' when calling PlaidApi.watchlist_screening_entity_list" - end - # resource path - local_var_path = '/watchlist_screening/entity/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_entity_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningEntityListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_entity_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_entity_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get entity watchlist screening program - # Get an entity watchlist screening program - # @param watchlist_screening_entity_program_get_request [WatchlistScreeningEntityProgramGetRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningEntityProgramGetResponse] - def watchlist_screening_entity_program_get(watchlist_screening_entity_program_get_request, opts = {}) - data, _status_code, _headers = watchlist_screening_entity_program_get_with_http_info(watchlist_screening_entity_program_get_request, opts) - data - end - - # Get entity watchlist screening program - # Get an entity watchlist screening program - # @param watchlist_screening_entity_program_get_request [WatchlistScreeningEntityProgramGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningEntityProgramGetResponse, Integer, Hash)>] WatchlistScreeningEntityProgramGetResponse data, response status code and response headers - def watchlist_screening_entity_program_get_with_http_info(watchlist_screening_entity_program_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_entity_program_get ...' - end - # verify the required parameter 'watchlist_screening_entity_program_get_request' is set - if @api_client.config.client_side_validation && watchlist_screening_entity_program_get_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_entity_program_get_request' when calling PlaidApi.watchlist_screening_entity_program_get" - end - # resource path - local_var_path = '/watchlist_screening/entity/program/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_entity_program_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningEntityProgramGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_entity_program_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_entity_program_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List entity watchlist screening programs - # List all entity watchlist screening programs - # @param watchlist_screening_entity_program_list_request [WatchlistScreeningEntityProgramListRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningEntityProgramListResponse] - def watchlist_screening_entity_program_list(watchlist_screening_entity_program_list_request, opts = {}) - data, _status_code, _headers = watchlist_screening_entity_program_list_with_http_info(watchlist_screening_entity_program_list_request, opts) - data - end - - # List entity watchlist screening programs - # List all entity watchlist screening programs - # @param watchlist_screening_entity_program_list_request [WatchlistScreeningEntityProgramListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningEntityProgramListResponse, Integer, Hash)>] WatchlistScreeningEntityProgramListResponse data, response status code and response headers - def watchlist_screening_entity_program_list_with_http_info(watchlist_screening_entity_program_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_entity_program_list ...' - end - # verify the required parameter 'watchlist_screening_entity_program_list_request' is set - if @api_client.config.client_side_validation && watchlist_screening_entity_program_list_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_entity_program_list_request' when calling PlaidApi.watchlist_screening_entity_program_list" - end - # resource path - local_var_path = '/watchlist_screening/entity/program/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_entity_program_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningEntityProgramListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_entity_program_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_entity_program_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param watchlist_screening_entity_review_create_request [WatchlistScreeningEntityReviewCreateRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningEntityReviewCreateResponse] - def watchlist_screening_entity_review_create(watchlist_screening_entity_review_create_request, opts = {}) - data, _status_code, _headers = watchlist_screening_entity_review_create_with_http_info(watchlist_screening_entity_review_create_request, opts) - data - end - - # 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. - # @param watchlist_screening_entity_review_create_request [WatchlistScreeningEntityReviewCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningEntityReviewCreateResponse, Integer, Hash)>] WatchlistScreeningEntityReviewCreateResponse data, response status code and response headers - def watchlist_screening_entity_review_create_with_http_info(watchlist_screening_entity_review_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_entity_review_create ...' - end - # verify the required parameter 'watchlist_screening_entity_review_create_request' is set - if @api_client.config.client_side_validation && watchlist_screening_entity_review_create_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_entity_review_create_request' when calling PlaidApi.watchlist_screening_entity_review_create" - end - # resource path - local_var_path = '/watchlist_screening/entity/review/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_entity_review_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningEntityReviewCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_entity_review_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_entity_review_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param watchlist_screening_entity_review_list_request [WatchlistScreeningEntityReviewListRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningEntityReviewListResponse] - def watchlist_screening_entity_review_list(watchlist_screening_entity_review_list_request, opts = {}) - data, _status_code, _headers = watchlist_screening_entity_review_list_with_http_info(watchlist_screening_entity_review_list_request, opts) - data - end - - # 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. - # @param watchlist_screening_entity_review_list_request [WatchlistScreeningEntityReviewListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningEntityReviewListResponse, Integer, Hash)>] WatchlistScreeningEntityReviewListResponse data, response status code and response headers - def watchlist_screening_entity_review_list_with_http_info(watchlist_screening_entity_review_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_entity_review_list ...' - end - # verify the required parameter 'watchlist_screening_entity_review_list_request' is set - if @api_client.config.client_side_validation && watchlist_screening_entity_review_list_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_entity_review_list_request' when calling PlaidApi.watchlist_screening_entity_review_list" - end - # resource path - local_var_path = '/watchlist_screening/entity/review/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_entity_review_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningEntityReviewListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_entity_review_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_entity_review_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Update an entity screening - # Update an entity watchlist screening. - # @param watchlist_screening_entity_update_request [WatchlistScreeningEntityUpdateRequest] The entity screening was successfully updated. - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningEntityUpdateResponse] - def watchlist_screening_entity_update(watchlist_screening_entity_update_request, opts = {}) - data, _status_code, _headers = watchlist_screening_entity_update_with_http_info(watchlist_screening_entity_update_request, opts) - data - end - - # Update an entity screening - # Update an entity watchlist screening. - # @param watchlist_screening_entity_update_request [WatchlistScreeningEntityUpdateRequest] The entity screening was successfully updated. - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningEntityUpdateResponse, Integer, Hash)>] WatchlistScreeningEntityUpdateResponse data, response status code and response headers - def watchlist_screening_entity_update_with_http_info(watchlist_screening_entity_update_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_entity_update ...' - end - # verify the required parameter 'watchlist_screening_entity_update_request' is set - if @api_client.config.client_side_validation && watchlist_screening_entity_update_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_entity_update_request' when calling PlaidApi.watchlist_screening_entity_update" - end - # resource path - local_var_path = '/watchlist_screening/entity/update' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_entity_update_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningEntityUpdateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_entity_update", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_entity_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param watchlist_screening_individual_create_request [WatchlistScreeningIndividualCreateRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningIndividualCreateResponse] - def watchlist_screening_individual_create(watchlist_screening_individual_create_request, opts = {}) - data, _status_code, _headers = watchlist_screening_individual_create_with_http_info(watchlist_screening_individual_create_request, opts) - data - end - - # 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. - # @param watchlist_screening_individual_create_request [WatchlistScreeningIndividualCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningIndividualCreateResponse, Integer, Hash)>] WatchlistScreeningIndividualCreateResponse data, response status code and response headers - def watchlist_screening_individual_create_with_http_info(watchlist_screening_individual_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_individual_create ...' - end - # verify the required parameter 'watchlist_screening_individual_create_request' is set - if @api_client.config.client_side_validation && watchlist_screening_individual_create_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_individual_create_request' when calling PlaidApi.watchlist_screening_individual_create" - end - # resource path - local_var_path = '/watchlist_screening/individual/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_individual_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningIndividualCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_individual_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_individual_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve an individual watchlist screening - # Retrieve a previously created individual watchlist screening - # @param watchlist_screening_individual_get_request [WatchlistScreeningIndividualGetRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningIndividualGetResponse] - def watchlist_screening_individual_get(watchlist_screening_individual_get_request, opts = {}) - data, _status_code, _headers = watchlist_screening_individual_get_with_http_info(watchlist_screening_individual_get_request, opts) - data - end - - # Retrieve an individual watchlist screening - # Retrieve a previously created individual watchlist screening - # @param watchlist_screening_individual_get_request [WatchlistScreeningIndividualGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningIndividualGetResponse, Integer, Hash)>] WatchlistScreeningIndividualGetResponse data, response status code and response headers - def watchlist_screening_individual_get_with_http_info(watchlist_screening_individual_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_individual_get ...' - end - # verify the required parameter 'watchlist_screening_individual_get_request' is set - if @api_client.config.client_side_validation && watchlist_screening_individual_get_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_individual_get_request' when calling PlaidApi.watchlist_screening_individual_get" - end - # resource path - local_var_path = '/watchlist_screening/individual/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_individual_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningIndividualGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_individual_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_individual_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param watchlist_screening_individual_history_list_request [WatchlistScreeningIndividualHistoryListRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningIndividualHistoryListResponse] - def watchlist_screening_individual_history_list(watchlist_screening_individual_history_list_request, opts = {}) - data, _status_code, _headers = watchlist_screening_individual_history_list_with_http_info(watchlist_screening_individual_history_list_request, opts) - data - end - - # 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. - # @param watchlist_screening_individual_history_list_request [WatchlistScreeningIndividualHistoryListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningIndividualHistoryListResponse, Integer, Hash)>] WatchlistScreeningIndividualHistoryListResponse data, response status code and response headers - def watchlist_screening_individual_history_list_with_http_info(watchlist_screening_individual_history_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_individual_history_list ...' - end - # verify the required parameter 'watchlist_screening_individual_history_list_request' is set - if @api_client.config.client_side_validation && watchlist_screening_individual_history_list_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_individual_history_list_request' when calling PlaidApi.watchlist_screening_individual_history_list" - end - # resource path - local_var_path = '/watchlist_screening/individual/history/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_individual_history_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningIndividualHistoryListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_individual_history_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_individual_history_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List hits for individual watchlist screening - # List all hits found by Plaid for a particular individual watchlist screening. - # @param watchlist_screening_individual_hit_list_request [WatchlistScreeningIndividualHitListRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningIndividualHitListResponse] - def watchlist_screening_individual_hit_list(watchlist_screening_individual_hit_list_request, opts = {}) - data, _status_code, _headers = watchlist_screening_individual_hit_list_with_http_info(watchlist_screening_individual_hit_list_request, opts) - data - end - - # List hits for individual watchlist screening - # List all hits found by Plaid for a particular individual watchlist screening. - # @param watchlist_screening_individual_hit_list_request [WatchlistScreeningIndividualHitListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningIndividualHitListResponse, Integer, Hash)>] WatchlistScreeningIndividualHitListResponse data, response status code and response headers - def watchlist_screening_individual_hit_list_with_http_info(watchlist_screening_individual_hit_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_individual_hit_list ...' - end - # verify the required parameter 'watchlist_screening_individual_hit_list_request' is set - if @api_client.config.client_side_validation && watchlist_screening_individual_hit_list_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_individual_hit_list_request' when calling PlaidApi.watchlist_screening_individual_hit_list" - end - # resource path - local_var_path = '/watchlist_screening/individual/hit/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_individual_hit_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningIndividualHitListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_individual_hit_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_individual_hit_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List Individual Watchlist Screenings - # List previously created watchlist screenings for individuals - # @param watchlist_screening_individual_list_request [WatchlistScreeningIndividualListRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningIndividualListResponse] - def watchlist_screening_individual_list(watchlist_screening_individual_list_request, opts = {}) - data, _status_code, _headers = watchlist_screening_individual_list_with_http_info(watchlist_screening_individual_list_request, opts) - data - end - - # List Individual Watchlist Screenings - # List previously created watchlist screenings for individuals - # @param watchlist_screening_individual_list_request [WatchlistScreeningIndividualListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningIndividualListResponse, Integer, Hash)>] WatchlistScreeningIndividualListResponse data, response status code and response headers - def watchlist_screening_individual_list_with_http_info(watchlist_screening_individual_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_individual_list ...' - end - # verify the required parameter 'watchlist_screening_individual_list_request' is set - if @api_client.config.client_side_validation && watchlist_screening_individual_list_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_individual_list_request' when calling PlaidApi.watchlist_screening_individual_list" - end - # resource path - local_var_path = '/watchlist_screening/individual/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_individual_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningIndividualListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_individual_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_individual_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Get individual watchlist screening program - # Get an individual watchlist screening program - # @param watchlist_screening_individual_program_get_request [WatchlistScreeningIndividualProgramGetRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningIndividualProgramGetResponse] - def watchlist_screening_individual_program_get(watchlist_screening_individual_program_get_request, opts = {}) - data, _status_code, _headers = watchlist_screening_individual_program_get_with_http_info(watchlist_screening_individual_program_get_request, opts) - data - end - - # Get individual watchlist screening program - # Get an individual watchlist screening program - # @param watchlist_screening_individual_program_get_request [WatchlistScreeningIndividualProgramGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningIndividualProgramGetResponse, Integer, Hash)>] WatchlistScreeningIndividualProgramGetResponse data, response status code and response headers - def watchlist_screening_individual_program_get_with_http_info(watchlist_screening_individual_program_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_individual_program_get ...' - end - # verify the required parameter 'watchlist_screening_individual_program_get_request' is set - if @api_client.config.client_side_validation && watchlist_screening_individual_program_get_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_individual_program_get_request' when calling PlaidApi.watchlist_screening_individual_program_get" - end - # resource path - local_var_path = '/watchlist_screening/individual/program/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_individual_program_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningIndividualProgramGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_individual_program_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_individual_program_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List individual watchlist screening programs - # List all individual watchlist screening programs - # @param watchlist_screening_individual_program_list_request [WatchlistScreeningIndividualProgramListRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningIndividualProgramListResponse] - def watchlist_screening_individual_program_list(watchlist_screening_individual_program_list_request, opts = {}) - data, _status_code, _headers = watchlist_screening_individual_program_list_with_http_info(watchlist_screening_individual_program_list_request, opts) - data - end - - # List individual watchlist screening programs - # List all individual watchlist screening programs - # @param watchlist_screening_individual_program_list_request [WatchlistScreeningIndividualProgramListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningIndividualProgramListResponse, Integer, Hash)>] WatchlistScreeningIndividualProgramListResponse data, response status code and response headers - def watchlist_screening_individual_program_list_with_http_info(watchlist_screening_individual_program_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_individual_program_list ...' - end - # verify the required parameter 'watchlist_screening_individual_program_list_request' is set - if @api_client.config.client_side_validation && watchlist_screening_individual_program_list_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_individual_program_list_request' when calling PlaidApi.watchlist_screening_individual_program_list" - end - # resource path - local_var_path = '/watchlist_screening/individual/program/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_individual_program_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningIndividualProgramListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_individual_program_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_individual_program_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param watchlist_screening_individual_review_create_request [WatchlistScreeningIndividualReviewCreateRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningIndividualReviewCreateResponse] - def watchlist_screening_individual_review_create(watchlist_screening_individual_review_create_request, opts = {}) - data, _status_code, _headers = watchlist_screening_individual_review_create_with_http_info(watchlist_screening_individual_review_create_request, opts) - data - end - - # 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. - # @param watchlist_screening_individual_review_create_request [WatchlistScreeningIndividualReviewCreateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningIndividualReviewCreateResponse, Integer, Hash)>] WatchlistScreeningIndividualReviewCreateResponse data, response status code and response headers - def watchlist_screening_individual_review_create_with_http_info(watchlist_screening_individual_review_create_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_individual_review_create ...' - end - # verify the required parameter 'watchlist_screening_individual_review_create_request' is set - if @api_client.config.client_side_validation && watchlist_screening_individual_review_create_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_individual_review_create_request' when calling PlaidApi.watchlist_screening_individual_review_create" - end - # resource path - local_var_path = '/watchlist_screening/individual/review/create' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_individual_review_create_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningIndividualReviewCreateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_individual_review_create", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_individual_review_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # List reviews for individual watchlist screenings - # List all reviews for the individual watchlist screening. - # @param watchlist_screening_individual_review_list_request [WatchlistScreeningIndividualReviewListRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningIndividualReviewListResponse] - def watchlist_screening_individual_review_list(watchlist_screening_individual_review_list_request, opts = {}) - data, _status_code, _headers = watchlist_screening_individual_review_list_with_http_info(watchlist_screening_individual_review_list_request, opts) - data - end - - # List reviews for individual watchlist screenings - # List all reviews for the individual watchlist screening. - # @param watchlist_screening_individual_review_list_request [WatchlistScreeningIndividualReviewListRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningIndividualReviewListResponse, Integer, Hash)>] WatchlistScreeningIndividualReviewListResponse data, response status code and response headers - def watchlist_screening_individual_review_list_with_http_info(watchlist_screening_individual_review_list_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_individual_review_list ...' - end - # verify the required parameter 'watchlist_screening_individual_review_list_request' is set - if @api_client.config.client_side_validation && watchlist_screening_individual_review_list_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_individual_review_list_request' when calling PlaidApi.watchlist_screening_individual_review_list" - end - # resource path - local_var_path = '/watchlist_screening/individual/review/list' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_individual_review_list_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningIndividualReviewListResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_individual_review_list", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_individual_review_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param watchlist_screening_individual_update_request [WatchlistScreeningIndividualUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [WatchlistScreeningIndividualUpdateResponse] - def watchlist_screening_individual_update(watchlist_screening_individual_update_request, opts = {}) - data, _status_code, _headers = watchlist_screening_individual_update_with_http_info(watchlist_screening_individual_update_request, opts) - data - end - - # 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. - # @param watchlist_screening_individual_update_request [WatchlistScreeningIndividualUpdateRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WatchlistScreeningIndividualUpdateResponse, Integer, Hash)>] WatchlistScreeningIndividualUpdateResponse data, response status code and response headers - def watchlist_screening_individual_update_with_http_info(watchlist_screening_individual_update_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.watchlist_screening_individual_update ...' - end - # verify the required parameter 'watchlist_screening_individual_update_request' is set - if @api_client.config.client_side_validation && watchlist_screening_individual_update_request.nil? - fail ArgumentError, "Missing the required parameter 'watchlist_screening_individual_update_request' when calling PlaidApi.watchlist_screening_individual_update" - end - # resource path - local_var_path = '/watchlist_screening/individual/update' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(watchlist_screening_individual_update_request) - - # return_type - return_type = opts[:debug_return_type] || 'WatchlistScreeningIndividualUpdateResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.watchlist_screening_individual_update", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#watchlist_screening_individual_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # 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. - # @param webhook_verification_key_get_request [WebhookVerificationKeyGetRequest] - # @param [Hash] opts the optional parameters - # @return [WebhookVerificationKeyGetResponse] - def webhook_verification_key_get(webhook_verification_key_get_request, opts = {}) - data, _status_code, _headers = webhook_verification_key_get_with_http_info(webhook_verification_key_get_request, opts) - data - end - - # 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. - # @param webhook_verification_key_get_request [WebhookVerificationKeyGetRequest] - # @param [Hash] opts the optional parameters - # @return [Array<(WebhookVerificationKeyGetResponse, Integer, Hash)>] WebhookVerificationKeyGetResponse data, response status code and response headers - def webhook_verification_key_get_with_http_info(webhook_verification_key_get_request, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: PlaidApi.webhook_verification_key_get ...' - end - # verify the required parameter 'webhook_verification_key_get_request' is set - if @api_client.config.client_side_validation && webhook_verification_key_get_request.nil? - fail ArgumentError, "Missing the required parameter 'webhook_verification_key_get_request' when calling PlaidApi.webhook_verification_key_get" - end - # resource path - local_var_path = '/webhook_verification_key/get' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_verification_key_get_request) - - # return_type - return_type = opts[:debug_return_type] || 'WebhookVerificationKeyGetResponse' - - # auth_names - auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret'] - - new_options = opts.merge( - :operation => :"PlaidApi.webhook_verification_key_get", - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: PlaidApi#webhook_verification_key_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/lib/plaid/api_client.rb b/lib/plaid/api_client.rb deleted file mode 100644 index 4c9b4d486..000000000 --- a/lib/plaid/api_client.rb +++ /dev/null @@ -1,412 +0,0 @@ -# Modified by Plaid -# Due to separate implementations of Faraday 2 and Faraday options support this file has extensive -# Diffs from the equivalent OpenAPI-generator template file - -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'faraday' -require 'faraday/multipart' -require_relative 'api_error' - -module Plaid - class ApiClient - class ApiTimeoutError < ApiError; end - class ApiConnectionFailedError < ApiError; end - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # The Faraday::Connection object for fine tuning configuration options. - attr_reader :connection - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config = Configuration.default) - @config = config - @user_agent = "Plaid Ruby v25.0.0" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent, - } - @connection = create_connection - end - - def create_connection - @connection = Faraday.new(url: config.base_url) do |builder| - block_given? ? yield(builder) : builder.adapter(Faraday.default_adapter) - end - end - - def self.default - @@default ||= ApiClient.new - end - - # Modified by Plaid - # Due to separate implementations of Faraday 2 and Faraday options support this file has extensive - # Diffs from the equivalent OpenAPI-generator template file - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - if opts[:header_params]["Content-Type"] == "multipart/form-data" - connection.request :multipart - connection.request :url_encoded - end - - begin - response = connection.public_send(http_method.to_sym.downcase) do |req| - build_request(http_method, path, req, opts) - end - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.status == 0 && response.respond_to?(:return_message) - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - raw_body = response.body - # Gracefully handle malformed body which is possible during API outage/maintanance - parsed_body = begin - JSON.parse(raw_body) - rescue JSON::ParserError - nil - end - fail ApiError.new(:code => response.status, - :response_headers => response.headers, - :response_body => raw_body, - :data => parsed_body), - response.reason_phrase - end - end - rescue Faraday::TimeoutError - fail ApiTimeoutError.new('Connection timed out') - rescue Faraday::ConnectionFailed - fail ApiConnectionFailedError.new('Connection failed') - end - - if opts[:return_type] - prepare_file(response) if opts[:return_type] == 'File' - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.status, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, request, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - update_params_for_auth! header_params, query_params, opts[:auth_names] - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :verbose => @config.debugging - } - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - request.headers = header_params - request.body = req_body - request.url url - request.params = query_params - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' - data = URI.encode_www_form(form_params) - elsif header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Tempfile - # TODO hardcode to application/octet-stream, need better way to detect content type - data[key] = Faraday::FilePart.new(value.path, 'application/octet-stream', value.path) - when ::Array, nil - # let Faraday handle Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - # models, e.g. Pet - Plaid.const_get(return_type).build_from_hash(data) - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def prepare_file(response) - content_disposition = response.headers["Content-Disposition"] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = "download-" - end - prefix = prefix + "-" unless prefix.end_with?("-") - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - tempfile.write(response.body) - tempfile.close if tempfile - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder " \ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file " \ - "will be deleted automatically with GC. It's also recommended to delete the temp file " \ - "explicitly with `tempfile.delete`" - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end -end diff --git a/lib/plaid/api_error.rb b/lib/plaid/api_error.rb deleted file mode 100644 index 65bdd5029..000000000 --- a/lib/plaid/api_error.rb +++ /dev/null @@ -1,58 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -module Plaid - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body, :data - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - @message = arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - end -end diff --git a/lib/plaid/configuration.rb b/lib/plaid/configuration.rb deleted file mode 100644 index 678e9aea6..000000000 --- a/lib/plaid/configuration.rb +++ /dev/null @@ -1,320 +0,0 @@ -# Modified by Plaid -# Due to separate implementations of Faraday 2 and Faraday options support this file has extensive -# Diffs from the equivalent OpenAPI-generator template file - -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -module Plaid - - class Configuration - # Plaid Environment mapping - # production, development, sandbox - Environment = { "production" => 0, "development" => 1, "sandbox" => 2 } - - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path - attr_accessor :base_path - - # Define server configuration index - attr_accessor :server_index - - # Define server operation configuration index - attr_accessor :server_operation_index - - # Default server variables - attr_accessor :server_variables - - # Default server operation variables - attr_accessor :server_operation_variables - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2. - # Overrides the access_token if set - # @return [Proc] - attr_accessor :access_token_getter - - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - # This file is not modified by Plaid - # In version 6.0 of Openapi generator, this file was renamed to configuration_faraday_partial.mustache - # Our template files do not incorporate the PR (https://github.com/OpenAPITools/openapi-generator/pull/9839) - # That made this change - - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :ssl_verify - - ### TLS/SSL setting - # Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html) - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - attr_accessor :ssl_verify_mode - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - attr_accessor :ssl_ca_file - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :ssl_client_cert - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :ssl_client_key - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'production.plaid.com' - @base_path = '' - @server_index = 0 - @server_operation_index = {} - @server_variables = {} - @server_operation_variables = {} - @api_key = { - 'Plaid-Version' => '2020-09-14', - } - @api_key_prefix = {} - @timeout = 60 - @client_side_validation = true - @ssl_verify = true - @ssl_verify_mode = nil - @ssl_ca_file = nil - @ssl_client_cert = nil - @ssl_client_key = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = (defined?(Rails) && Rails.respond_to?(:logger)) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - # Returns base URL for specified operation based on server settings - def base_url(operation = nil) - index = server_operation_index.fetch(operation, server_index) - return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil - - server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets access_token using access_token_getter or uses the static access_token - def access_token_with_refresh - return access_token if access_token_getter.nil? - access_token_getter.call - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - 'clientId' => - { - type: 'api_key', - in: 'header', - key: 'PLAID-CLIENT-ID', - value: api_key_with_prefix('PLAID-CLIENT-ID') - }, - 'plaidVersion' => - { - type: 'api_key', - in: 'header', - key: 'Plaid-Version', - value: api_key_with_prefix('Plaid-Version') - }, - 'secret' => - { - type: 'api_key', - in: 'header', - key: 'PLAID-SECRET', - value: api_key_with_prefix('PLAID-SECRET') - }, - } - end - - # Returns an array of Server setting - def server_settings - [ - { - url: "https://production.plaid.com", - description: "Production", - }, - { - url: "https://development.plaid.com", - description: "Development", - }, - { - url: "https://sandbox.plaid.com", - description: "Sandbox", - } - ] - end - - def operation_server_settings - { - } - end - - # Returns URL based on server settings - # - # @param index array index of the server settings - # @param variables hash of variable and the corresponding value - def server_url(index, variables = {}, servers = nil) - servers = server_settings if servers == nil - - # check array index out of bound - if (index < 0 || index >= servers.size) - fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" - end - - server = servers[index] - url = server[:url] - - return url unless server.key? :variables - - # go through variable and assign a value - server[:variables].each do |name, variable| - if variables.key?(name) - if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name])) - url.gsub! "{" + name.to_s + "}", variables[name] - else - fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}." - end - else - # use default value - url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value] - end - end - - url - end - end -end diff --git a/lib/plaid/models/account_access.rb b/lib/plaid/models/account_access.rb deleted file mode 100644 index 029560c2f..000000000 --- a/lib/plaid/models/account_access.rb +++ /dev/null @@ -1,249 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Allow or disallow product access by account. Unlisted (e.g. missing) accounts will be considered `new_accounts`. - class AccountAccess - # The unique account identifier for this account. This value must match that returned by the data access API for this account. - attr_accessor :unique_id - - # Allow the application to see this account (and associated details, including balance) in the list of accounts If unset, defaults to `true`. - attr_accessor :authorized - - attr_accessor :account_product_access - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'unique_id' => :'unique_id', - :'authorized' => :'authorized', - :'account_product_access' => :'account_product_access' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'unique_id' => :'String', - :'authorized' => :'Boolean', - :'account_product_access' => :'AccountProductAccessNullable' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'authorized', - :'account_product_access' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountAccess` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountAccess`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'unique_id') - self.unique_id = attributes[:'unique_id'] - end - - if attributes.key?(:'authorized') - self.authorized = attributes[:'authorized'] - else - self.authorized = true - end - - if attributes.key?(:'account_product_access') - self.account_product_access = attributes[:'account_product_access'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @unique_id.nil? - invalid_properties.push('invalid value for "unique_id", unique_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @unique_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - unique_id == o.unique_id && - authorized == o.authorized && - account_product_access == o.account_product_access - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [unique_id, authorized, account_product_access].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/account_assets.rb b/lib/plaid/models/account_assets.rb deleted file mode 100644 index 6b5f9cbdf..000000000 --- a/lib/plaid/models/account_assets.rb +++ /dev/null @@ -1,440 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Asset information about an account - class AccountAssets - # 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. - attr_accessor :account_id - - attr_accessor :balances - - # 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. - attr_accessor :mask - - # The name of the account, either assigned by the user or by the financial institution itself - attr_accessor :name - - # The official name of the account as given by the financial institution - attr_accessor :official_name - - attr_accessor :type - - attr_accessor :subtype - - # 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. - attr_accessor :verification_status - - # 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. - attr_accessor :persistent_account_id - - # The duration of transaction history available for this Item, typically defined as the time since the date of the earliest transaction in that account. - attr_accessor :days_available - - # Transaction history associated with the account. - attr_accessor :transactions - - attr_accessor :investments - - # 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) - attr_accessor :owners - - attr_accessor :ownership_type - - # Calculated data about the historical balances on the account. - attr_accessor :historical_balances - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'balances' => :'balances', - :'mask' => :'mask', - :'name' => :'name', - :'official_name' => :'official_name', - :'type' => :'type', - :'subtype' => :'subtype', - :'verification_status' => :'verification_status', - :'persistent_account_id' => :'persistent_account_id', - :'days_available' => :'days_available', - :'transactions' => :'transactions', - :'investments' => :'investments', - :'owners' => :'owners', - :'ownership_type' => :'ownership_type', - :'historical_balances' => :'historical_balances' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'balances' => :'AssetReportAccountBalance', - :'mask' => :'String', - :'name' => :'String', - :'official_name' => :'String', - :'type' => :'AccountType', - :'subtype' => :'AccountSubtype', - :'verification_status' => :'String', - :'persistent_account_id' => :'String', - :'days_available' => :'Float', - :'transactions' => :'Array', - :'investments' => :'AssetReportInvestments', - :'owners' => :'Array', - :'ownership_type' => :'OwnershipType', - :'historical_balances' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'mask', - :'official_name', - :'subtype', - :'ownership_type', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountAssets` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountAssets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'balances') - self.balances = attributes[:'balances'] - end - - if attributes.key?(:'mask') - self.mask = attributes[:'mask'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'official_name') - self.official_name = attributes[:'official_name'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'subtype') - self.subtype = attributes[:'subtype'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - - if attributes.key?(:'persistent_account_id') - self.persistent_account_id = attributes[:'persistent_account_id'] - end - - if attributes.key?(:'days_available') - self.days_available = attributes[:'days_available'] - end - - if attributes.key?(:'transactions') - if (value = attributes[:'transactions']).is_a?(Array) - self.transactions = value - end - end - - if attributes.key?(:'investments') - self.investments = attributes[:'investments'] - end - - if attributes.key?(:'owners') - if (value = attributes[:'owners']).is_a?(Array) - self.owners = value - end - end - - if attributes.key?(:'ownership_type') - self.ownership_type = attributes[:'ownership_type'] - end - - if attributes.key?(:'historical_balances') - if (value = attributes[:'historical_balances']).is_a?(Array) - self.historical_balances = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @balances.nil? - invalid_properties.push('invalid value for "balances", balances cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @days_available.nil? - invalid_properties.push('invalid value for "days_available", days_available cannot be nil.') - end - - if @transactions.nil? - invalid_properties.push('invalid value for "transactions", transactions cannot be nil.') - end - - if @owners.nil? - invalid_properties.push('invalid value for "owners", owners cannot be nil.') - end - - if @historical_balances.nil? - invalid_properties.push('invalid value for "historical_balances", historical_balances cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @balances.nil? - return false if @name.nil? - return false if @type.nil? - verification_status_validator = EnumAttributeValidator.new('String', ["automatically_verified", "pending_automatic_verification", "pending_manual_verification", "manually_verified", "verification_expired", "verification_failed", "database_matched"]) - return false unless verification_status_validator.valid?(@verification_status) - return false if @days_available.nil? - return false if @transactions.nil? - return false if @owners.nil? - return false if @historical_balances.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] verification_status Object to be assigned - def verification_status=(verification_status) - validator = EnumAttributeValidator.new('String', ["automatically_verified", "pending_automatic_verification", "pending_manual_verification", "manually_verified", "verification_expired", "verification_failed", "database_matched"]) - unless validator.valid?(verification_status) - fail ArgumentError, "invalid value for \"verification_status\", must be one of #{validator.allowable_values}." - end - @verification_status = verification_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - balances == o.balances && - mask == o.mask && - name == o.name && - official_name == o.official_name && - type == o.type && - subtype == o.subtype && - verification_status == o.verification_status && - persistent_account_id == o.persistent_account_id && - days_available == o.days_available && - transactions == o.transactions && - investments == o.investments && - owners == o.owners && - ownership_type == o.ownership_type && - historical_balances == o.historical_balances - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, balances, mask, name, official_name, type, subtype, verification_status, persistent_account_id, days_available, transactions, investments, owners, ownership_type, historical_balances].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/account_balance.rb b/lib/plaid/models/account_balance.rb deleted file mode 100644 index 514243830..000000000 --- a/lib/plaid/models/account_balance.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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`. - class AccountBalance - # 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`. - attr_accessor :available - - # 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`. - attr_accessor :current - - # 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. - attr_accessor :limit - - # The ISO-4217 currency code of the balance. Always null if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - # 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. 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. - attr_accessor :last_updated_datetime - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'available' => :'available', - :'current' => :'current', - :'limit' => :'limit', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'last_updated_datetime' => :'last_updated_datetime' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'available' => :'Float', - :'current' => :'Float', - :'limit' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'last_updated_datetime' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'available', - :'current', - :'limit', - :'iso_currency_code', - :'unofficial_currency_code', - :'last_updated_datetime' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountBalance` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'available') - self.available = attributes[:'available'] - end - - if attributes.key?(:'current') - self.current = attributes[:'current'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'last_updated_datetime') - self.last_updated_datetime = attributes[:'last_updated_datetime'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - available == o.available && - current == o.current && - limit == o.limit && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - last_updated_datetime == o.last_updated_datetime - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [available, current, limit, iso_currency_code, unofficial_currency_code, last_updated_datetime].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/account_base.rb b/lib/plaid/models/account_base.rb deleted file mode 100644 index 646989273..000000000 --- a/lib/plaid/models/account_base.rb +++ /dev/null @@ -1,364 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A single account at a financial institution. - class 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. 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. - attr_accessor :account_id - - attr_accessor :balances - - # 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. - attr_accessor :mask - - # The name of the account, either assigned by the user or by the financial institution itself - attr_accessor :name - - # The official name of the account as given by the financial institution - attr_accessor :official_name - - attr_accessor :type - - attr_accessor :subtype - - # 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. `database_insights_pass`: The Item's ACH numbers have been verified using Plaid's data sources and have strong signal for being valid. Note: Database Insights is currently a beta feature, please contact your account manager for more information. `database_insights_pass_with_caution`: The Item's ACH numbers have been verified using Plaid's data sources and have some signal for being valid. Note: Database Insights is currently a beta feature, please contact your account manager for more information. `database_insights_fail`: The Item's ACH numbers have been verified using Plaid's data sources and have signal for being invalid and/or have no signal for being valid. Note: Database Insights is currently a beta feature, please contact your account manager for more information. - attr_accessor :verification_status - - attr_accessor :verification_insights - - # 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. Because Chase accounts have a different account number each time they are linked, this field may be instead of the account number to uniquely identify a Chase account across multiple Items for payments use cases, helping to reduce duplicate Items or attempted fraud. - attr_accessor :persistent_account_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'balances' => :'balances', - :'mask' => :'mask', - :'name' => :'name', - :'official_name' => :'official_name', - :'type' => :'type', - :'subtype' => :'subtype', - :'verification_status' => :'verification_status', - :'verification_insights' => :'verification_insights', - :'persistent_account_id' => :'persistent_account_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'balances' => :'AccountBalance', - :'mask' => :'String', - :'name' => :'String', - :'official_name' => :'String', - :'type' => :'AccountType', - :'subtype' => :'AccountSubtype', - :'verification_status' => :'String', - :'verification_insights' => :'AccountVerificationInsights', - :'persistent_account_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'mask', - :'official_name', - :'subtype', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountBase` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'balances') - self.balances = attributes[:'balances'] - end - - if attributes.key?(:'mask') - self.mask = attributes[:'mask'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'official_name') - self.official_name = attributes[:'official_name'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'subtype') - self.subtype = attributes[:'subtype'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - - if attributes.key?(:'verification_insights') - self.verification_insights = attributes[:'verification_insights'] - end - - if attributes.key?(:'persistent_account_id') - self.persistent_account_id = attributes[:'persistent_account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @balances.nil? - invalid_properties.push('invalid value for "balances", balances cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @balances.nil? - return false if @name.nil? - return false if @type.nil? - verification_status_validator = EnumAttributeValidator.new('String', ["automatically_verified", "pending_automatic_verification", "pending_manual_verification", "manually_verified", "verification_expired", "verification_failed", "database_matched", "database_insights_pass", "database_insights_pass_with_caution", "database_insights_fail"]) - return false unless verification_status_validator.valid?(@verification_status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] verification_status Object to be assigned - def verification_status=(verification_status) - validator = EnumAttributeValidator.new('String', ["automatically_verified", "pending_automatic_verification", "pending_manual_verification", "manually_verified", "verification_expired", "verification_failed", "database_matched", "database_insights_pass", "database_insights_pass_with_caution", "database_insights_fail"]) - unless validator.valid?(verification_status) - fail ArgumentError, "invalid value for \"verification_status\", must be one of #{validator.allowable_values}." - end - @verification_status = verification_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - balances == o.balances && - mask == o.mask && - name == o.name && - official_name == o.official_name && - type == o.type && - subtype == o.subtype && - verification_status == o.verification_status && - verification_insights == o.verification_insights && - persistent_account_id == o.persistent_account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, balances, mask, name, official_name, type, subtype, verification_status, verification_insights, persistent_account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/account_filter.rb b/lib/plaid/models/account_filter.rb deleted file mode 100644 index 6b25d88cc..000000000 --- a/lib/plaid/models/account_filter.rb +++ /dev/null @@ -1,259 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Enumerates the account subtypes that the application wishes for the user to be able to select from. For more details refer to Plaid documentation on account filters. - class AccountFilter - # A list of account subtypes to be filtered. - attr_accessor :depository - - # A list of account subtypes to be filtered. - attr_accessor :credit - - # A list of account subtypes to be filtered. - attr_accessor :loan - - # A list of account subtypes to be filtered. - attr_accessor :investment - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'depository' => :'depository', - :'credit' => :'credit', - :'loan' => :'loan', - :'investment' => :'investment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'depository' => :'Array', - :'credit' => :'Array', - :'loan' => :'Array', - :'investment' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'depository') - if (value = attributes[:'depository']).is_a?(Array) - self.depository = value - end - end - - if attributes.key?(:'credit') - if (value = attributes[:'credit']).is_a?(Array) - self.credit = value - end - end - - if attributes.key?(:'loan') - if (value = attributes[:'loan']).is_a?(Array) - self.loan = value - end - end - - if attributes.key?(:'investment') - if (value = attributes[:'investment']).is_a?(Array) - self.investment = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - depository == o.depository && - credit == o.credit && - loan == o.loan && - investment == o.investment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [depository, credit, loan, investment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/account_filters_response.rb b/lib/plaid/models/account_filters_response.rb deleted file mode 100644 index ab95cb785..000000000 --- a/lib/plaid/models/account_filters_response.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The `account_filters` specified in the original call to `/link/token/create`. - class AccountFiltersResponse - attr_accessor :depository - - attr_accessor :credit - - attr_accessor :loan - - attr_accessor :investment - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'depository' => :'depository', - :'credit' => :'credit', - :'loan' => :'loan', - :'investment' => :'investment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'depository' => :'DepositoryFilter', - :'credit' => :'CreditFilter', - :'loan' => :'LoanFilter', - :'investment' => :'InvestmentFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountFiltersResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountFiltersResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'depository') - self.depository = attributes[:'depository'] - end - - if attributes.key?(:'credit') - self.credit = attributes[:'credit'] - end - - if attributes.key?(:'loan') - self.loan = attributes[:'loan'] - end - - if attributes.key?(:'investment') - self.investment = attributes[:'investment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - depository == o.depository && - credit == o.credit && - loan == o.loan && - investment == o.investment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [depository, credit, loan, investment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/account_identity.rb b/lib/plaid/models/account_identity.rb deleted file mode 100644 index 981217245..000000000 --- a/lib/plaid/models/account_identity.rb +++ /dev/null @@ -1,401 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Identity information about an account - class AccountIdentity - # 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. - attr_accessor :account_id - - attr_accessor :balances - - # 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. - attr_accessor :mask - - # The name of the account, either assigned by the user or by the financial institution itself - attr_accessor :name - - # The official name of the account as given by the financial institution - attr_accessor :official_name - - attr_accessor :type - - attr_accessor :subtype - - # 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. `database_insights_pass`: The Item's ACH numbers have been verified using Plaid's data sources and have strong signal for being valid. Note: Database Insights is currently a beta feature, please contact your account manager for more information. `database_insights_pass_with_caution`: The Item's ACH numbers have been verified using Plaid's data sources and have some signal for being valid. Note: Database Insights is currently a beta feature, please contact your account manager for more information. `database_insights_fail`: The Item's ACH numbers have been verified using Plaid's data sources and have signal for being invalid and/or have no signal for being valid. Note: Database Insights is currently a beta feature, please contact your account manager for more information. - attr_accessor :verification_status - - attr_accessor :verification_insights - - # 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. Because Chase accounts have a different account number each time they are linked, this field may be instead of the account number to uniquely identify a Chase account across multiple Items for payments use cases, helping to reduce duplicate Items or attempted fraud. - attr_accessor :persistent_account_id - - # 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) - attr_accessor :owners - - # Array of documents that identity data is dervied from. This array will be empty if none of the account identity is from a document. - attr_accessor :documents - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'balances' => :'balances', - :'mask' => :'mask', - :'name' => :'name', - :'official_name' => :'official_name', - :'type' => :'type', - :'subtype' => :'subtype', - :'verification_status' => :'verification_status', - :'verification_insights' => :'verification_insights', - :'persistent_account_id' => :'persistent_account_id', - :'owners' => :'owners', - :'documents' => :'documents' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'balances' => :'AccountBalance', - :'mask' => :'String', - :'name' => :'String', - :'official_name' => :'String', - :'type' => :'AccountType', - :'subtype' => :'AccountSubtype', - :'verification_status' => :'String', - :'verification_insights' => :'AccountVerificationInsights', - :'persistent_account_id' => :'String', - :'owners' => :'Array', - :'documents' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'mask', - :'official_name', - :'subtype', - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'AccountBase', - :'AccountIdentityAllOf' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountIdentity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountIdentity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'balances') - self.balances = attributes[:'balances'] - end - - if attributes.key?(:'mask') - self.mask = attributes[:'mask'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'official_name') - self.official_name = attributes[:'official_name'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'subtype') - self.subtype = attributes[:'subtype'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - - if attributes.key?(:'verification_insights') - self.verification_insights = attributes[:'verification_insights'] - end - - if attributes.key?(:'persistent_account_id') - self.persistent_account_id = attributes[:'persistent_account_id'] - end - - if attributes.key?(:'owners') - if (value = attributes[:'owners']).is_a?(Array) - self.owners = value - end - end - - if attributes.key?(:'documents') - if (value = attributes[:'documents']).is_a?(Array) - self.documents = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @balances.nil? - invalid_properties.push('invalid value for "balances", balances cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @owners.nil? - invalid_properties.push('invalid value for "owners", owners cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @balances.nil? - return false if @name.nil? - return false if @type.nil? - verification_status_validator = EnumAttributeValidator.new('String', ["automatically_verified", "pending_automatic_verification", "pending_manual_verification", "manually_verified", "verification_expired", "verification_failed", "database_matched", "database_insights_pass", "database_insights_pass_with_caution", "database_insights_fail"]) - return false unless verification_status_validator.valid?(@verification_status) - return false if @owners.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] verification_status Object to be assigned - def verification_status=(verification_status) - validator = EnumAttributeValidator.new('String', ["automatically_verified", "pending_automatic_verification", "pending_manual_verification", "manually_verified", "verification_expired", "verification_failed", "database_matched", "database_insights_pass", "database_insights_pass_with_caution", "database_insights_fail"]) - unless validator.valid?(verification_status) - fail ArgumentError, "invalid value for \"verification_status\", must be one of #{validator.allowable_values}." - end - @verification_status = verification_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - balances == o.balances && - mask == o.mask && - name == o.name && - official_name == o.official_name && - type == o.type && - subtype == o.subtype && - verification_status == o.verification_status && - verification_insights == o.verification_insights && - persistent_account_id == o.persistent_account_id && - owners == o.owners && - documents == o.documents - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, balances, mask, name, official_name, type, subtype, verification_status, verification_insights, persistent_account_id, owners, documents].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/account_identity_all_of.rb b/lib/plaid/models/account_identity_all_of.rb deleted file mode 100644 index e6026802d..000000000 --- a/lib/plaid/models/account_identity_all_of.rb +++ /dev/null @@ -1,239 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class AccountIdentityAllOf - # 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) - attr_accessor :owners - - # Array of documents that identity data is dervied from. This array will be empty if none of the account identity is from a document. - attr_accessor :documents - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'owners' => :'owners', - :'documents' => :'documents' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'owners' => :'Array', - :'documents' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountIdentityAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountIdentityAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'owners') - if (value = attributes[:'owners']).is_a?(Array) - self.owners = value - end - end - - if attributes.key?(:'documents') - if (value = attributes[:'documents']).is_a?(Array) - self.documents = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @owners.nil? - invalid_properties.push('invalid value for "owners", owners cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @owners.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - owners == o.owners && - documents == o.documents - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [owners, documents].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/account_identity_match_score.rb b/lib/plaid/models/account_identity_match_score.rb deleted file mode 100644 index ee69743cd..000000000 --- a/lib/plaid/models/account_identity_match_score.rb +++ /dev/null @@ -1,412 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Identity match scores for an account - class AccountIdentityMatchScore - # 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. - attr_accessor :account_id - - attr_accessor :balances - - # 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. - attr_accessor :mask - - # The name of the account, either assigned by the user or by the financial institution itself - attr_accessor :name - - # The official name of the account as given by the financial institution - attr_accessor :official_name - - attr_accessor :type - - attr_accessor :subtype - - # 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. `database_insights_pass`: The Item's ACH numbers have been verified using Plaid's data sources and have strong signal for being valid. Note: Database Insights is currently a beta feature, please contact your account manager for more information. `database_insights_pass_with_caution`: The Item's ACH numbers have been verified using Plaid's data sources and have some signal for being valid. Note: Database Insights is currently a beta feature, please contact your account manager for more information. `database_insights_fail`: The Item's ACH numbers have been verified using Plaid's data sources and have signal for being invalid and/or have no signal for being valid. Note: Database Insights is currently a beta feature, please contact your account manager for more information. - attr_accessor :verification_status - - attr_accessor :verification_insights - - # 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. Because Chase accounts have a different account number each time they are linked, this field may be instead of the account number to uniquely identify a Chase account across multiple Items for payments use cases, helping to reduce duplicate Items or attempted fraud. - attr_accessor :persistent_account_id - - attr_accessor :legal_name - - attr_accessor :phone_number - - attr_accessor :email_address - - attr_accessor :address - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'balances' => :'balances', - :'mask' => :'mask', - :'name' => :'name', - :'official_name' => :'official_name', - :'type' => :'type', - :'subtype' => :'subtype', - :'verification_status' => :'verification_status', - :'verification_insights' => :'verification_insights', - :'persistent_account_id' => :'persistent_account_id', - :'legal_name' => :'legal_name', - :'phone_number' => :'phone_number', - :'email_address' => :'email_address', - :'address' => :'address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'balances' => :'AccountBalance', - :'mask' => :'String', - :'name' => :'String', - :'official_name' => :'String', - :'type' => :'AccountType', - :'subtype' => :'AccountSubtype', - :'verification_status' => :'String', - :'verification_insights' => :'AccountVerificationInsights', - :'persistent_account_id' => :'String', - :'legal_name' => :'NameMatchScore', - :'phone_number' => :'PhoneNumberMatchScore', - :'email_address' => :'EmailAddressMatchScore', - :'address' => :'AddressMatchScore' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'mask', - :'official_name', - :'subtype', - :'legal_name', - :'phone_number', - :'email_address', - :'address' - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'AccountBase', - :'AccountIdentityMatchScoreAllOf' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountIdentityMatchScore` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountIdentityMatchScore`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'balances') - self.balances = attributes[:'balances'] - end - - if attributes.key?(:'mask') - self.mask = attributes[:'mask'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'official_name') - self.official_name = attributes[:'official_name'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'subtype') - self.subtype = attributes[:'subtype'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - - if attributes.key?(:'verification_insights') - self.verification_insights = attributes[:'verification_insights'] - end - - if attributes.key?(:'persistent_account_id') - self.persistent_account_id = attributes[:'persistent_account_id'] - end - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @balances.nil? - invalid_properties.push('invalid value for "balances", balances cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @balances.nil? - return false if @name.nil? - return false if @type.nil? - verification_status_validator = EnumAttributeValidator.new('String', ["automatically_verified", "pending_automatic_verification", "pending_manual_verification", "manually_verified", "verification_expired", "verification_failed", "database_matched", "database_insights_pass", "database_insights_pass_with_caution", "database_insights_fail"]) - return false unless verification_status_validator.valid?(@verification_status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] verification_status Object to be assigned - def verification_status=(verification_status) - validator = EnumAttributeValidator.new('String', ["automatically_verified", "pending_automatic_verification", "pending_manual_verification", "manually_verified", "verification_expired", "verification_failed", "database_matched", "database_insights_pass", "database_insights_pass_with_caution", "database_insights_fail"]) - unless validator.valid?(verification_status) - fail ArgumentError, "invalid value for \"verification_status\", must be one of #{validator.allowable_values}." - end - @verification_status = verification_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - balances == o.balances && - mask == o.mask && - name == o.name && - official_name == o.official_name && - type == o.type && - subtype == o.subtype && - verification_status == o.verification_status && - verification_insights == o.verification_insights && - persistent_account_id == o.persistent_account_id && - legal_name == o.legal_name && - phone_number == o.phone_number && - email_address == o.email_address && - address == o.address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, balances, mask, name, official_name, type, subtype, verification_status, verification_insights, persistent_account_id, legal_name, phone_number, email_address, address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/account_identity_match_score_all_of.rb b/lib/plaid/models/account_identity_match_score_all_of.rb deleted file mode 100644 index 7b4df20a4..000000000 --- a/lib/plaid/models/account_identity_match_score_all_of.rb +++ /dev/null @@ -1,250 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class AccountIdentityMatchScoreAllOf - attr_accessor :legal_name - - attr_accessor :phone_number - - attr_accessor :email_address - - attr_accessor :address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'legal_name' => :'legal_name', - :'phone_number' => :'phone_number', - :'email_address' => :'email_address', - :'address' => :'address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'legal_name' => :'NameMatchScore', - :'phone_number' => :'PhoneNumberMatchScore', - :'email_address' => :'EmailAddressMatchScore', - :'address' => :'AddressMatchScore' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'legal_name', - :'phone_number', - :'email_address', - :'address' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountIdentityMatchScoreAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountIdentityMatchScoreAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - legal_name == o.legal_name && - phone_number == o.phone_number && - email_address == o.email_address && - address == o.address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [legal_name, phone_number, email_address, address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/account_product_access.rb b/lib/plaid/models/account_product_access.rb deleted file mode 100644 index f76fd9f44..000000000 --- a/lib/plaid/models/account_product_access.rb +++ /dev/null @@ -1,250 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Allow the application to access specific products on this account - class AccountProductAccess - # Allow the application to access account data. Only used by certain partners. If relevant to the partner and unset, defaults to `true`. - attr_accessor :account_data - - # Allow the application to access bank statements. Only used by certain partners. If relevant to the partner and unset, defaults to `true`. - attr_accessor :statements - - # Allow the application to access tax documents. Only used by certain partners. If relevant to the partner and unset, defaults to `true`. - attr_accessor :tax_documents - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_data' => :'account_data', - :'statements' => :'statements', - :'tax_documents' => :'tax_documents' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_data' => :'Boolean', - :'statements' => :'Boolean', - :'tax_documents' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_data', - :'statements', - :'tax_documents' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountProductAccess` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountProductAccess`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_data') - self.account_data = attributes[:'account_data'] - else - self.account_data = true - end - - if attributes.key?(:'statements') - self.statements = attributes[:'statements'] - else - self.statements = true - end - - if attributes.key?(:'tax_documents') - self.tax_documents = attributes[:'tax_documents'] - else - self.tax_documents = true - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_data == o.account_data && - statements == o.statements && - tax_documents == o.tax_documents - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_data, statements, tax_documents].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/account_product_access_nullable.rb b/lib/plaid/models/account_product_access_nullable.rb deleted file mode 100644 index 8a10b4dfb..000000000 --- a/lib/plaid/models/account_product_access_nullable.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Allow the application to access specific products on this account - class AccountProductAccessNullable - # Allow the application to access account data. Only used by certain partners. If relevant to the partner and unset, defaults to `true`. - attr_accessor :account_data - - # Allow the application to access bank statements. Only used by certain partners. If relevant to the partner and unset, defaults to `true`. - attr_accessor :statements - - # Allow the application to access tax documents. Only used by certain partners. If relevant to the partner and unset, defaults to `true`. - attr_accessor :tax_documents - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_data' => :'account_data', - :'statements' => :'statements', - :'tax_documents' => :'tax_documents' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_data' => :'Boolean', - :'statements' => :'Boolean', - :'tax_documents' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_data', - :'statements', - :'tax_documents' - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'AccountProductAccess' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountProductAccessNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountProductAccessNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_data') - self.account_data = attributes[:'account_data'] - else - self.account_data = true - end - - if attributes.key?(:'statements') - self.statements = attributes[:'statements'] - else - self.statements = true - end - - if attributes.key?(:'tax_documents') - self.tax_documents = attributes[:'tax_documents'] - else - self.tax_documents = true - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_data == o.account_data && - statements == o.statements && - tax_documents == o.tax_documents - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_data, statements, tax_documents].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/account_selection_cardinality.rb b/lib/plaid/models/account_selection_cardinality.rb deleted file mode 100644 index 34f8eb8ab..000000000 --- a/lib/plaid/models/account_selection_cardinality.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class AccountSelectionCardinality - SINGLE_SELECT = "SINGLE_SELECT".freeze - MULTI_SELECT = "MULTI_SELECT".freeze - ALL = "ALL".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/account_subtype.rb b/lib/plaid/models/account_subtype.rb deleted file mode 100644 index 96f719559..000000000 --- a/lib/plaid/models/account_subtype.rb +++ /dev/null @@ -1,111 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class AccountSubtype - N401A = "401a".freeze - N401K = "401k".freeze - N403_B = "403B".freeze - N457B = "457b".freeze - N529 = "529".freeze - BROKERAGE = "brokerage".freeze - CASH_ISA = "cash isa".freeze - CRYPTO_EXCHANGE = "crypto exchange".freeze - EDUCATION_SAVINGS_ACCOUNT = "education savings account".freeze - EBT = "ebt".freeze - FIXED_ANNUITY = "fixed annuity".freeze - GIC = "gic".freeze - HEALTH_REIMBURSEMENT_ARRANGEMENT = "health reimbursement arrangement".freeze - HSA = "hsa".freeze - ISA = "isa".freeze - IRA = "ira".freeze - LIF = "lif".freeze - LIFE_INSURANCE = "life insurance".freeze - LIRA = "lira".freeze - LRIF = "lrif".freeze - LRSP = "lrsp".freeze - NON_CUSTODIAL_WALLET = "non-custodial wallet".freeze - NON_TAXABLE_BROKERAGE_ACCOUNT = "non-taxable brokerage account".freeze - OTHER = "other".freeze - OTHER_INSURANCE = "other insurance".freeze - OTHER_ANNUITY = "other annuity".freeze - PRIF = "prif".freeze - RDSP = "rdsp".freeze - RESP = "resp".freeze - RLIF = "rlif".freeze - RRIF = "rrif".freeze - PENSION = "pension".freeze - PROFIT_SHARING_PLAN = "profit sharing plan".freeze - RETIREMENT = "retirement".freeze - ROTH = "roth".freeze - ROTH_401K = "roth 401k".freeze - RRSP = "rrsp".freeze - SEP_IRA = "sep ira".freeze - SIMPLE_IRA = "simple ira".freeze - SIPP = "sipp".freeze - STOCK_PLAN = "stock plan".freeze - THRIFT_SAVINGS_PLAN = "thrift savings plan".freeze - TFSA = "tfsa".freeze - TRUST = "trust".freeze - UGMA = "ugma".freeze - UTMA = "utma".freeze - VARIABLE_ANNUITY = "variable annuity".freeze - CREDIT_CARD = "credit card".freeze - PAYPAL = "paypal".freeze - CD = "cd".freeze - CHECKING = "checking".freeze - SAVINGS = "savings".freeze - MONEY_MARKET = "money market".freeze - PREPAID = "prepaid".freeze - AUTO = "auto".freeze - BUSINESS = "business".freeze - COMMERCIAL = "commercial".freeze - CONSTRUCTION = "construction".freeze - CONSUMER = "consumer".freeze - HOME_EQUITY = "home equity".freeze - LOAN = "loan".freeze - MORTGAGE = "mortgage".freeze - OVERDRAFT = "overdraft".freeze - LINE_OF_CREDIT = "line of credit".freeze - STUDENT = "student".freeze - CASH_MANAGEMENT = "cash management".freeze - KEOGH = "keogh".freeze - MUTUAL_FUND = "mutual fund".freeze - RECURRING = "recurring".freeze - REWARDS = "rewards".freeze - SAFE_DEPOSIT = "safe deposit".freeze - SARSEP = "sarsep".freeze - PAYROLL = "payroll".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/account_type.rb b/lib/plaid/models/account_type.rb deleted file mode 100644 index f9375a066..000000000 --- a/lib/plaid/models/account_type.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class AccountType - INVESTMENT = "investment".freeze - CREDIT = "credit".freeze - DEPOSITORY = "depository".freeze - LOAN = "loan".freeze - BROKERAGE = "brokerage".freeze - OTHER = "other".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/account_verification_insights.rb b/lib/plaid/models/account_verification_insights.rb deleted file mode 100644 index 3963bcfe0..000000000 --- a/lib/plaid/models/account_verification_insights.rb +++ /dev/null @@ -1,270 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Insights from performing database verification for the account. - class AccountVerificationInsights - attr_accessor :network_status - - attr_accessor :previous_returns - - attr_accessor :account_number_format - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'network_status' => :'network_status', - :'previous_returns' => :'previous_returns', - :'account_number_format' => :'account_number_format' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'network_status' => :'AccountVerificationInsightsNetworkStatus', - :'previous_returns' => :'AccountVerificationInsightsPreviousReturns', - :'account_number_format' => :'AccountVerificationInsightsAccountNumberFormat' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountVerificationInsights` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountVerificationInsights`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'network_status') - self.network_status = attributes[:'network_status'] - end - - if attributes.key?(:'previous_returns') - self.previous_returns = attributes[:'previous_returns'] - end - - if attributes.key?(:'account_number_format') - self.account_number_format = attributes[:'account_number_format'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @network_status.nil? - invalid_properties.push('invalid value for "network_status", network_status cannot be nil.') - end - - if @account_number_format.nil? - invalid_properties.push('invalid value for "account_number_format", account_number_format cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @network_status.nil? - return false if @account_number_format.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - network_status == o.network_status && - previous_returns == o.previous_returns && - account_number_format == o.account_number_format - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [network_status, previous_returns, account_number_format].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/account_verification_insights_account_number_format.rb b/lib/plaid/models/account_verification_insights_account_number_format.rb deleted file mode 100644 index 4bfb06ebf..000000000 --- a/lib/plaid/models/account_verification_insights_account_number_format.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class AccountVerificationInsightsAccountNumberFormat - VALID = "valid".freeze - INVALID = "invalid".freeze - UNKNOWN = "unknown".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/account_verification_insights_network_status.rb b/lib/plaid/models/account_verification_insights_network_status.rb deleted file mode 100644 index 9be8a6cb2..000000000 --- a/lib/plaid/models/account_verification_insights_network_status.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Status information about the account and routing number in the Plaid network. - class AccountVerificationInsightsNetworkStatus - # Indicates whether we found at least one matching account for the ACH account and routing number. - attr_accessor :has_numbers_match - - # Indicates if at least one matching account for the ACH account and routing number is already verified. - attr_accessor :is_numbers_match_verified - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'has_numbers_match' => :'has_numbers_match', - :'is_numbers_match_verified' => :'is_numbers_match_verified' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'has_numbers_match' => :'Boolean', - :'is_numbers_match_verified' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountVerificationInsightsNetworkStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountVerificationInsightsNetworkStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'has_numbers_match') - self.has_numbers_match = attributes[:'has_numbers_match'] - end - - if attributes.key?(:'is_numbers_match_verified') - self.is_numbers_match_verified = attributes[:'is_numbers_match_verified'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @has_numbers_match.nil? - invalid_properties.push('invalid value for "has_numbers_match", has_numbers_match cannot be nil.') - end - - if @is_numbers_match_verified.nil? - invalid_properties.push('invalid value for "is_numbers_match_verified", is_numbers_match_verified cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @has_numbers_match.nil? - return false if @is_numbers_match_verified.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - has_numbers_match == o.has_numbers_match && - is_numbers_match_verified == o.is_numbers_match_verified - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [has_numbers_match, is_numbers_match_verified].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/account_verification_insights_previous_returns.rb b/lib/plaid/models/account_verification_insights_previous_returns.rb deleted file mode 100644 index 326d66293..000000000 --- a/lib/plaid/models/account_verification_insights_previous_returns.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about known ACH returns for the account and routing number. - class AccountVerificationInsightsPreviousReturns - # Indicates whether Plaid's data sources include a known administrative ACH return for account and routing number. - attr_accessor :has_previous_administrative_return - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'has_previous_administrative_return' => :'has_previous_administrative_return' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'has_previous_administrative_return' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountVerificationInsightsPreviousReturns` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountVerificationInsightsPreviousReturns`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'has_previous_administrative_return') - self.has_previous_administrative_return = attributes[:'has_previous_administrative_return'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @has_previous_administrative_return.nil? - invalid_properties.push('invalid value for "has_previous_administrative_return", has_previous_administrative_return cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @has_previous_administrative_return.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - has_previous_administrative_return == o.has_previous_administrative_return - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [has_previous_administrative_return].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/accounts_balance_get_request.rb b/lib/plaid/models/accounts_balance_get_request.rb deleted file mode 100644 index f9e346a84..000000000 --- a/lib/plaid/models/accounts_balance_get_request.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AccountsBalanceGetRequest defines the request schema for `/accounts/balance/get` - class AccountsBalanceGetRequest - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - attr_accessor :options - - attr_accessor :payment_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'access_token' => :'access_token', - :'secret' => :'secret', - :'client_id' => :'client_id', - :'options' => :'options', - :'payment_details' => :'payment_details' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'access_token' => :'String', - :'secret' => :'String', - :'client_id' => :'String', - :'options' => :'AccountsBalanceGetRequestOptions', - :'payment_details' => :'AccountsBalanceGetRequestPaymentDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'payment_details' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountsBalanceGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountsBalanceGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - - if attributes.key?(:'payment_details') - self.payment_details = attributes[:'payment_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - access_token == o.access_token && - secret == o.secret && - client_id == o.client_id && - options == o.options && - payment_details == o.payment_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [access_token, secret, client_id, options, payment_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/accounts_balance_get_request_options.rb b/lib/plaid/models/accounts_balance_get_request_options.rb deleted file mode 100644 index 3febc0e9e..000000000 --- a/lib/plaid/models/accounts_balance_get_request_options.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to filter `/accounts/balance/get` results. - class AccountsBalanceGetRequestOptions - # A list of `account_ids` to retrieve for the Item. The default value is `null`. Note: An error will be returned if a provided `account_id` is not associated with the Item. - attr_accessor :account_ids - - # 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`. This field is only necessary when the institution is `ins_128026` (Capital One), *and* the account type is a non-depository account (such as a credit card) 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, as well as for depository accounts at Capital One (including all checking and savings accounts) 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. - attr_accessor :min_last_updated_datetime - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_ids' => :'account_ids', - :'min_last_updated_datetime' => :'min_last_updated_datetime' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_ids' => :'Array', - :'min_last_updated_datetime' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountsBalanceGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountsBalanceGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_ids') - if (value = attributes[:'account_ids']).is_a?(Array) - self.account_ids = value - end - end - - if attributes.key?(:'min_last_updated_datetime') - self.min_last_updated_datetime = attributes[:'min_last_updated_datetime'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_ids == o.account_ids && - min_last_updated_datetime == o.min_last_updated_datetime - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_ids, min_last_updated_datetime].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/accounts_balance_get_request_payment_details.rb b/lib/plaid/models/accounts_balance_get_request_payment_details.rb deleted file mode 100644 index 1da992a06..000000000 --- a/lib/plaid/models/accounts_balance_get_request_payment_details.rb +++ /dev/null @@ -1,315 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object containing payment details. If set, a payment risk assessment is performed and returned as AccountsBalanceGetResponsePaymentRiskAssessment. - class 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. - attr_accessor :account_id - - # 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. - attr_accessor :client_transaction_id - - # The transaction amount, in USD (e.g. `102.05`) - attr_accessor :amount - - # The threshold percentage of the account balance used for comparison with the requested ACH debit amount. - attr_accessor :balance_threshold_percentage - - # A boolean that determines whether the balance has to be refreshed in real time as part of the API call. - attr_accessor :requires_real_time_balance_refresh - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'client_transaction_id' => :'client_transaction_id', - :'amount' => :'amount', - :'balance_threshold_percentage' => :'balance_threshold_percentage', - :'requires_real_time_balance_refresh' => :'requires_real_time_balance_refresh' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'client_transaction_id' => :'String', - :'amount' => :'Float', - :'balance_threshold_percentage' => :'Integer', - :'requires_real_time_balance_refresh' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountsBalanceGetRequestPaymentDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountsBalanceGetRequestPaymentDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'client_transaction_id') - self.client_transaction_id = attributes[:'client_transaction_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'balance_threshold_percentage') - self.balance_threshold_percentage = attributes[:'balance_threshold_percentage'] - else - self.balance_threshold_percentage = 90 - end - - if attributes.key?(:'requires_real_time_balance_refresh') - self.requires_real_time_balance_refresh = attributes[:'requires_real_time_balance_refresh'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@client_transaction_id.nil? && @client_transaction_id.to_s.length > 36 - invalid_properties.push('invalid value for "client_transaction_id", the character length must be smaller than or equal to 36.') - end - - if !@client_transaction_id.nil? && @client_transaction_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_transaction_id", the character length must be great than or equal to 1.') - end - - - if !@balance_threshold_percentage.nil? && @balance_threshold_percentage > 100 - invalid_properties.push('invalid value for "balance_threshold_percentage", must be smaller than or equal to 100.') - end - - if !@balance_threshold_percentage.nil? && @balance_threshold_percentage < 1 - invalid_properties.push('invalid value for "balance_threshold_percentage", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@client_transaction_id.nil? && @client_transaction_id.to_s.length > 36 - return false if !@client_transaction_id.nil? && @client_transaction_id.to_s.length < 1 - return false if !@balance_threshold_percentage.nil? && @balance_threshold_percentage > 100 - return false if !@balance_threshold_percentage.nil? && @balance_threshold_percentage < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] client_transaction_id Value to be assigned - def client_transaction_id=(client_transaction_id) - if !client_transaction_id.nil? && client_transaction_id.to_s.length > 36 - fail ArgumentError, 'invalid value for "client_transaction_id", the character length must be smaller than or equal to 36.' - end - - if !client_transaction_id.nil? && client_transaction_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_transaction_id", the character length must be great than or equal to 1.' - end - - - @client_transaction_id = client_transaction_id - end - - # Custom attribute writer method with validation - # @param [Object] balance_threshold_percentage Value to be assigned - def balance_threshold_percentage=(balance_threshold_percentage) - if !balance_threshold_percentage.nil? && balance_threshold_percentage > 100 - fail ArgumentError, 'invalid value for "balance_threshold_percentage", must be smaller than or equal to 100.' - end - - if !balance_threshold_percentage.nil? && balance_threshold_percentage < 1 - fail ArgumentError, 'invalid value for "balance_threshold_percentage", must be greater than or equal to 1.' - end - - - @balance_threshold_percentage = balance_threshold_percentage - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - client_transaction_id == o.client_transaction_id && - amount == o.amount && - balance_threshold_percentage == o.balance_threshold_percentage && - requires_real_time_balance_refresh == o.requires_real_time_balance_refresh - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, client_transaction_id, amount, balance_threshold_percentage, requires_real_time_balance_refresh].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/accounts_balance_get_response_payment_risk_assessment.rb b/lib/plaid/models/accounts_balance_get_response_payment_risk_assessment.rb deleted file mode 100644 index 44398bd3e..000000000 --- a/lib/plaid/models/accounts_balance_get_response_payment_risk_assessment.rb +++ /dev/null @@ -1,299 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # This object provides detailed risk assessment for the requested transaction - class AccountsBalanceGetResponsePaymentRiskAssessment - # A five-tier risk assessment for the transaction, based on the probability of ACH returns, measured by the incident rate. - attr_accessor :risk_level - - attr_accessor :attributes - - # 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. - attr_accessor :score - - # Timestamp of the last successful balance update, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :balance_last_updated - - # An array of objects, each representing a specific reason contributing to the risk assessment of an ACH transaction. This field is particularly useful for understanding risk factors affecting the risk level assigned to a transaction classified as “high”, “medium-high”, and “medium” risk. - attr_accessor :risk_reasons - - # This boolean field denotes if the requested ACH debit amount exceeds the calculated threshold based on either the available or current balance of the bank account. Specifically, it checks if the amount is greater than the account balance multiplied by \"balance_threshold_percentage\"/100. In cases where available_balance is not accessible, current_balance is used. This field is particularly useful for clients handling indirect items who lack direct access to raw balance data. - attr_accessor :exceeds_balance_threshold - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'risk_level' => :'risk_level', - :'attributes' => :'attributes', - :'score' => :'score', - :'balance_last_updated' => :'balance_last_updated', - :'risk_reasons' => :'risk_reasons', - :'exceeds_balance_threshold' => :'exceeds_balance_threshold' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'risk_level' => :'String', - :'attributes' => :'BalancePlusAttributes', - :'score' => :'Integer', - :'balance_last_updated' => :'Time', - :'risk_reasons' => :'Array', - :'exceeds_balance_threshold' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'score', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountsBalanceGetResponsePaymentRiskAssessment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountsBalanceGetResponsePaymentRiskAssessment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'risk_level') - self.risk_level = attributes[:'risk_level'] - end - - if attributes.key?(:'attributes') - self.attributes = attributes[:'attributes'] - end - - if attributes.key?(:'score') - self.score = attributes[:'score'] - end - - if attributes.key?(:'balance_last_updated') - self.balance_last_updated = attributes[:'balance_last_updated'] - end - - if attributes.key?(:'risk_reasons') - if (value = attributes[:'risk_reasons']).is_a?(Array) - self.risk_reasons = value - end - end - - if attributes.key?(:'exceeds_balance_threshold') - self.exceeds_balance_threshold = attributes[:'exceeds_balance_threshold'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@score.nil? && @score > 99 - invalid_properties.push('invalid value for "score", must be smaller than or equal to 99.') - end - - if !@score.nil? && @score < 1 - invalid_properties.push('invalid value for "score", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@score.nil? && @score > 99 - return false if !@score.nil? && @score < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] score Value to be assigned - def score=(score) - if !score.nil? && score > 99 - fail ArgumentError, 'invalid value for "score", must be smaller than or equal to 99.' - end - - if !score.nil? && score < 1 - fail ArgumentError, 'invalid value for "score", must be greater than or equal to 1.' - end - - - @score = score - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - risk_level == o.risk_level && - attributes == o.attributes && - score == o.score && - balance_last_updated == o.balance_last_updated && - risk_reasons == o.risk_reasons && - exceeds_balance_threshold == o.exceeds_balance_threshold - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [risk_level, attributes, score, balance_last_updated, risk_reasons, exceeds_balance_threshold].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/accounts_get_request.rb b/lib/plaid/models/accounts_get_request.rb deleted file mode 100644 index 81fcbfef4..000000000 --- a/lib/plaid/models/accounts_get_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AccountsGetRequest defines the request schema for `/accounts/get` - class AccountsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'options' => :'AccountsGetRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/accounts_get_request_options.rb b/lib/plaid/models/accounts_get_request_options.rb deleted file mode 100644 index bf509bddf..000000000 --- a/lib/plaid/models/accounts_get_request_options.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to filter `/accounts/get` results. - class AccountsGetRequestOptions - # An array of `account_ids` to retrieve for the Account. - attr_accessor :account_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_ids' => :'account_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountsGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountsGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_ids') - if (value = attributes[:'account_ids']).is_a?(Array) - self.account_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_ids == o.account_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/accounts_get_response.rb b/lib/plaid/models/accounts_get_response.rb deleted file mode 100644 index 8016dcebd..000000000 --- a/lib/plaid/models/accounts_get_response.rb +++ /dev/null @@ -1,267 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AccountsGetResponse defines the response schema for `/accounts/get` and `/accounts/balance/get`. - class 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. - attr_accessor :accounts - - attr_accessor :item - - attr_accessor :payment_risk_assessment - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'accounts' => :'accounts', - :'item' => :'item', - :'payment_risk_assessment' => :'payment_risk_assessment', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'accounts' => :'Array', - :'item' => :'Item', - :'payment_risk_assessment' => :'AccountsBalanceGetResponsePaymentRiskAssessment', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'payment_risk_assessment', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AccountsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AccountsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - - if attributes.key?(:'item') - self.item = attributes[:'item'] - end - - if attributes.key?(:'payment_risk_assessment') - self.payment_risk_assessment = attributes[:'payment_risk_assessment'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @accounts.nil? - invalid_properties.push('invalid value for "accounts", accounts cannot be nil.') - end - - if @item.nil? - invalid_properties.push('invalid value for "item", item cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @accounts.nil? - return false if @item.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - accounts == o.accounts && - item == o.item && - payment_risk_assessment == o.payment_risk_assessment && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [accounts, item, payment_risk_assessment, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/ach_class.rb b/lib/plaid/models/ach_class.rb deleted file mode 100644 index 300f536b7..000000000 --- a/lib/plaid/models/ach_class.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class ACHClass - CCD = "ccd".freeze - PPD = "ppd".freeze - TEL = "tel".freeze - WEB = "web".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/action_state.rb b/lib/plaid/models/action_state.rb deleted file mode 100644 index dc675afb4..000000000 --- a/lib/plaid/models/action_state.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class ActionState - UNKNOWN = "UNKNOWN".freeze - ATTEMPT = "ATTEMPT".freeze - SUCCESS = "SUCCESS".freeze - FAILURE = "FAILURE".freeze - SKIPPED = "SKIPPED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/activity.rb b/lib/plaid/models/activity.rb deleted file mode 100644 index 92f5d7e75..000000000 --- a/lib/plaid/models/activity.rb +++ /dev/null @@ -1,326 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Describes a consent activity. - class Activity - attr_accessor :activity - - # The date this activity was initiated [ISO 8601](https://wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format in UTC. - attr_accessor :initiated_date - - # A unique identifier for the activity - attr_accessor :id - - # Application ID of the client who initiated the activity. - attr_accessor :initiator - - attr_accessor :state - - # This field will map to the application ID that is returned from /item/application/list, or provided to the institution in an oauth redirect. - attr_accessor :target_application_id - - attr_accessor :scopes - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'activity' => :'activity', - :'initiated_date' => :'initiated_date', - :'id' => :'id', - :'initiator' => :'initiator', - :'state' => :'state', - :'target_application_id' => :'target_application_id', - :'scopes' => :'scopes' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'activity' => :'ActivityType', - :'initiated_date' => :'Date', - :'id' => :'String', - :'initiator' => :'String', - :'state' => :'ActionState', - :'target_application_id' => :'String', - :'scopes' => :'ScopesNullable' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'scopes' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Activity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Activity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'activity') - self.activity = attributes[:'activity'] - end - - if attributes.key?(:'initiated_date') - self.initiated_date = attributes[:'initiated_date'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'initiator') - self.initiator = attributes[:'initiator'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'target_application_id') - self.target_application_id = attributes[:'target_application_id'] - end - - if attributes.key?(:'scopes') - self.scopes = attributes[:'scopes'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @activity.nil? - invalid_properties.push('invalid value for "activity", activity cannot be nil.') - end - - if @initiated_date.nil? - invalid_properties.push('invalid value for "initiated_date", initiated_date cannot be nil.') - end - - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @initiator.nil? - invalid_properties.push('invalid value for "initiator", initiator cannot be nil.') - end - - if @state.nil? - invalid_properties.push('invalid value for "state", state cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @activity.nil? - return false if @initiated_date.nil? - return false if @id.nil? - return false if @initiator.nil? - return false if @state.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - activity == o.activity && - initiated_date == o.initiated_date && - id == o.id && - initiator == o.initiator && - state == o.state && - target_application_id == o.target_application_id && - scopes == o.scopes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [activity, initiated_date, id, initiator, state, target_application_id, scopes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/activity_type.rb b/lib/plaid/models/activity_type.rb deleted file mode 100644 index ce70a4ad2..000000000 --- a/lib/plaid/models/activity_type.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class ActivityType - UNKNOWN = "UNKNOWN".freeze - ITEM_CREATE = "ITEM_CREATE".freeze - ITEM_IMPORT = "ITEM_IMPORT".freeze - ITEM_UPDATE = "ITEM_UPDATE".freeze - ITEM_UNLINK = "ITEM_UNLINK".freeze - PORTAL_UNLINK = "PORTAL_UNLINK".freeze - PORTAL_ITEMS_DELETE = "PORTAL_ITEMS_DELETE".freeze - ITEM_REMOVE = "ITEM_REMOVE".freeze - INVARIANT_CHECKER_DELETION = "INVARIANT_CHECKER_DELETION".freeze - SCOPES_UPDATE = "SCOPES_UPDATE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/address.rb b/lib/plaid/models/address.rb deleted file mode 100644 index 2d530384f..000000000 --- a/lib/plaid/models/address.rb +++ /dev/null @@ -1,235 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A physical mailing address. - class Address - attr_accessor :data - - # When `true`, identifies the address as the primary address on an account. - attr_accessor :primary - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'data' => :'data', - :'primary' => :'primary' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'data' => :'AddressData', - :'primary' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Address` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - - if attributes.key?(:'primary') - self.primary = attributes[:'primary'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @data.nil? - invalid_properties.push('invalid value for "data", data cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @data.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - data == o.data && - primary == o.primary - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [data, primary].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/address_data.rb b/lib/plaid/models/address_data.rb deleted file mode 100644 index 0e39d1b17..000000000 --- a/lib/plaid/models/address_data.rb +++ /dev/null @@ -1,270 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data about the components comprising an address. - class AddressData - # The full city name - attr_accessor :city - - # The region or state. In API versions 2018-05-22 and earlier, this field is called `state`. Example: `\"NC\"` - attr_accessor :region - - # The full street address Example: `\"564 Main Street, APT 15\"` - attr_accessor :street - - # The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`. - attr_accessor :postal_code - - # The ISO 3166-1 alpha-2 country code - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'region' => :'region', - :'street' => :'street', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'region' => :'String', - :'street' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'city', - :'region', - :'postal_code', - :'country' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AddressData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AddressData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @street.nil? - invalid_properties.push('invalid value for "street", street cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @street.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - region == o.region && - street == o.street && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, region, street, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/address_data_not_required.rb b/lib/plaid/models/address_data_not_required.rb deleted file mode 100644 index 59b296c97..000000000 --- a/lib/plaid/models/address_data_not_required.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data about the components comprising an address. - class AddressDataNotRequired - # The full city name - attr_accessor :city - - # The region or state. In API versions 2018-05-22 and earlier, this field is called `state`. Example: `\"NC\"` - attr_accessor :region - - # The full street address Example: `\"564 Main Street, APT 15\"` - attr_accessor :street - - # The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`. - attr_accessor :postal_code - - # The ISO 3166-1 alpha-2 country code - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'region' => :'region', - :'street' => :'street', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'region' => :'String', - :'street' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'city', - :'region', - :'postal_code', - :'country' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AddressDataNotRequired` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AddressDataNotRequired`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - region == o.region && - street == o.street && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, region, street, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/address_data_nullable.rb b/lib/plaid/models/address_data_nullable.rb deleted file mode 100644 index fac83fee8..000000000 --- a/lib/plaid/models/address_data_nullable.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data about the components comprising an address. - class AddressDataNullable - # The full city name - attr_accessor :city - - # The region or state. In API versions 2018-05-22 and earlier, this field is called `state`. Example: `\"NC\"` - attr_accessor :region - - # The full street address Example: `\"564 Main Street, APT 15\"` - attr_accessor :street - - # The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`. - attr_accessor :postal_code - - # The ISO 3166-1 alpha-2 country code - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'region' => :'region', - :'street' => :'street', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'region' => :'String', - :'street' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'city', - :'region', - :'postal_code', - :'country' - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'AddressData' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AddressDataNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AddressDataNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @street.nil? - invalid_properties.push('invalid value for "street", street cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @street.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - region == o.region && - street == o.street && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, region, street, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/address_data_nullable_no_required_fields.rb b/lib/plaid/models/address_data_nullable_no_required_fields.rb deleted file mode 100644 index 6c24d4f81..000000000 --- a/lib/plaid/models/address_data_nullable_no_required_fields.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data about the components comprising an address. - class AddressDataNullableNoRequiredFields - # The full city name - attr_accessor :city - - # The region or state. In API versions 2018-05-22 and earlier, this field is called `state`. Example: `\"NC\"` - attr_accessor :region - - # The full street address Example: `\"564 Main Street, APT 15\"` - attr_accessor :street - - # The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`. - attr_accessor :postal_code - - # The ISO 3166-1 alpha-2 country code - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'region' => :'region', - :'street' => :'street', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'region' => :'String', - :'street' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'city', - :'region', - :'postal_code', - :'country' - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'AddressDataNotRequired' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AddressDataNullableNoRequiredFields` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AddressDataNullableNoRequiredFields`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - region == o.region && - street == o.street && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, region, street, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/address_match_score.rb b/lib/plaid/models/address_match_score.rb deleted file mode 100644 index 268475c1e..000000000 --- a/lib/plaid/models/address_match_score.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Score found by matching address provided by the API with the address on the account at the financial institution. The score can range from 0 to 100 where 100 is a perfect match and 0 is a no match. If the account contains multiple owners, the maximum match score is filled. - class AddressMatchScore - # Match score for address. 100 is a perfect match, 99-90 is a strong match, 89-70 is a partial match, anything below 70 is considered a weak match. Typically, the match threshold should be set to a score of 70 or higher. If the address is missing from either the API or financial institution, this is null. - attr_accessor :score - - # postal code was provided for both and was a match - attr_accessor :is_postal_code_match - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'score' => :'score', - :'is_postal_code_match' => :'is_postal_code_match' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'score' => :'Integer', - :'is_postal_code_match' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'score', - :'is_postal_code_match' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AddressMatchScore` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AddressMatchScore`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'score') - self.score = attributes[:'score'] - end - - if attributes.key?(:'is_postal_code_match') - self.is_postal_code_match = attributes[:'is_postal_code_match'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - score == o.score && - is_postal_code_match == o.is_postal_code_match - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [score, is_postal_code_match].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/address_nullable.rb b/lib/plaid/models/address_nullable.rb deleted file mode 100644 index 35551f75b..000000000 --- a/lib/plaid/models/address_nullable.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A physical mailing address. - class AddressNullable - attr_accessor :data - - # When `true`, identifies the address as the primary address on an account. - attr_accessor :primary - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'data' => :'data', - :'primary' => :'primary' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'data' => :'AddressData', - :'primary' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'Address' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AddressNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AddressNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - - if attributes.key?(:'primary') - self.primary = attributes[:'primary'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @data.nil? - invalid_properties.push('invalid value for "data", data cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @data.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - data == o.data && - primary == o.primary - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [data, primary].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/address_purpose_label.rb b/lib/plaid/models/address_purpose_label.rb deleted file mode 100644 index 0bd3dcad6..000000000 --- a/lib/plaid/models/address_purpose_label.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class AddressPurposeLabel - RESIDENTIAL = "residential".freeze - COMMERCIAL = "commercial".freeze - NO_DATA = "no_data".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/application.rb b/lib/plaid/models/application.rb deleted file mode 100644 index f313de841..000000000 --- a/lib/plaid/models/application.rb +++ /dev/null @@ -1,366 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Metadata about the application - class Application - # This field will map to the application ID that is returned from /item/application/list, or provided to the institution in an oauth redirect. - attr_accessor :application_id - - # The name of the application - attr_accessor :name - - # A human-readable name of the application for display purposes - attr_accessor :display_name - - # The date this application was granted production access at Plaid in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format in UTC. - attr_accessor :join_date - - # A URL that links to the application logo image. - attr_accessor :logo_url - - # The URL for the application's website - attr_accessor :application_url - - # A string provided by the connected app stating why they use their respective enabled products. - attr_accessor :reason_for_access - - # A string representing client’s broad use case as assessed by Plaid. - attr_accessor :use_case - - # A string representing the name of client’s legal entity. - attr_accessor :company_legal_name - - # A string representing the city of the client’s headquarters. - attr_accessor :city - - # A string representing the region of the client’s headquarters. - attr_accessor :region - - # A string representing the postal code of the client’s headquarters. - attr_accessor :postal_code - - # A string representing the country code of the client’s headquarters. - attr_accessor :country_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'application_id' => :'application_id', - :'name' => :'name', - :'display_name' => :'display_name', - :'join_date' => :'join_date', - :'logo_url' => :'logo_url', - :'application_url' => :'application_url', - :'reason_for_access' => :'reason_for_access', - :'use_case' => :'use_case', - :'company_legal_name' => :'company_legal_name', - :'city' => :'city', - :'region' => :'region', - :'postal_code' => :'postal_code', - :'country_code' => :'country_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'application_id' => :'String', - :'name' => :'String', - :'display_name' => :'String', - :'join_date' => :'Date', - :'logo_url' => :'String', - :'application_url' => :'String', - :'reason_for_access' => :'String', - :'use_case' => :'String', - :'company_legal_name' => :'String', - :'city' => :'String', - :'region' => :'String', - :'postal_code' => :'String', - :'country_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'display_name', - :'logo_url', - :'application_url', - :'reason_for_access', - :'use_case', - :'company_legal_name', - :'city', - :'region', - :'postal_code', - :'country_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Application` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Application`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'join_date') - self.join_date = attributes[:'join_date'] - end - - if attributes.key?(:'logo_url') - self.logo_url = attributes[:'logo_url'] - end - - if attributes.key?(:'application_url') - self.application_url = attributes[:'application_url'] - end - - if attributes.key?(:'reason_for_access') - self.reason_for_access = attributes[:'reason_for_access'] - end - - if attributes.key?(:'use_case') - self.use_case = attributes[:'use_case'] - end - - if attributes.key?(:'company_legal_name') - self.company_legal_name = attributes[:'company_legal_name'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @application_id.nil? - invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @join_date.nil? - invalid_properties.push('invalid value for "join_date", join_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @application_id.nil? - return false if @name.nil? - return false if @join_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - application_id == o.application_id && - name == o.name && - display_name == o.display_name && - join_date == o.join_date && - logo_url == o.logo_url && - application_url == o.application_url && - reason_for_access == o.reason_for_access && - use_case == o.use_case && - company_legal_name == o.company_legal_name && - city == o.city && - region == o.region && - postal_code == o.postal_code && - country_code == o.country_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [application_id, name, display_name, join_date, logo_url, application_url, reason_for_access, use_case, company_legal_name, city, region, postal_code, country_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/application_get_request.rb b/lib/plaid/models/application_get_request.rb deleted file mode 100644 index b1a90254e..000000000 --- a/lib/plaid/models/application_get_request.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ApplicationGetRequest defines the schema for `/application/get` - class ApplicationGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # This field will map to the application ID that is returned from /item/application/list, or provided to the institution in an oauth redirect. - attr_accessor :application_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'application_id' => :'application_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'application_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ApplicationGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ApplicationGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @client_id.nil? - invalid_properties.push('invalid value for "client_id", client_id cannot be nil.') - end - - if @secret.nil? - invalid_properties.push('invalid value for "secret", secret cannot be nil.') - end - - if @application_id.nil? - invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @client_id.nil? - return false if @secret.nil? - return false if @application_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - application_id == o.application_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, application_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/application_get_response.rb b/lib/plaid/models/application_get_response.rb deleted file mode 100644 index 05b6c49b8..000000000 --- a/lib/plaid/models/application_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ApplicationGetResponse defines the response schema for `/application/get` - class ApplicationGetResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - attr_accessor :application - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id', - :'application' => :'application' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String', - :'application' => :'Application' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ApplicationGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ApplicationGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'application') - self.application = attributes[:'application'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - if @application.nil? - invalid_properties.push('invalid value for "application", application cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - return false if @application.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id && - application == o.application - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id, application].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/apr.rb b/lib/plaid/models/apr.rb deleted file mode 100644 index e7f63de69..000000000 --- a/lib/plaid/models/apr.rb +++ /dev/null @@ -1,297 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the APR on the account. - class APR - # Annual Percentage Rate applied. - attr_accessor :apr_percentage - - # The type of balance to which the APR applies. - attr_accessor :apr_type - - # Amount of money that is subjected to the APR if a balance was carried beyond payment due date. How it is calculated can vary by card issuer. It is often calculated as an average daily balance. - attr_accessor :balance_subject_to_apr - - # Amount of money charged due to interest from last statement. - attr_accessor :interest_charge_amount - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'apr_percentage' => :'apr_percentage', - :'apr_type' => :'apr_type', - :'balance_subject_to_apr' => :'balance_subject_to_apr', - :'interest_charge_amount' => :'interest_charge_amount' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'apr_percentage' => :'Float', - :'apr_type' => :'String', - :'balance_subject_to_apr' => :'Float', - :'interest_charge_amount' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'balance_subject_to_apr', - :'interest_charge_amount' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::APR` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::APR`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'apr_percentage') - self.apr_percentage = attributes[:'apr_percentage'] - end - - if attributes.key?(:'apr_type') - self.apr_type = attributes[:'apr_type'] - end - - if attributes.key?(:'balance_subject_to_apr') - self.balance_subject_to_apr = attributes[:'balance_subject_to_apr'] - end - - if attributes.key?(:'interest_charge_amount') - self.interest_charge_amount = attributes[:'interest_charge_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @apr_percentage.nil? - invalid_properties.push('invalid value for "apr_percentage", apr_percentage cannot be nil.') - end - - if @apr_type.nil? - invalid_properties.push('invalid value for "apr_type", apr_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @apr_percentage.nil? - return false if @apr_type.nil? - apr_type_validator = EnumAttributeValidator.new('String', ["balance_transfer_apr", "cash_apr", "purchase_apr", "special"]) - return false unless apr_type_validator.valid?(@apr_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] apr_type Object to be assigned - def apr_type=(apr_type) - validator = EnumAttributeValidator.new('String', ["balance_transfer_apr", "cash_apr", "purchase_apr", "special"]) - unless validator.valid?(apr_type) - fail ArgumentError, "invalid value for \"apr_type\", must be one of #{validator.allowable_values}." - end - @apr_type = apr_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - apr_percentage == o.apr_percentage && - apr_type == o.apr_type && - balance_subject_to_apr == o.balance_subject_to_apr && - interest_charge_amount == o.interest_charge_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [apr_percentage, apr_type, balance_subject_to_apr, interest_charge_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset.rb b/lib/plaid/models/asset.rb deleted file mode 100644 index a8889d42d..000000000 --- a/lib/plaid/models/asset.rb +++ /dev/null @@ -1,281 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class Asset - attr_accessor :asset_detail - - attr_accessor :asset_owners - - attr_accessor :asset_holder - - attr_accessor :asset_transactions - - attr_accessor :validation_sources - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_detail' => :'ASSET_DETAIL', - :'asset_owners' => :'ASSET_OWNERS', - :'asset_holder' => :'ASSET_HOLDER', - :'asset_transactions' => :'ASSET_TRANSACTIONS', - :'validation_sources' => :'VALIDATION_SOURCES' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_detail' => :'AssetDetail', - :'asset_owners' => :'AssetOwners', - :'asset_holder' => :'AssetHolder', - :'asset_transactions' => :'AssetTransactions', - :'validation_sources' => :'ValidationSources' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Asset` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Asset`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_detail') - self.asset_detail = attributes[:'asset_detail'] - end - - if attributes.key?(:'asset_owners') - self.asset_owners = attributes[:'asset_owners'] - end - - if attributes.key?(:'asset_holder') - self.asset_holder = attributes[:'asset_holder'] - end - - if attributes.key?(:'asset_transactions') - self.asset_transactions = attributes[:'asset_transactions'] - end - - if attributes.key?(:'validation_sources') - self.validation_sources = attributes[:'validation_sources'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_detail.nil? - invalid_properties.push('invalid value for "asset_detail", asset_detail cannot be nil.') - end - - if @asset_owners.nil? - invalid_properties.push('invalid value for "asset_owners", asset_owners cannot be nil.') - end - - if @asset_holder.nil? - invalid_properties.push('invalid value for "asset_holder", asset_holder cannot be nil.') - end - - if @asset_transactions.nil? - invalid_properties.push('invalid value for "asset_transactions", asset_transactions cannot be nil.') - end - - if @validation_sources.nil? - invalid_properties.push('invalid value for "validation_sources", validation_sources cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_detail.nil? - return false if @asset_owners.nil? - return false if @asset_holder.nil? - return false if @asset_transactions.nil? - return false if @validation_sources.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_detail == o.asset_detail && - asset_owners == o.asset_owners && - asset_holder == o.asset_holder && - asset_transactions == o.asset_transactions && - validation_sources == o.validation_sources - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_detail, asset_owners, asset_holder, asset_transactions, validation_sources].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_detail.rb b/lib/plaid/models/asset_detail.rb deleted file mode 100644 index d1669b3e6..000000000 --- a/lib/plaid/models/asset_detail.rb +++ /dev/null @@ -1,370 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Details about an asset. - class AssetDetail - # A vendor created unique Identifier. - attr_accessor :asset_unique_identifier - - # A unique alphanumeric string identifying an asset. - attr_accessor :asset_account_identifier - - # Account Report As of Date / Create Date. Format YYYY-MM-DD - attr_accessor :asset_as_of_date - - # A text description that further defines the Asset. This could be used to describe the shares associated with the stocks, bonds or mutual funds, retirement funds or business owned that the borrower has disclosed (named) as an asset. - attr_accessor :asset_description - - # Asset Account Available Balance. - attr_accessor :asset_available_balance_amount - - # A vendor created unique Identifier - attr_accessor :asset_current_balance_amount - - attr_accessor :asset_type - - # 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. - attr_accessor :asset_type_additional_description - - # The Number of days requested made to the Financial Institution. Example When looking for 3 months of data from the FI, pass in 90 days. - attr_accessor :asset_days_requested_count - - # Ownership type of the asset account. - attr_accessor :asset_ownership_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_unique_identifier' => :'AssetUniqueIdentifier', - :'asset_account_identifier' => :'AssetAccountIdentifier', - :'asset_as_of_date' => :'AssetAsOfDate', - :'asset_description' => :'AssetDescription', - :'asset_available_balance_amount' => :'AssetAvailableBalanceAmount', - :'asset_current_balance_amount' => :'AssetCurrentBalanceAmount', - :'asset_type' => :'AssetType', - :'asset_type_additional_description' => :'AssetTypeAdditionalDescription', - :'asset_days_requested_count' => :'AssetDaysRequestedCount', - :'asset_ownership_type' => :'AssetOwnershipType' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_unique_identifier' => :'String', - :'asset_account_identifier' => :'String', - :'asset_as_of_date' => :'String', - :'asset_description' => :'String', - :'asset_available_balance_amount' => :'Float', - :'asset_current_balance_amount' => :'Float', - :'asset_type' => :'AssetType', - :'asset_type_additional_description' => :'String', - :'asset_days_requested_count' => :'Integer', - :'asset_ownership_type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'asset_description', - :'asset_type_additional_description', - :'asset_ownership_type' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_unique_identifier') - self.asset_unique_identifier = attributes[:'asset_unique_identifier'] - end - - if attributes.key?(:'asset_account_identifier') - self.asset_account_identifier = attributes[:'asset_account_identifier'] - end - - if attributes.key?(:'asset_as_of_date') - self.asset_as_of_date = attributes[:'asset_as_of_date'] - end - - if attributes.key?(:'asset_description') - self.asset_description = attributes[:'asset_description'] - end - - if attributes.key?(:'asset_available_balance_amount') - self.asset_available_balance_amount = attributes[:'asset_available_balance_amount'] - end - - if attributes.key?(:'asset_current_balance_amount') - self.asset_current_balance_amount = attributes[:'asset_current_balance_amount'] - end - - if attributes.key?(:'asset_type') - self.asset_type = attributes[:'asset_type'] - end - - if attributes.key?(:'asset_type_additional_description') - self.asset_type_additional_description = attributes[:'asset_type_additional_description'] - end - - if attributes.key?(:'asset_days_requested_count') - self.asset_days_requested_count = attributes[:'asset_days_requested_count'] - end - - if attributes.key?(:'asset_ownership_type') - self.asset_ownership_type = attributes[:'asset_ownership_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_unique_identifier.nil? - invalid_properties.push('invalid value for "asset_unique_identifier", asset_unique_identifier cannot be nil.') - end - - if @asset_account_identifier.nil? - invalid_properties.push('invalid value for "asset_account_identifier", asset_account_identifier cannot be nil.') - end - - if @asset_as_of_date.nil? - invalid_properties.push('invalid value for "asset_as_of_date", asset_as_of_date cannot be nil.') - end - - if @asset_available_balance_amount.nil? - invalid_properties.push('invalid value for "asset_available_balance_amount", asset_available_balance_amount cannot be nil.') - end - - if @asset_current_balance_amount.nil? - invalid_properties.push('invalid value for "asset_current_balance_amount", asset_current_balance_amount cannot be nil.') - end - - if @asset_type.nil? - invalid_properties.push('invalid value for "asset_type", asset_type cannot be nil.') - end - - if @asset_days_requested_count.nil? - invalid_properties.push('invalid value for "asset_days_requested_count", asset_days_requested_count cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_unique_identifier.nil? - return false if @asset_account_identifier.nil? - return false if @asset_as_of_date.nil? - return false if @asset_available_balance_amount.nil? - return false if @asset_current_balance_amount.nil? - return false if @asset_type.nil? - return false if @asset_days_requested_count.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_unique_identifier == o.asset_unique_identifier && - asset_account_identifier == o.asset_account_identifier && - asset_as_of_date == o.asset_as_of_date && - asset_description == o.asset_description && - asset_available_balance_amount == o.asset_available_balance_amount && - asset_current_balance_amount == o.asset_current_balance_amount && - asset_type == o.asset_type && - asset_type_additional_description == o.asset_type_additional_description && - asset_days_requested_count == o.asset_days_requested_count && - asset_ownership_type == o.asset_ownership_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_unique_identifier, asset_account_identifier, asset_as_of_date, asset_description, asset_available_balance_amount, asset_current_balance_amount, asset_type, asset_type_additional_description, asset_days_requested_count, asset_ownership_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_holder.rb b/lib/plaid/models/asset_holder.rb deleted file mode 100644 index 8f4f5aea1..000000000 --- a/lib/plaid/models/asset_holder.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class AssetHolder - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'NAME' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'AssetHolderName' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetHolder` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetHolder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_holder_name.rb b/lib/plaid/models/asset_holder_name.rb deleted file mode 100644 index 12db68b96..000000000 --- a/lib/plaid/models/asset_holder_name.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class AssetHolderName - # The unparsed name of either an individual or a legal entity. - attr_accessor :full_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'full_name' => :'FullName' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'full_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetHolderName` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetHolderName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'full_name') - self.full_name = attributes[:'full_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @full_name.nil? - invalid_properties.push('invalid value for "full_name", full_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @full_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - full_name == o.full_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [full_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_owner.rb b/lib/plaid/models/asset_owner.rb deleted file mode 100644 index 31f12dd03..000000000 --- a/lib/plaid/models/asset_owner.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class AssetOwner - # Account Owner Full Name. - attr_accessor :asset_owner_text - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_owner_text' => :'AssetOwnerText' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_owner_text' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'asset_owner_text' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetOwner` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetOwner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_owner_text') - self.asset_owner_text = attributes[:'asset_owner_text'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_owner_text == o.asset_owner_text - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_owner_text].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_owners.rb b/lib/plaid/models/asset_owners.rb deleted file mode 100644 index 96b01de40..000000000 --- a/lib/plaid/models/asset_owners.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class AssetOwners - # Multiple Occurances of Account Owners Full Name up to 4. - attr_accessor :asset_owner - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_owner' => :'ASSET_OWNER' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_owner' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetOwners` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetOwners`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_owner') - if (value = attributes[:'asset_owner']).is_a?(Array) - self.asset_owner = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_owner.nil? - invalid_properties.push('invalid value for "asset_owner", asset_owner cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_owner.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_owner == o.asset_owner - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_owner].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report.rb b/lib/plaid/models/asset_report.rb deleted file mode 100644 index 3f395b1c4..000000000 --- a/lib/plaid/models/asset_report.rb +++ /dev/null @@ -1,298 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing an Asset Report - class AssetReport - # A unique ID identifying an Asset Report. Like all Plaid identifiers, this ID is case sensitive. - attr_accessor :asset_report_id - - # An identifier you determine and submit for the Asset Report. - attr_accessor :client_report_id - - # The date and time when the Asset Report was created, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (e.g. \"2018-04-12T03:32:11Z\"). - attr_accessor :date_generated - - # The duration of transaction history you requested - attr_accessor :days_requested - - attr_accessor :user - - # Data returned by Plaid about each of the Items included in the Asset Report. - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_report_id' => :'asset_report_id', - :'client_report_id' => :'client_report_id', - :'date_generated' => :'date_generated', - :'days_requested' => :'days_requested', - :'user' => :'user', - :'items' => :'items' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_report_id' => :'String', - :'client_report_id' => :'String', - :'date_generated' => :'Time', - :'days_requested' => :'Float', - :'user' => :'AssetReportUser', - :'items' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'client_report_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReport` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_report_id') - self.asset_report_id = attributes[:'asset_report_id'] - end - - if attributes.key?(:'client_report_id') - self.client_report_id = attributes[:'client_report_id'] - end - - if attributes.key?(:'date_generated') - self.date_generated = attributes[:'date_generated'] - end - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_report_id.nil? - invalid_properties.push('invalid value for "asset_report_id", asset_report_id cannot be nil.') - end - - if @date_generated.nil? - invalid_properties.push('invalid value for "date_generated", date_generated cannot be nil.') - end - - if @days_requested.nil? - invalid_properties.push('invalid value for "days_requested", days_requested cannot be nil.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_report_id.nil? - return false if @date_generated.nil? - return false if @days_requested.nil? - return false if @user.nil? - return false if @items.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_report_id == o.asset_report_id && - client_report_id == o.client_report_id && - date_generated == o.date_generated && - days_requested == o.days_requested && - user == o.user && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_report_id, client_report_id, date_generated, days_requested, user, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_account_balance.rb b/lib/plaid/models/asset_report_account_balance.rb deleted file mode 100644 index fa65c6cd6..000000000 --- a/lib/plaid/models/asset_report_account_balance.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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`. - class 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`. - attr_accessor :available - - # 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`. - attr_accessor :current - - # 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. - attr_accessor :limit - - # 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. - attr_accessor :margin_loan_amount - - # The ISO-4217 currency code of the balance. Always null if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - # 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. 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. - attr_accessor :last_updated_datetime - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'available' => :'available', - :'current' => :'current', - :'limit' => :'limit', - :'margin_loan_amount' => :'margin_loan_amount', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'last_updated_datetime' => :'last_updated_datetime' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'available' => :'Float', - :'current' => :'Float', - :'limit' => :'Float', - :'margin_loan_amount' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'last_updated_datetime' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'available', - :'current', - :'limit', - :'margin_loan_amount', - :'iso_currency_code', - :'unofficial_currency_code', - :'last_updated_datetime' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportAccountBalance` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportAccountBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'available') - self.available = attributes[:'available'] - end - - if attributes.key?(:'current') - self.current = attributes[:'current'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'margin_loan_amount') - self.margin_loan_amount = attributes[:'margin_loan_amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'last_updated_datetime') - self.last_updated_datetime = attributes[:'last_updated_datetime'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - available == o.available && - current == o.current && - limit == o.limit && - margin_loan_amount == o.margin_loan_amount && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - last_updated_datetime == o.last_updated_datetime - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [available, current, limit, margin_loan_amount, iso_currency_code, unofficial_currency_code, last_updated_datetime].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_add_ons.rb b/lib/plaid/models/asset_report_add_ons.rb deleted file mode 100644 index 0b868be30..000000000 --- a/lib/plaid/models/asset_report_add_ons.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class AssetReportAddOns - INVESTMENTS = "investments".freeze - FAST_ASSETS = "fast_assets".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/asset_report_audit_copy_create_request.rb b/lib/plaid/models/asset_report_audit_copy_create_request.rb deleted file mode 100644 index b21e82f76..000000000 --- a/lib/plaid/models/asset_report_audit_copy_create_request.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportAuditCopyCreateRequest defines the request schema for `/asset_report/audit_copy/get` - class AssetReportAuditCopyCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A token that can be provided to endpoints such as `/asset_report/get` or `/asset_report/pdf/get` to fetch or update an Asset Report. - attr_accessor :asset_report_token - - # The `auditor_id` of the third party with whom you would like to share the Asset Report. - attr_accessor :auditor_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'asset_report_token' => :'asset_report_token', - :'auditor_id' => :'auditor_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'asset_report_token' => :'String', - :'auditor_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportAuditCopyCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportAuditCopyCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'asset_report_token') - self.asset_report_token = attributes[:'asset_report_token'] - end - - if attributes.key?(:'auditor_id') - self.auditor_id = attributes[:'auditor_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_report_token.nil? - invalid_properties.push('invalid value for "asset_report_token", asset_report_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_report_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - asset_report_token == o.asset_report_token && - auditor_id == o.auditor_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, asset_report_token, auditor_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_audit_copy_create_response.rb b/lib/plaid/models/asset_report_audit_copy_create_response.rb deleted file mode 100644 index a2299aa50..000000000 --- a/lib/plaid/models/asset_report_audit_copy_create_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportAuditCopyCreateResponse defines the response schema for `/asset_report/audit_copy/get` - class AssetReportAuditCopyCreateResponse - # A token that can be shared with a third party auditor to allow them to obtain access to the Asset Report. This token should be stored securely. - attr_accessor :audit_copy_token - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'audit_copy_token' => :'audit_copy_token', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'audit_copy_token' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportAuditCopyCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportAuditCopyCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'audit_copy_token') - self.audit_copy_token = attributes[:'audit_copy_token'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @audit_copy_token.nil? - invalid_properties.push('invalid value for "audit_copy_token", audit_copy_token cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @audit_copy_token.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - audit_copy_token == o.audit_copy_token && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [audit_copy_token, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_audit_copy_get_request.rb b/lib/plaid/models/asset_report_audit_copy_get_request.rb deleted file mode 100644 index 0c0481549..000000000 --- a/lib/plaid/models/asset_report_audit_copy_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportAuditCopyGetRequest defines the request schema for `/asset_report/audit_copy/get` - class AssetReportAuditCopyGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The `audit_copy_token` granting access to the Audit Copy you would like to get. - attr_accessor :audit_copy_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'audit_copy_token' => :'audit_copy_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'audit_copy_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportAuditCopyGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportAuditCopyGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'audit_copy_token') - self.audit_copy_token = attributes[:'audit_copy_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @audit_copy_token.nil? - invalid_properties.push('invalid value for "audit_copy_token", audit_copy_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @audit_copy_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - audit_copy_token == o.audit_copy_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, audit_copy_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_audit_copy_remove_request.rb b/lib/plaid/models/asset_report_audit_copy_remove_request.rb deleted file mode 100644 index bdb487e34..000000000 --- a/lib/plaid/models/asset_report_audit_copy_remove_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportAuditCopyRemoveRequest defines the request schema for `/asset_report/audit_copy/remove` - class AssetReportAuditCopyRemoveRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The `audit_copy_token` granting access to the Audit Copy you would like to revoke. - attr_accessor :audit_copy_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'audit_copy_token' => :'audit_copy_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'audit_copy_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportAuditCopyRemoveRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportAuditCopyRemoveRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'audit_copy_token') - self.audit_copy_token = attributes[:'audit_copy_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @audit_copy_token.nil? - invalid_properties.push('invalid value for "audit_copy_token", audit_copy_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @audit_copy_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - audit_copy_token == o.audit_copy_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, audit_copy_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_audit_copy_remove_response.rb b/lib/plaid/models/asset_report_audit_copy_remove_response.rb deleted file mode 100644 index 81bf4d3bf..000000000 --- a/lib/plaid/models/asset_report_audit_copy_remove_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportAuditCopyRemoveResponse defines the response schema for `/asset_report/audit_copy/remove` - class AssetReportAuditCopyRemoveResponse - # `true` if the Audit Copy was successfully removed. - attr_accessor :removed - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'removed' => :'removed', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'removed' => :'Boolean', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportAuditCopyRemoveResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportAuditCopyRemoveResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'removed') - self.removed = attributes[:'removed'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @removed.nil? - invalid_properties.push('invalid value for "removed", removed cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @removed.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - removed == o.removed && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [removed, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_create_request.rb b/lib/plaid/models/asset_report_create_request.rb deleted file mode 100644 index fd2e5b537..000000000 --- a/lib/plaid/models/asset_report_create_request.rb +++ /dev/null @@ -1,315 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportCreateRequest defines the request schema for `/asset_report/create` - class AssetReportCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # An array of access tokens corresponding to the Items that will be included in the report. The `assets` product must have been initialized for the Items during link; the Assets product cannot be added after initialization. - attr_accessor :access_tokens - - # The maximum integer number of days of history to include in the Asset Report. If using Fannie Mae Day 1 Certainty, `days_requested` must be at least 61 for new originations or at least 31 for refinancings. An Asset Report requested with \"Additional History\" (that is, with more than 61 days of transaction history) will incur an Additional History fee. - attr_accessor :days_requested - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_tokens' => :'access_tokens', - :'days_requested' => :'days_requested', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_tokens' => :'Array', - :'days_requested' => :'Integer', - :'options' => :'AssetReportCreateRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_tokens') - if (value = attributes[:'access_tokens']).is_a?(Array) - self.access_tokens = value - end - end - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - - if !@access_tokens.nil? && @access_tokens.length < 1 - invalid_properties.push('invalid value for "access_tokens", number of items must be greater than or equal to 1.') - end - - if @days_requested.nil? - invalid_properties.push('invalid value for "days_requested", days_requested cannot be nil.') - end - - if @days_requested > 731 - invalid_properties.push('invalid value for "days_requested", must be smaller than or equal to 731.') - end - - if @days_requested < 0 - invalid_properties.push('invalid value for "days_requested", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@access_tokens.nil? && @access_tokens.length > 99 - return false if !@access_tokens.nil? && @access_tokens.length < 1 - return false if @days_requested.nil? - return false if @days_requested > 731 - return false if @days_requested < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] access_tokens Value to be assigned - def access_tokens=(access_tokens) - - if !access_tokens.nil? && access_tokens.length < 1 - fail ArgumentError, 'invalid value for "access_tokens", number of items must be greater than or equal to 1.' - end - - @access_tokens = access_tokens - end - - # Custom attribute writer method with validation - # @param [Object] days_requested Value to be assigned - def days_requested=(days_requested) - if days_requested.nil? - fail ArgumentError, 'days_requested cannot be nil' - end - - if days_requested > 731 - fail ArgumentError, 'invalid value for "days_requested", must be smaller than or equal to 731.' - end - - if days_requested < 0 - fail ArgumentError, 'invalid value for "days_requested", must be greater than or equal to 0.' - end - - - @days_requested = days_requested - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_tokens == o.access_tokens && - days_requested == o.days_requested && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_tokens, days_requested, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_create_request_options.rb b/lib/plaid/models/asset_report_create_request_options.rb deleted file mode 100644 index c0e2a8192..000000000 --- a/lib/plaid/models/asset_report_create_request_options.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class AssetReportCreateRequestOptions - # Client-generated identifier, which can be used by lenders to track loan applications. - attr_accessor :client_report_id - - # URL to which Plaid will send Assets webhooks, for example when the requested Asset Report is ready. - attr_accessor :webhook - - # true to return balance and identity earlier as a fast report. Defaults to false if omitted. - attr_accessor :include_fast_report - - # Additional information that can be included in the asset report. Possible values: `\"investments\"` - attr_accessor :products - - # 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. - attr_accessor :add_ons - - attr_accessor :user - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_report_id' => :'client_report_id', - :'webhook' => :'webhook', - :'include_fast_report' => :'include_fast_report', - :'products' => :'products', - :'add_ons' => :'add_ons', - :'user' => :'user' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_report_id' => :'String', - :'webhook' => :'String', - :'include_fast_report' => :'Boolean', - :'products' => :'Array', - :'add_ons' => :'Array', - :'user' => :'AssetReportUser' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'client_report_id', - :'webhook', - :'include_fast_report', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportCreateRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportCreateRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_report_id') - self.client_report_id = attributes[:'client_report_id'] - end - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - - if attributes.key?(:'include_fast_report') - self.include_fast_report = attributes[:'include_fast_report'] - end - - if attributes.key?(:'products') - if (value = attributes[:'products']).is_a?(Array) - self.products = value - end - end - - if attributes.key?(:'add_ons') - if (value = attributes[:'add_ons']).is_a?(Array) - self.add_ons = value - end - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_report_id == o.client_report_id && - webhook == o.webhook && - include_fast_report == o.include_fast_report && - products == o.products && - add_ons == o.add_ons && - user == o.user - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_report_id, webhook, include_fast_report, products, add_ons, user].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_create_response.rb b/lib/plaid/models/asset_report_create_response.rb deleted file mode 100644 index a81ff2afe..000000000 --- a/lib/plaid/models/asset_report_create_response.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportCreateResponse defines the response schema for `/asset_report/create` - class AssetReportCreateResponse - # A token that can be provided to endpoints such as `/asset_report/get` or `/asset_report/pdf/get` to fetch or update an Asset Report. - attr_accessor :asset_report_token - - # A unique ID identifying an Asset Report. Like all Plaid identifiers, this ID is case sensitive. - attr_accessor :asset_report_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_report_token' => :'asset_report_token', - :'asset_report_id' => :'asset_report_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_report_token' => :'String', - :'asset_report_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_report_token') - self.asset_report_token = attributes[:'asset_report_token'] - end - - if attributes.key?(:'asset_report_id') - self.asset_report_id = attributes[:'asset_report_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_report_token.nil? - invalid_properties.push('invalid value for "asset_report_token", asset_report_token cannot be nil.') - end - - if @asset_report_id.nil? - invalid_properties.push('invalid value for "asset_report_id", asset_report_id cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_report_token.nil? - return false if @asset_report_id.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_report_token == o.asset_report_token && - asset_report_id == o.asset_report_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_report_token, asset_report_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_filter_request.rb b/lib/plaid/models/asset_report_filter_request.rb deleted file mode 100644 index 3b5b8b730..000000000 --- a/lib/plaid/models/asset_report_filter_request.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportFilterRequest defines the request schema for `/asset_report/filter` - class AssetReportFilterRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A token that can be provided to endpoints such as `/asset_report/get` or `/asset_report/pdf/get` to fetch or update an Asset Report. - attr_accessor :asset_report_token - - # The accounts to exclude from the Asset Report, identified by `account_id`. - attr_accessor :account_ids_to_exclude - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'asset_report_token' => :'asset_report_token', - :'account_ids_to_exclude' => :'account_ids_to_exclude' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'asset_report_token' => :'String', - :'account_ids_to_exclude' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportFilterRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportFilterRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'asset_report_token') - self.asset_report_token = attributes[:'asset_report_token'] - end - - if attributes.key?(:'account_ids_to_exclude') - if (value = attributes[:'account_ids_to_exclude']).is_a?(Array) - self.account_ids_to_exclude = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_report_token.nil? - invalid_properties.push('invalid value for "asset_report_token", asset_report_token cannot be nil.') - end - - if @account_ids_to_exclude.nil? - invalid_properties.push('invalid value for "account_ids_to_exclude", account_ids_to_exclude cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_report_token.nil? - return false if @account_ids_to_exclude.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - asset_report_token == o.asset_report_token && - account_ids_to_exclude == o.account_ids_to_exclude - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, asset_report_token, account_ids_to_exclude].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_filter_response.rb b/lib/plaid/models/asset_report_filter_response.rb deleted file mode 100644 index 5c26aafcf..000000000 --- a/lib/plaid/models/asset_report_filter_response.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportFilterResponse defines the response schema for `/asset_report/filter` - class AssetReportFilterResponse - # A token that can be provided to endpoints such as `/asset_report/get` or `/asset_report/pdf/get` to fetch or update an Asset Report. - attr_accessor :asset_report_token - - # A unique ID identifying an Asset Report. Like all Plaid identifiers, this ID is case sensitive. - attr_accessor :asset_report_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_report_token' => :'asset_report_token', - :'asset_report_id' => :'asset_report_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_report_token' => :'String', - :'asset_report_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportFilterResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportFilterResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_report_token') - self.asset_report_token = attributes[:'asset_report_token'] - end - - if attributes.key?(:'asset_report_id') - self.asset_report_id = attributes[:'asset_report_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_report_token.nil? - invalid_properties.push('invalid value for "asset_report_token", asset_report_token cannot be nil.') - end - - if @asset_report_id.nil? - invalid_properties.push('invalid value for "asset_report_id", asset_report_id cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_report_token.nil? - return false if @asset_report_id.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_report_token == o.asset_report_token && - asset_report_id == o.asset_report_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_report_token, asset_report_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_freddie.rb b/lib/plaid/models/asset_report_freddie.rb deleted file mode 100644 index 48de1c6f9..000000000 --- a/lib/plaid/models/asset_report_freddie.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing an Asset Report with Freddie Mac schema. - class AssetReportFreddie - attr_accessor :loans - - attr_accessor :parties - - attr_accessor :services - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'loans' => :'LOANS', - :'parties' => :'PARTIES', - :'services' => :'SERVICES' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'loans' => :'Loans', - :'parties' => :'Parties', - :'services' => :'Services' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportFreddie` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportFreddie`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'loans') - self.loans = attributes[:'loans'] - end - - if attributes.key?(:'parties') - self.parties = attributes[:'parties'] - end - - if attributes.key?(:'services') - self.services = attributes[:'services'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @loans.nil? - invalid_properties.push('invalid value for "loans", loans cannot be nil.') - end - - if @parties.nil? - invalid_properties.push('invalid value for "parties", parties cannot be nil.') - end - - if @services.nil? - invalid_properties.push('invalid value for "services", services cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @loans.nil? - return false if @parties.nil? - return false if @services.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - loans == o.loans && - parties == o.parties && - services == o.services - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [loans, parties, services].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_freddie_get_request.rb b/lib/plaid/models/asset_report_freddie_get_request.rb deleted file mode 100644 index e0618fa1b..000000000 --- a/lib/plaid/models/asset_report_freddie_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportFreddieGetRequest defines the request schema for `credit/asset_report/freddie_mac/get` - class AssetReportFreddieGetRequest - # A token that can be shared with a third party auditor to allow them to obtain access to the Asset Report. This token should be stored securely. - attr_accessor :audit_copy_token - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'audit_copy_token' => :'audit_copy_token', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'audit_copy_token' => :'String', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportFreddieGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportFreddieGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'audit_copy_token') - self.audit_copy_token = attributes[:'audit_copy_token'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @audit_copy_token.nil? - invalid_properties.push('invalid value for "audit_copy_token", audit_copy_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @audit_copy_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - audit_copy_token == o.audit_copy_token && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [audit_copy_token, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_freddie_get_response.rb b/lib/plaid/models/asset_report_freddie_get_response.rb deleted file mode 100644 index cb635e2b0..000000000 --- a/lib/plaid/models/asset_report_freddie_get_response.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportFreddieGetResponse defines the response schema for `/asset_report/get` - class AssetReportFreddieGetResponse - attr_accessor :deal - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # The Verification Of Assets (aka VOA or Freddie Mac Schema) schema version. - attr_accessor :schema_version - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deal' => :'DEAL', - :'request_id' => :'request_id', - :'schema_version' => :'SchemaVersion' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deal' => :'AssetReportFreddie', - :'request_id' => :'String', - :'schema_version' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportFreddieGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportFreddieGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deal') - self.deal = attributes[:'deal'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'schema_version') - self.schema_version = attributes[:'schema_version'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @deal.nil? - invalid_properties.push('invalid value for "deal", deal cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - if @schema_version.nil? - invalid_properties.push('invalid value for "schema_version", schema_version cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @deal.nil? - return false if @request_id.nil? - return false if @schema_version.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deal == o.deal && - request_id == o.request_id && - schema_version == o.schema_version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deal, request_id, schema_version].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_get_request.rb b/lib/plaid/models/asset_report_get_request.rb deleted file mode 100644 index c55dbfff7..000000000 --- a/lib/plaid/models/asset_report_get_request.rb +++ /dev/null @@ -1,284 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportGetRequest defines the request schema for `/asset_report/get` - class AssetReportGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A token that can be provided to endpoints such as `/asset_report/get` or `/asset_report/pdf/get` to fetch or update an Asset Report. - attr_accessor :asset_report_token - - # The user token associated with the User for which to create an asset report for. The latest asset report associated with the User will be returned - attr_accessor :user_token - - # `true` if you would like to retrieve the Asset Report with Insights, `false` otherwise. This field defaults to `false` if omitted. - attr_accessor :include_insights - - # `true` to fetch \"fast\" version of asset report. Defaults to false if omitted. Can only be used if `/asset_report/create` was called with `options.add_ons` set to `[\"fast_assets\"]`. - attr_accessor :fast_report - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'asset_report_token' => :'asset_report_token', - :'user_token' => :'user_token', - :'include_insights' => :'include_insights', - :'fast_report' => :'fast_report', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'asset_report_token' => :'String', - :'user_token' => :'String', - :'include_insights' => :'Boolean', - :'fast_report' => :'Boolean', - :'options' => :'AssetReportGetRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'asset_report_token') - self.asset_report_token = attributes[:'asset_report_token'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - - if attributes.key?(:'include_insights') - self.include_insights = attributes[:'include_insights'] - else - self.include_insights = false - end - - if attributes.key?(:'fast_report') - self.fast_report = attributes[:'fast_report'] - else - self.fast_report = false - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - asset_report_token == o.asset_report_token && - user_token == o.user_token && - include_insights == o.include_insights && - fast_report == o.fast_report && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, asset_report_token, user_token, include_insights, fast_report, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_get_request_options.rb b/lib/plaid/models/asset_report_get_request_options.rb deleted file mode 100644 index 9ab6a20cd..000000000 --- a/lib/plaid/models/asset_report_get_request_options.rb +++ /dev/null @@ -1,248 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to filter or add data to `/asset_report/get` results. If provided, must be non-`null`. - class AssetReportGetRequestOptions - # The maximum number of days of history to include in the Asset Report. - attr_accessor :days_to_include - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'days_to_include' => :'days_to_include' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'days_to_include' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'days_to_include' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'days_to_include') - self.days_to_include = attributes[:'days_to_include'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@days_to_include.nil? && @days_to_include > 731 - invalid_properties.push('invalid value for "days_to_include", must be smaller than or equal to 731.') - end - - if !@days_to_include.nil? && @days_to_include < 0 - invalid_properties.push('invalid value for "days_to_include", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@days_to_include.nil? && @days_to_include > 731 - return false if !@days_to_include.nil? && @days_to_include < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] days_to_include Value to be assigned - def days_to_include=(days_to_include) - if !days_to_include.nil? && days_to_include > 731 - fail ArgumentError, 'invalid value for "days_to_include", must be smaller than or equal to 731.' - end - - if !days_to_include.nil? && days_to_include < 0 - fail ArgumentError, 'invalid value for "days_to_include", must be greater than or equal to 0.' - end - - - @days_to_include = days_to_include - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - days_to_include == o.days_to_include - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [days_to_include].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_get_response.rb b/lib/plaid/models/asset_report_get_response.rb deleted file mode 100644 index bbec23acb..000000000 --- a/lib/plaid/models/asset_report_get_response.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportGetResponse defines the response schema for `/asset_report/get` - class AssetReportGetResponse - attr_accessor :report - - # If the Asset Report generation was successful but identity information cannot be returned, this array will contain information about the errors causing identity information to be missing - attr_accessor :warnings - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report' => :'report', - :'warnings' => :'warnings', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'report' => :'AssetReport', - :'warnings' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report') - self.report = attributes[:'report'] - end - - if attributes.key?(:'warnings') - if (value = attributes[:'warnings']).is_a?(Array) - self.warnings = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @report.nil? - invalid_properties.push('invalid value for "report", report cannot be nil.') - end - - if @warnings.nil? - invalid_properties.push('invalid value for "warnings", warnings cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @report.nil? - return false if @warnings.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report == o.report && - warnings == o.warnings && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report, warnings, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_investment_holding.rb b/lib/plaid/models/asset_report_investment_holding.rb deleted file mode 100644 index 14446bf78..000000000 --- a/lib/plaid/models/asset_report_investment_holding.rb +++ /dev/null @@ -1,341 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A securities holding at an institution. - class AssetReportInvestmentHolding - # The Plaid `account_id` associated with the holding. - attr_accessor :account_id - - # The Plaid `security_id` associated with the holding. Security data is not specific to a user's account; any user who held the same security at the same financial institution at the same time would have identical security data. The `security_id` for the same security will typically be the same across different institutions, but this is not guaranteed. The `security_id` does not typically change, but 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. - attr_accessor :security_id - - # The holding's trading symbol for publicly traded holdings, and otherwise a short identifier if available. - attr_accessor :ticker_symbol - - # The last price given by the institution for this security. - attr_accessor :institution_price - - # The date at which `institution_price` was current. - attr_accessor :institution_price_as_of - - # The value of the holding, as reported by the institution. - attr_accessor :institution_value - - # The original total value of the holding. This field is calculated by Plaid as the sum of the purchase price of all of the shares in the holding. - attr_accessor :cost_basis - - # The total quantity of the asset held, as reported by the financial institution. If the security is an option, `quantity` will reflect the total number of options (typically the number of contracts multiplied by 100), not the number of contracts. - attr_accessor :quantity - - # The ISO-4217 currency code of the holding. Always `null` if `unofficial_currency_code` is non-`null`. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'security_id' => :'security_id', - :'ticker_symbol' => :'ticker_symbol', - :'institution_price' => :'institution_price', - :'institution_price_as_of' => :'institution_price_as_of', - :'institution_value' => :'institution_value', - :'cost_basis' => :'cost_basis', - :'quantity' => :'quantity', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'security_id' => :'String', - :'ticker_symbol' => :'String', - :'institution_price' => :'Float', - :'institution_price_as_of' => :'Date', - :'institution_value' => :'Float', - :'cost_basis' => :'Float', - :'quantity' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'ticker_symbol', - :'institution_price_as_of', - :'cost_basis', - :'iso_currency_code', - :'unofficial_currency_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportInvestmentHolding` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportInvestmentHolding`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'security_id') - self.security_id = attributes[:'security_id'] - end - - if attributes.key?(:'ticker_symbol') - self.ticker_symbol = attributes[:'ticker_symbol'] - end - - if attributes.key?(:'institution_price') - self.institution_price = attributes[:'institution_price'] - end - - if attributes.key?(:'institution_price_as_of') - self.institution_price_as_of = attributes[:'institution_price_as_of'] - end - - if attributes.key?(:'institution_value') - self.institution_value = attributes[:'institution_value'] - end - - if attributes.key?(:'cost_basis') - self.cost_basis = attributes[:'cost_basis'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @security_id.nil? - invalid_properties.push('invalid value for "security_id", security_id cannot be nil.') - end - - if @institution_price.nil? - invalid_properties.push('invalid value for "institution_price", institution_price cannot be nil.') - end - - if @institution_value.nil? - invalid_properties.push('invalid value for "institution_value", institution_value cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @security_id.nil? - return false if @institution_price.nil? - return false if @institution_value.nil? - return false if @quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - security_id == o.security_id && - ticker_symbol == o.ticker_symbol && - institution_price == o.institution_price && - institution_price_as_of == o.institution_price_as_of && - institution_value == o.institution_value && - cost_basis == o.cost_basis && - quantity == o.quantity && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, security_id, ticker_symbol, institution_price, institution_price_as_of, institution_value, cost_basis, quantity, iso_currency_code, unofficial_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_investment_security.rb b/lib/plaid/models/asset_report_investment_security.rb deleted file mode 100644 index d8813dddb..000000000 --- a/lib/plaid/models/asset_report_investment_security.rb +++ /dev/null @@ -1,259 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Investment security associated with the account. - class AssetReportInvestmentSecurity - # 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. - attr_accessor :security_id - - # A descriptive name for the security, suitable for display. - attr_accessor :name - - # The security’s trading symbol for publicly traded securities, and otherwise a short identifier if available. - attr_accessor :ticker_symbol - - # The security type of the holding. Valid security types are: `cash`: Cash, currency, and money market funds `cryptocurrency`: Digital or virtual currencies `derivative`: Options, warrants, and other derivative instruments `equity`: Domestic and foreign equities `etf`: Multi-asset exchange-traded investment funds `fixed income`: Bonds and certificates of deposit (CDs) `loan`: Loans and loan receivables `mutual fund`: Open- and closed-end vehicles pooling funds of multiple investors `other`: Unknown or other investment types - attr_accessor :type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'security_id' => :'security_id', - :'name' => :'name', - :'ticker_symbol' => :'ticker_symbol', - :'type' => :'type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'security_id' => :'String', - :'name' => :'String', - :'ticker_symbol' => :'String', - :'type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'ticker_symbol', - :'type' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportInvestmentSecurity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportInvestmentSecurity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'security_id') - self.security_id = attributes[:'security_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'ticker_symbol') - self.ticker_symbol = attributes[:'ticker_symbol'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @security_id.nil? - invalid_properties.push('invalid value for "security_id", security_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @security_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - security_id == o.security_id && - name == o.name && - ticker_symbol == o.ticker_symbol && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [security_id, name, ticker_symbol, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_investments.rb b/lib/plaid/models/asset_report_investments.rb deleted file mode 100644 index 301f25db1..000000000 --- a/lib/plaid/models/asset_report_investments.rb +++ /dev/null @@ -1,440 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A transaction within an investment account. - class AssetReportInvestments - # The ID of the Investment transaction, unique across all Plaid transactions. Like all Plaid identifiers, the `investment_transaction_id` is case sensitive. - attr_accessor :investment_transaction_id - - # The `account_id` of the account against which this transaction posted. - attr_accessor :account_id - - # The `security_id` to which this transaction is related. - attr_accessor :security_id - - # The [ISO 8601](https://wikipedia.org/wiki/ISO_8601) posting date for the transaction. - attr_accessor :date - - # The institution’s description of the transaction. - attr_accessor :name - - # The number of units of the security involved in this transaction. Positive for buy transactions; negative for sell transactions. - attr_accessor :quantity - - # 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). - attr_accessor :vested_quantity - - # The value of the vested holdings as reported by the institution. - attr_accessor :vested_value - - # The complete value of the transaction. Positive values when cash is debited, e.g. purchases of stock; negative values when cash is credited, e.g. sales of stock. Treatment remains the same for cash-only movements unassociated with securities. - attr_accessor :amount - - # The price of the security at which this transaction occurred. - attr_accessor :price - - # The combined value of all fees applied to this transaction - attr_accessor :fees - - attr_accessor :type - - attr_accessor :subtype - - # The ISO-4217 currency code of the transaction. Always `null` if `unofficial_currency_code` is non-`null`. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'investment_transaction_id' => :'investment_transaction_id', - :'account_id' => :'account_id', - :'security_id' => :'security_id', - :'date' => :'date', - :'name' => :'name', - :'quantity' => :'quantity', - :'vested_quantity' => :'vested_quantity', - :'vested_value' => :'vested_value', - :'amount' => :'amount', - :'price' => :'price', - :'fees' => :'fees', - :'type' => :'type', - :'subtype' => :'subtype', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'investment_transaction_id' => :'String', - :'account_id' => :'String', - :'security_id' => :'String', - :'date' => :'Date', - :'name' => :'String', - :'quantity' => :'Float', - :'vested_quantity' => :'Float', - :'vested_value' => :'Float', - :'amount' => :'Float', - :'price' => :'Float', - :'fees' => :'Float', - :'type' => :'InvestmentTransactionType', - :'subtype' => :'InvestmentTransactionSubtype', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'security_id', - :'fees', - :'iso_currency_code', - :'unofficial_currency_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportInvestments` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportInvestments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'investment_transaction_id') - self.investment_transaction_id = attributes[:'investment_transaction_id'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'security_id') - self.security_id = attributes[:'security_id'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'vested_quantity') - self.vested_quantity = attributes[:'vested_quantity'] - end - - if attributes.key?(:'vested_value') - self.vested_value = attributes[:'vested_value'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'price') - self.price = attributes[:'price'] - end - - if attributes.key?(:'fees') - self.fees = attributes[:'fees'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'subtype') - self.subtype = attributes[:'subtype'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @investment_transaction_id.nil? - invalid_properties.push('invalid value for "investment_transaction_id", investment_transaction_id cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @date.nil? - invalid_properties.push('invalid value for "date", date cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - if @vested_quantity.nil? - invalid_properties.push('invalid value for "vested_quantity", vested_quantity cannot be nil.') - end - - if @vested_value.nil? - invalid_properties.push('invalid value for "vested_value", vested_value cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @price.nil? - invalid_properties.push('invalid value for "price", price cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @subtype.nil? - invalid_properties.push('invalid value for "subtype", subtype cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @investment_transaction_id.nil? - return false if @account_id.nil? - return false if @date.nil? - return false if @name.nil? - return false if @quantity.nil? - return false if @vested_quantity.nil? - return false if @vested_value.nil? - return false if @amount.nil? - return false if @price.nil? - return false if @type.nil? - return false if @subtype.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - investment_transaction_id == o.investment_transaction_id && - account_id == o.account_id && - security_id == o.security_id && - date == o.date && - name == o.name && - quantity == o.quantity && - vested_quantity == o.vested_quantity && - vested_value == o.vested_value && - amount == o.amount && - price == o.price && - fees == o.fees && - type == o.type && - subtype == o.subtype && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [investment_transaction_id, account_id, security_id, date, name, quantity, vested_quantity, vested_value, amount, price, fees, type, subtype, iso_currency_code, unofficial_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_item.rb b/lib/plaid/models/asset_report_item.rb deleted file mode 100644 index 412d8f30f..000000000 --- a/lib/plaid/models/asset_report_item.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A representation of an Item within an Asset Report. - class AssetReportItem - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - # The full financial institution name associated with the Item. - attr_accessor :institution_name - - # The id of the financial institution associated with the Item. - attr_accessor :institution_id - - # The date and time when this Item’s data was last retrieved from the financial institution, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :date_last_updated - - # Data about each of the accounts open on the Item. - attr_accessor :accounts - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_id' => :'item_id', - :'institution_name' => :'institution_name', - :'institution_id' => :'institution_id', - :'date_last_updated' => :'date_last_updated', - :'accounts' => :'accounts' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_id' => :'String', - :'institution_name' => :'String', - :'institution_id' => :'String', - :'date_last_updated' => :'Time', - :'accounts' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'institution_name') - self.institution_name = attributes[:'institution_name'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'date_last_updated') - self.date_last_updated = attributes[:'date_last_updated'] - end - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @institution_name.nil? - invalid_properties.push('invalid value for "institution_name", institution_name cannot be nil.') - end - - if @institution_id.nil? - invalid_properties.push('invalid value for "institution_id", institution_id cannot be nil.') - end - - if @date_last_updated.nil? - invalid_properties.push('invalid value for "date_last_updated", date_last_updated cannot be nil.') - end - - if @accounts.nil? - invalid_properties.push('invalid value for "accounts", accounts cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_id.nil? - return false if @institution_name.nil? - return false if @institution_id.nil? - return false if @date_last_updated.nil? - return false if @accounts.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_id == o.item_id && - institution_name == o.institution_name && - institution_id == o.institution_id && - date_last_updated == o.date_last_updated && - accounts == o.accounts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_id, institution_name, institution_id, date_last_updated, accounts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_pdf_get_request.rb b/lib/plaid/models/asset_report_pdf_get_request.rb deleted file mode 100644 index c002dd41e..000000000 --- a/lib/plaid/models/asset_report_pdf_get_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportPDFGetRequest defines the request schema for `/asset_report/pdf/get` - class AssetReportPDFGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A token that can be provided to endpoints such as `/asset_report/get` or `/asset_report/pdf/get` to fetch or update an Asset Report. - attr_accessor :asset_report_token - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'asset_report_token' => :'asset_report_token', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'asset_report_token' => :'String', - :'options' => :'AssetReportPDFGetRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportPDFGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportPDFGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'asset_report_token') - self.asset_report_token = attributes[:'asset_report_token'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_report_token.nil? - invalid_properties.push('invalid value for "asset_report_token", asset_report_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_report_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - asset_report_token == o.asset_report_token && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, asset_report_token, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_pdf_get_request_options.rb b/lib/plaid/models/asset_report_pdf_get_request_options.rb deleted file mode 100644 index e692c81d5..000000000 --- a/lib/plaid/models/asset_report_pdf_get_request_options.rb +++ /dev/null @@ -1,248 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to filter or add data to `/asset_report/get` results. If provided, must be non-`null`. - class AssetReportPDFGetRequestOptions - # The maximum integer number of days of history to include in the Asset Report. - attr_accessor :days_to_include - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'days_to_include' => :'days_to_include' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'days_to_include' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'days_to_include' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportPDFGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportPDFGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'days_to_include') - self.days_to_include = attributes[:'days_to_include'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@days_to_include.nil? && @days_to_include > 731 - invalid_properties.push('invalid value for "days_to_include", must be smaller than or equal to 731.') - end - - if !@days_to_include.nil? && @days_to_include < 0 - invalid_properties.push('invalid value for "days_to_include", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@days_to_include.nil? && @days_to_include > 731 - return false if !@days_to_include.nil? && @days_to_include < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] days_to_include Value to be assigned - def days_to_include=(days_to_include) - if !days_to_include.nil? && days_to_include > 731 - fail ArgumentError, 'invalid value for "days_to_include", must be smaller than or equal to 731.' - end - - if !days_to_include.nil? && days_to_include < 0 - fail ArgumentError, 'invalid value for "days_to_include", must be greater than or equal to 0.' - end - - - @days_to_include = days_to_include - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - days_to_include == o.days_to_include - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [days_to_include].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_refresh_request.rb b/lib/plaid/models/asset_report_refresh_request.rb deleted file mode 100644 index 149f486fb..000000000 --- a/lib/plaid/models/asset_report_refresh_request.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportRefreshRequest defines the request schema for `/asset_report/refresh` - class AssetReportRefreshRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The `asset_report_token` returned by the original call to `/asset_report/create` - attr_accessor :asset_report_token - - # The maximum number of days of history to include in the Asset Report. Must be an integer. If not specified, the value from the original call to `/asset_report/create` will be used. - attr_accessor :days_requested - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'asset_report_token' => :'asset_report_token', - :'days_requested' => :'days_requested', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'asset_report_token' => :'String', - :'days_requested' => :'Integer', - :'options' => :'AssetReportRefreshRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'days_requested', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportRefreshRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportRefreshRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'asset_report_token') - self.asset_report_token = attributes[:'asset_report_token'] - end - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_report_token.nil? - invalid_properties.push('invalid value for "asset_report_token", asset_report_token cannot be nil.') - end - - if !@days_requested.nil? && @days_requested > 731 - invalid_properties.push('invalid value for "days_requested", must be smaller than or equal to 731.') - end - - if !@days_requested.nil? && @days_requested < 0 - invalid_properties.push('invalid value for "days_requested", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_report_token.nil? - return false if !@days_requested.nil? && @days_requested > 731 - return false if !@days_requested.nil? && @days_requested < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] days_requested Value to be assigned - def days_requested=(days_requested) - if !days_requested.nil? && days_requested > 731 - fail ArgumentError, 'invalid value for "days_requested", must be smaller than or equal to 731.' - end - - if !days_requested.nil? && days_requested < 0 - fail ArgumentError, 'invalid value for "days_requested", must be greater than or equal to 0.' - end - - - @days_requested = days_requested - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - asset_report_token == o.asset_report_token && - days_requested == o.days_requested && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, asset_report_token, days_requested, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_refresh_request_options.rb b/lib/plaid/models/asset_report_refresh_request_options.rb deleted file mode 100644 index 3e60fb257..000000000 --- a/lib/plaid/models/asset_report_refresh_request_options.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to filter `/asset_report/refresh` results. If provided, cannot be `null`. If not specified, the `options` from the original call to `/asset_report/create` will be used. - class AssetReportRefreshRequestOptions - # Client-generated identifier, which can be used by lenders to track loan applications. - attr_accessor :client_report_id - - # URL to which Plaid will send Assets webhooks, for example when the requested Asset Report is ready. - attr_accessor :webhook - - attr_accessor :user - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_report_id' => :'client_report_id', - :'webhook' => :'webhook', - :'user' => :'user' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_report_id' => :'String', - :'webhook' => :'String', - :'user' => :'AssetReportUser' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'client_report_id', - :'webhook', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportRefreshRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportRefreshRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_report_id') - self.client_report_id = attributes[:'client_report_id'] - end - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_report_id == o.client_report_id && - webhook == o.webhook && - user == o.user - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_report_id, webhook, user].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_refresh_response.rb b/lib/plaid/models/asset_report_refresh_response.rb deleted file mode 100644 index a4d51213a..000000000 --- a/lib/plaid/models/asset_report_refresh_response.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportRefreshResponse defines the response schema for `/asset_report/refresh` - class AssetReportRefreshResponse - # A unique ID identifying an Asset Report. Like all Plaid identifiers, this ID is case sensitive. - attr_accessor :asset_report_id - - # A token that can be provided to endpoints such as `/asset_report/get` or `/asset_report/pdf/get` to fetch or update an Asset Report. - attr_accessor :asset_report_token - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_report_id' => :'asset_report_id', - :'asset_report_token' => :'asset_report_token', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_report_id' => :'String', - :'asset_report_token' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportRefreshResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportRefreshResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_report_id') - self.asset_report_id = attributes[:'asset_report_id'] - end - - if attributes.key?(:'asset_report_token') - self.asset_report_token = attributes[:'asset_report_token'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_report_id.nil? - invalid_properties.push('invalid value for "asset_report_id", asset_report_id cannot be nil.') - end - - if @asset_report_token.nil? - invalid_properties.push('invalid value for "asset_report_token", asset_report_token cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_report_id.nil? - return false if @asset_report_token.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_report_id == o.asset_report_id && - asset_report_token == o.asset_report_token && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_report_id, asset_report_token, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_remove_request.rb b/lib/plaid/models/asset_report_remove_request.rb deleted file mode 100644 index 8c5a9acab..000000000 --- a/lib/plaid/models/asset_report_remove_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportRemoveRequest defines the request schema for `/asset_report/remove` - class AssetReportRemoveRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A token that can be provided to endpoints such as `/asset_report/get` or `/asset_report/pdf/get` to fetch or update an Asset Report. - attr_accessor :asset_report_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'asset_report_token' => :'asset_report_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'asset_report_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportRemoveRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportRemoveRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'asset_report_token') - self.asset_report_token = attributes[:'asset_report_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_report_token.nil? - invalid_properties.push('invalid value for "asset_report_token", asset_report_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_report_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - asset_report_token == o.asset_report_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, asset_report_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_remove_response.rb b/lib/plaid/models/asset_report_remove_response.rb deleted file mode 100644 index 837379ede..000000000 --- a/lib/plaid/models/asset_report_remove_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AssetReportRemoveResponse defines the response schema for `/asset_report/remove` - class AssetReportRemoveResponse - # `true` if the Asset Report was successfully removed. - attr_accessor :removed - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'removed' => :'removed', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'removed' => :'Boolean', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportRemoveResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportRemoveResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'removed') - self.removed = attributes[:'removed'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @removed.nil? - invalid_properties.push('invalid value for "removed", removed cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @removed.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - removed == o.removed && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [removed, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_transaction.rb b/lib/plaid/models/asset_report_transaction.rb deleted file mode 100644 index f33ae2050..000000000 --- a/lib/plaid/models/asset_report_transaction.rb +++ /dev/null @@ -1,477 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A transaction on the asset report - class AssetReportTransaction - # The ID of the account in which this transaction occurred. - attr_accessor :account_id - - # 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. - attr_accessor :amount - - # The ISO-4217 currency code of the transaction. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - # The string returned by the financial institution to describe the transaction. - attr_accessor :original_description - - # 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). This field will only appear in an Asset Report with Insights. - attr_accessor :category - - # 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). This field will only appear in an Asset Report with Insights. - attr_accessor :category_id - - attr_accessor :credit_category - - # The check number of the transaction. This field is only populated for check transactions. - attr_accessor :check_number - - # 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](https://wikipedia.org/wiki/ISO_8601) format ( `YYYY-MM-DD` ). - attr_accessor :date - - # The date on which the transaction took place, in IS0 8601 format. - attr_accessor :date_transacted - - attr_accessor :location - - # The merchant name or transaction description. This field will only appear in an Asset Report with Insights. - attr_accessor :name - - # The merchant name, as enriched by Plaid from the `name` field. This is typically a more human-readable version of the merchant counterparty in the transaction. For some bank transactions (such as checks or account transfers) where there is no meaningful merchant name, this value will be `null`. - attr_accessor :merchant_name - - attr_accessor :payment_meta - - # When `true`, identifies the transaction as pending or unsettled. Pending transaction details (name, type, amount, category ID) may change before they are settled. - attr_accessor :pending - - # The ID of a posted transaction's associated pending transaction, where applicable. - attr_accessor :pending_transaction_id - - # The name of the account owner. This field is not typically populated and only relevant when dealing with sub-accounts. - attr_accessor :account_owner - - # The unique ID of the transaction. Like all Plaid identifiers, the `transaction_id` is case sensitive. - attr_accessor :transaction_id - - attr_accessor :transaction_type - - # A unique identifier for an income source. - attr_accessor :income_source_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'original_description' => :'original_description', - :'category' => :'category', - :'category_id' => :'category_id', - :'credit_category' => :'credit_category', - :'check_number' => :'check_number', - :'date' => :'date', - :'date_transacted' => :'date_transacted', - :'location' => :'location', - :'name' => :'name', - :'merchant_name' => :'merchant_name', - :'payment_meta' => :'payment_meta', - :'pending' => :'pending', - :'pending_transaction_id' => :'pending_transaction_id', - :'account_owner' => :'account_owner', - :'transaction_id' => :'transaction_id', - :'transaction_type' => :'transaction_type', - :'income_source_id' => :'income_source_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'amount' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'original_description' => :'String', - :'category' => :'Array', - :'category_id' => :'String', - :'credit_category' => :'CreditCategory', - :'check_number' => :'String', - :'date' => :'Date', - :'date_transacted' => :'String', - :'location' => :'Location', - :'name' => :'String', - :'merchant_name' => :'String', - :'payment_meta' => :'PaymentMeta', - :'pending' => :'Boolean', - :'pending_transaction_id' => :'String', - :'account_owner' => :'String', - :'transaction_id' => :'String', - :'transaction_type' => :'AssetReportTransactionType', - :'income_source_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'iso_currency_code', - :'unofficial_currency_code', - :'original_description', - :'category', - :'category_id', - :'credit_category', - :'check_number', - :'date_transacted', - :'merchant_name', - :'pending_transaction_id', - :'account_owner', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'original_description') - self.original_description = attributes[:'original_description'] - end - - if attributes.key?(:'category') - if (value = attributes[:'category']).is_a?(Array) - self.category = value - end - end - - if attributes.key?(:'category_id') - self.category_id = attributes[:'category_id'] - end - - if attributes.key?(:'credit_category') - self.credit_category = attributes[:'credit_category'] - end - - if attributes.key?(:'check_number') - self.check_number = attributes[:'check_number'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'date_transacted') - self.date_transacted = attributes[:'date_transacted'] - end - - if attributes.key?(:'location') - self.location = attributes[:'location'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'merchant_name') - self.merchant_name = attributes[:'merchant_name'] - end - - if attributes.key?(:'payment_meta') - self.payment_meta = attributes[:'payment_meta'] - end - - if attributes.key?(:'pending') - self.pending = attributes[:'pending'] - end - - if attributes.key?(:'pending_transaction_id') - self.pending_transaction_id = attributes[:'pending_transaction_id'] - end - - if attributes.key?(:'account_owner') - self.account_owner = attributes[:'account_owner'] - end - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - - if attributes.key?(:'transaction_type') - self.transaction_type = attributes[:'transaction_type'] - end - - if attributes.key?(:'income_source_id') - self.income_source_id = attributes[:'income_source_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @date.nil? - invalid_properties.push('invalid value for "date", date cannot be nil.') - end - - if @pending.nil? - invalid_properties.push('invalid value for "pending", pending cannot be nil.') - end - - if @transaction_id.nil? - invalid_properties.push('invalid value for "transaction_id", transaction_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @amount.nil? - return false if @date.nil? - return false if @pending.nil? - return false if @transaction_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - amount == o.amount && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - original_description == o.original_description && - category == o.category && - category_id == o.category_id && - credit_category == o.credit_category && - check_number == o.check_number && - date == o.date && - date_transacted == o.date_transacted && - location == o.location && - name == o.name && - merchant_name == o.merchant_name && - payment_meta == o.payment_meta && - pending == o.pending && - pending_transaction_id == o.pending_transaction_id && - account_owner == o.account_owner && - transaction_id == o.transaction_id && - transaction_type == o.transaction_type && - income_source_id == o.income_source_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, amount, iso_currency_code, unofficial_currency_code, original_description, category, category_id, credit_category, check_number, date, date_transacted, location, name, merchant_name, payment_meta, pending, pending_transaction_id, account_owner, transaction_id, transaction_type, income_source_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_report_transaction_type.rb b/lib/plaid/models/asset_report_transaction_type.rb deleted file mode 100644 index d1803b87b..000000000 --- a/lib/plaid/models/asset_report_transaction_type.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class AssetReportTransactionType - DIGITAL = "digital".freeze - PLACE = "place".freeze - SPECIAL = "special".freeze - UNRESOLVED = "unresolved".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/asset_report_user.rb b/lib/plaid/models/asset_report_user.rb deleted file mode 100644 index bb3f88d30..000000000 --- a/lib/plaid/models/asset_report_user.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class AssetReportUser - # An identifier you determine and submit for the user. - attr_accessor :client_user_id - - # The user's first name. Required for the Fannie Mae Day 1 Certainty™ program. - attr_accessor :first_name - - # The user's middle name - attr_accessor :middle_name - - # The user's last name. Required for the Fannie Mae Day 1 Certainty™ program. - attr_accessor :last_name - - # The user's Social Security Number. Required for the Fannie Mae Day 1 Certainty™ program. Format: \"ddd-dd-dddd\" - attr_accessor :ssn - - # 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. - attr_accessor :phone_number - - # The user's email address. - attr_accessor :email - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_user_id' => :'client_user_id', - :'first_name' => :'first_name', - :'middle_name' => :'middle_name', - :'last_name' => :'last_name', - :'ssn' => :'ssn', - :'phone_number' => :'phone_number', - :'email' => :'email' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_user_id' => :'String', - :'first_name' => :'String', - :'middle_name' => :'String', - :'last_name' => :'String', - :'ssn' => :'String', - :'phone_number' => :'String', - :'email' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'client_user_id', - :'first_name', - :'middle_name', - :'last_name', - :'ssn', - :'phone_number', - :'email' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetReportUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetReportUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - end - - if attributes.key?(:'middle_name') - self.middle_name = attributes[:'middle_name'] - end - - if attributes.key?(:'last_name') - self.last_name = attributes[:'last_name'] - end - - if attributes.key?(:'ssn') - self.ssn = attributes[:'ssn'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_user_id == o.client_user_id && - first_name == o.first_name && - middle_name == o.middle_name && - last_name == o.last_name && - ssn == o.ssn && - phone_number == o.phone_number && - email == o.email - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_user_id, first_name, middle_name, last_name, ssn, phone_number, email].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_transaction.rb b/lib/plaid/models/asset_transaction.rb deleted file mode 100644 index 3b214fa43..000000000 --- a/lib/plaid/models/asset_transaction.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing... - class AssetTransaction - attr_accessor :asset_transaction_detail - - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - attr_accessor :asset_transaction_descripton - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_transaction_detail' => :'ASSET_TRANSACTION_DETAIL', - :'asset_transaction_descripton' => :'ASSET_TRANSACTION_DESCRIPTON' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_transaction_detail' => :'AssetTransactionDetail', - :'asset_transaction_descripton' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_transaction_detail') - self.asset_transaction_detail = attributes[:'asset_transaction_detail'] - end - - if attributes.key?(:'asset_transaction_descripton') - if (value = attributes[:'asset_transaction_descripton']).is_a?(Array) - self.asset_transaction_descripton = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_transaction_detail.nil? - invalid_properties.push('invalid value for "asset_transaction_detail", asset_transaction_detail cannot be nil.') - end - - if @asset_transaction_descripton.nil? - invalid_properties.push('invalid value for "asset_transaction_descripton", asset_transaction_descripton cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_transaction_detail.nil? - return false if @asset_transaction_descripton.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_transaction_detail == o.asset_transaction_detail && - asset_transaction_descripton == o.asset_transaction_descripton - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_transaction_detail, asset_transaction_descripton].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_transaction_category_type.rb b/lib/plaid/models/asset_transaction_category_type.rb deleted file mode 100644 index c1c56c29c..000000000 --- a/lib/plaid/models/asset_transaction_category_type.rb +++ /dev/null @@ -1,144 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class AssetTransactionCategoryType - ATM_FEE = "ATMFee".freeze - ADVERTISING = "Advertising".freeze - AIR_TRAVEL = "AirTravel".freeze - ALCOHOL_BARS = "AlcoholBars".freeze - ALLOWANCE = "Allowance".freeze - AMUSEMENT = "Amusement".freeze - ARTS = "Arts".freeze - AUTO_TRANSPORT = "AutoTransport".freeze - AUTO_INSURANCE = "AutoInsurance".freeze - AUTO_PAYMENT = "AutoPayment".freeze - BABY_SUPPLIES = "BabySupplies".freeze - BABYSITTER_DAYCARE = "BabysitterDaycare".freeze - BANK_FEE = "BankFee".freeze - BILLS_UTILITIES = "BillsUtilities".freeze - BONUS = "Bonus".freeze - BOOKS_SUPPLIES = "BooksSupplies".freeze - BUSINESS_SERVICES = "Business Services".freeze - BUY = "Buy".freeze - CASH_ATM = "CashATM".freeze - CHARITY = "Charity".freeze - CHECK = "Check".freeze - CHILD_SUPPORT = "ChildSupport".freeze - CLOTHING = "Clothing".freeze - COFFEE_SHOPS = "CoffeeShops".freeze - CREDIT_CARD_PAYMENT = "CreditCardPayment".freeze - DENTIST = "Dentist".freeze - DOCTOR = "Doctor".freeze - EDUCATION = "Education".freeze - ELECTRONICS_SOFTWARE = "ElectronicsSoftware".freeze - ENTERTAINMENT = "Entertainment".freeze - EYECARE = "Eyecare".freeze - FAST_FOOD = "FastFood".freeze - FEDERAL_TAX = "FederalTax".freeze - FEES_CHARGES = "FeesCharges".freeze - FINANCE_CHARGE = "FinanceCharge".freeze - FINANCIAL = "Financial".freeze - FINANCIAL_ADVISOR = "FinancialAdvisor".freeze - FOOD_DINING = "FoodDining".freeze - FURNISHINGS = "Furnishings".freeze - GAS_FUEL = "GasFuel".freeze - GIFTS_DONATIONS = "GiftsDonations".freeze - GROCERIES = "Groceries".freeze - GYM = "Gym".freeze - HAIR = "Hair".freeze - HEALTH_FITNESS = "HealthFitness".freeze - HEALTH_INSURANCE = "HealthInsurance".freeze - HOBBIES = "Hobbies".freeze - HOME = "Home".freeze - HOME_IMPROVEMENT = "HomeImprovement".freeze - HOME_INSURANCE = "HomeInsurance".freeze - HOME_PHONE = "HomePhone".freeze - HOME_SERVICES = "HomeServices".freeze - HOME_SUPPLIES = "HomeSupplies".freeze - HOTEL = "Hotel".freeze - INCOME = "Income".freeze - INTEREST_INCOME = "InterestIncome".freeze - INTERNET = "Internet".freeze - INVESTMENTS = "Investments".freeze - KIDS = "Kids".freeze - KIDS_ACTIVITIES = "KidsActivities".freeze - LATE_FEE = "LateFee".freeze - LAUNDRY = "Laundry".freeze - LAWN_GARDEN = "LawnGarden".freeze - LEGAL = "Legal".freeze - LIFE_INSURANCE = "LifeInsurance".freeze - LOAN_INSURANCE = "LoanInsurance".freeze - LOAN_PAYMENT = "LoanPayment".freeze - LOANS = "Loans".freeze - MOBILE_PHONE = "MobilePhone".freeze - MORTGAGE_RENT = "MortgageRent".freeze - MOVIES_DVDS = "MoviesDVDs".freeze - MUSIC = "Music".freeze - NEWSPAPERS_MAGAZINES = "NewspapersMagazines".freeze - OFFICE_SUPPLIES = "OfficeSupplies".freeze - PARKING = "Parking".freeze - PAYCHECK = "Paycheck".freeze - PERSONAL_CARE = "PersonalCare".freeze - PET_FOOD_SUPPLIES = "PetFoodSupplies".freeze - PET_GROOMING = "PetGrooming".freeze - PETS = "Pets".freeze - PHARMACY = "Pharmacy".freeze - PRINTING = "Printing".freeze - PROPERTY_TAX = "Property Tax".freeze - PUBLIC_TRANSPORTATION = "Public Transportation".freeze - REIMBURSEMENT = "Reimbursement".freeze - RENTAL_CAR_TAXI = "RentalCarTaxi".freeze - RESTAURANTS = "Restaurants".freeze - SALES_TAX = "SalesTax".freeze - SERVICE_PARTS = "ServiceParts".freeze - SERVICE_FEE = "ServiceFee".freeze - SHIPPING = "Shipping".freeze - SHOPPING = "Shopping".freeze - SPA_MASSAGE = "SpaMassage".freeze - SPORTING_GOODS = "SportingGoods".freeze - SPORTS = "Sports".freeze - STATE_TAX = "StateTax".freeze - STUDENT_LOAN = "Student Loan".freeze - TAXES = "Taxes".freeze - TELEVISION = "Television".freeze - TOYS = "Toys".freeze - TRANSFER = "Transfer".freeze - TRAVEL = "Travel".freeze - TUITION = "Tuition".freeze - UNCATEGORIZED = "Uncategorized".freeze - UTILITIES = "Utilities".freeze - VACATION = "Vacation".freeze - VETERINARY = "Veterinary".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/asset_transaction_description.rb b/lib/plaid/models/asset_transaction_description.rb deleted file mode 100644 index a5f0334d1..000000000 --- a/lib/plaid/models/asset_transaction_description.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class AssetTransactionDescription - # Asset Transaction Description String up to 3 occurances 1 required. - attr_accessor :asset_transaction_description - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_transaction_description' => :'AssetTransactionDescription' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_transaction_description' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetTransactionDescription` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetTransactionDescription`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_transaction_description') - self.asset_transaction_description = attributes[:'asset_transaction_description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_transaction_description.nil? - invalid_properties.push('invalid value for "asset_transaction_description", asset_transaction_description cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_transaction_description.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_transaction_description == o.asset_transaction_description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_transaction_description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_transaction_detail.rb b/lib/plaid/models/asset_transaction_detail.rb deleted file mode 100644 index cd166ecad..000000000 --- a/lib/plaid/models/asset_transaction_detail.rb +++ /dev/null @@ -1,350 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class AssetTransactionDetail - # A vendor created unique Identifier. - attr_accessor :asset_transaction_unique_identifier - - # Asset Transaction Amount. - attr_accessor :asset_transaction_amount - - # Asset Transaction Date. - attr_accessor :asset_transaction_date - - # Asset Transaction Post Date. - attr_accessor :asset_transaction_post_date - - attr_accessor :asset_transaction_type - - # Populate with who did the transaction. - attr_accessor :asset_transaction_paid_by_name - - # FI Provided - examples are atm, cash, check, credit, debit, deposit, directDebit, directDeposit, dividend, fee, interest, other, payment, pointOfSale, repeatPayment, serviceCharge, transfer. - attr_accessor :asset_transaction_type_additional_description - - attr_accessor :asset_transaction_category_type - - # FI provided Transaction Identifier. - attr_accessor :financial_institution_transaction_identifier - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_transaction_unique_identifier' => :'AssetTransactionUniqueIdentifier', - :'asset_transaction_amount' => :'AssetTransactionAmount', - :'asset_transaction_date' => :'AssetTransactionDate', - :'asset_transaction_post_date' => :'AssetTransactionPostDate', - :'asset_transaction_type' => :'AssetTransactionType', - :'asset_transaction_paid_by_name' => :'AssetTransactionPaidByName', - :'asset_transaction_type_additional_description' => :'AssetTransactionTypeAdditionalDescription', - :'asset_transaction_category_type' => :'AssetTransactionCategoryType', - :'financial_institution_transaction_identifier' => :'FinancialInstitutionTransactionIdentifier' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_transaction_unique_identifier' => :'String', - :'asset_transaction_amount' => :'Float', - :'asset_transaction_date' => :'Date', - :'asset_transaction_post_date' => :'Date', - :'asset_transaction_type' => :'AssetTransactionType', - :'asset_transaction_paid_by_name' => :'String', - :'asset_transaction_type_additional_description' => :'String', - :'asset_transaction_category_type' => :'AssetTransactionCategoryType', - :'financial_institution_transaction_identifier' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'asset_transaction_paid_by_name', - :'asset_transaction_type_additional_description', - :'asset_transaction_category_type', - :'financial_institution_transaction_identifier' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetTransactionDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetTransactionDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_transaction_unique_identifier') - self.asset_transaction_unique_identifier = attributes[:'asset_transaction_unique_identifier'] - end - - if attributes.key?(:'asset_transaction_amount') - self.asset_transaction_amount = attributes[:'asset_transaction_amount'] - end - - if attributes.key?(:'asset_transaction_date') - self.asset_transaction_date = attributes[:'asset_transaction_date'] - end - - if attributes.key?(:'asset_transaction_post_date') - self.asset_transaction_post_date = attributes[:'asset_transaction_post_date'] - end - - if attributes.key?(:'asset_transaction_type') - self.asset_transaction_type = attributes[:'asset_transaction_type'] - end - - if attributes.key?(:'asset_transaction_paid_by_name') - self.asset_transaction_paid_by_name = attributes[:'asset_transaction_paid_by_name'] - end - - if attributes.key?(:'asset_transaction_type_additional_description') - self.asset_transaction_type_additional_description = attributes[:'asset_transaction_type_additional_description'] - end - - if attributes.key?(:'asset_transaction_category_type') - self.asset_transaction_category_type = attributes[:'asset_transaction_category_type'] - end - - if attributes.key?(:'financial_institution_transaction_identifier') - self.financial_institution_transaction_identifier = attributes[:'financial_institution_transaction_identifier'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_transaction_unique_identifier.nil? - invalid_properties.push('invalid value for "asset_transaction_unique_identifier", asset_transaction_unique_identifier cannot be nil.') - end - - if @asset_transaction_amount.nil? - invalid_properties.push('invalid value for "asset_transaction_amount", asset_transaction_amount cannot be nil.') - end - - if @asset_transaction_date.nil? - invalid_properties.push('invalid value for "asset_transaction_date", asset_transaction_date cannot be nil.') - end - - if @asset_transaction_post_date.nil? - invalid_properties.push('invalid value for "asset_transaction_post_date", asset_transaction_post_date cannot be nil.') - end - - if @asset_transaction_type.nil? - invalid_properties.push('invalid value for "asset_transaction_type", asset_transaction_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_transaction_unique_identifier.nil? - return false if @asset_transaction_amount.nil? - return false if @asset_transaction_date.nil? - return false if @asset_transaction_post_date.nil? - return false if @asset_transaction_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_transaction_unique_identifier == o.asset_transaction_unique_identifier && - asset_transaction_amount == o.asset_transaction_amount && - asset_transaction_date == o.asset_transaction_date && - asset_transaction_post_date == o.asset_transaction_post_date && - asset_transaction_type == o.asset_transaction_type && - asset_transaction_paid_by_name == o.asset_transaction_paid_by_name && - asset_transaction_type_additional_description == o.asset_transaction_type_additional_description && - asset_transaction_category_type == o.asset_transaction_category_type && - financial_institution_transaction_identifier == o.financial_institution_transaction_identifier - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_transaction_unique_identifier, asset_transaction_amount, asset_transaction_date, asset_transaction_post_date, asset_transaction_type, asset_transaction_paid_by_name, asset_transaction_type_additional_description, asset_transaction_category_type, financial_institution_transaction_identifier].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_transaction_type.rb b/lib/plaid/models/asset_transaction_type.rb deleted file mode 100644 index eaa009a45..000000000 --- a/lib/plaid/models/asset_transaction_type.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class AssetTransactionType - CREDIT = "Credit".freeze - DEBIT = "Debit".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/asset_transactions.rb b/lib/plaid/models/asset_transactions.rb deleted file mode 100644 index e432fd30f..000000000 --- a/lib/plaid/models/asset_transactions.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class AssetTransactions - attr_accessor :asset_transaction - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_transaction' => :'ASSET_TRANSACTION' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_transaction' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetTransactions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetTransactions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_transaction') - if (value = attributes[:'asset_transaction']).is_a?(Array) - self.asset_transaction = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_transaction.nil? - invalid_properties.push('invalid value for "asset_transaction", asset_transaction cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_transaction.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_transaction == o.asset_transaction - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_transaction].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/asset_type.rb b/lib/plaid/models/asset_type.rb deleted file mode 100644 index a384ce884..000000000 --- a/lib/plaid/models/asset_type.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class AssetType - CHECKING_ACCOUNT = "CheckingAccount".freeze - SAVINGS_ACCOUNT = "SavingsAccount".freeze - INVESTMENT = "Investment".freeze - MONEY_MARKET_FUND = "MoneyMarketFund".freeze - OTHER = "Other".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/assets.rb b/lib/plaid/models/assets.rb deleted file mode 100644 index 6bff71cd5..000000000 --- a/lib/plaid/models/assets.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class Assets - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - attr_accessor :asset - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset' => :'ASSET' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Assets` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Assets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset') - if (value = attributes[:'asset']).is_a?(Array) - self.asset = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset.nil? - invalid_properties.push('invalid value for "asset", asset cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset == o.asset - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/assets_error_webhook.rb b/lib/plaid/models/assets_error_webhook.rb deleted file mode 100644 index 6c5d3382a..000000000 --- a/lib/plaid/models/assets_error_webhook.rb +++ /dev/null @@ -1,312 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when Asset Report generation has failed. The resulting `error` will have an `error_type` of `ASSET_REPORT_ERROR`. - class AssetsErrorWebhook - # `ASSETS` - attr_accessor :webhook_type - - # `ERROR` - attr_accessor :webhook_code - - attr_accessor :error - - # The ID associated with the Asset Report. - attr_accessor :asset_report_id - - # The `user_id` corresponding to the User ID the webhook has fired for. - attr_accessor :user_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'error' => :'error', - :'asset_report_id' => :'asset_report_id', - :'user_id' => :'user_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'error' => :'PlaidError', - :'asset_report_id' => :'String', - :'user_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetsErrorWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetsErrorWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'asset_report_id') - self.asset_report_id = attributes[:'asset_report_id'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @asset_report_id.nil? - invalid_properties.push('invalid value for "asset_report_id", asset_report_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @asset_report_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - error == o.error && - asset_report_id == o.asset_report_id && - user_id == o.user_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, error, asset_report_id, user_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/assets_product_ready_webhook.rb b/lib/plaid/models/assets_product_ready_webhook.rb deleted file mode 100644 index 3e1804bba..000000000 --- a/lib/plaid/models/assets_product_ready_webhook.rb +++ /dev/null @@ -1,312 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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`. - class AssetsProductReadyWebhook - # `ASSETS` - attr_accessor :webhook_type - - # `PRODUCT_READY` - attr_accessor :webhook_code - - # The `asset_report_id` corresponding to the Asset Report the webhook has fired for. - attr_accessor :asset_report_id - - # The `user_id` corresponding to the User ID the webhook has fired for. - attr_accessor :user_id - - # The report type, indicating whether the Asset Report is a `full` or `fast` report. - attr_accessor :report_type - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'asset_report_id' => :'asset_report_id', - :'user_id' => :'user_id', - :'report_type' => :'report_type', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'asset_report_id' => :'String', - :'user_id' => :'String', - :'report_type' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AssetsProductReadyWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AssetsProductReadyWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'asset_report_id') - self.asset_report_id = attributes[:'asset_report_id'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'report_type') - self.report_type = attributes[:'report_type'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @asset_report_id.nil? - invalid_properties.push('invalid value for "asset_report_id", asset_report_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @asset_report_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - asset_report_id == o.asset_report_id && - user_id == o.user_id && - report_type == o.report_type && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, asset_report_id, user_id, report_type, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/auth_get_numbers.rb b/lib/plaid/models/auth_get_numbers.rb deleted file mode 100644 index c73a35936..000000000 --- a/lib/plaid/models/auth_get_numbers.rb +++ /dev/null @@ -1,279 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing identifying numbers used for making electronic transfers to and from the `accounts`. The identifying number type (ACH, EFT, IBAN, or BACS) used will depend on the country of the account. An account may have more than one number type. If a particular identifying number type is not used by any `accounts` for which data has been requested, the array for that type will be empty. - class AuthGetNumbers - # An array of ACH numbers identifying accounts. - attr_accessor :ach - - # An array of EFT numbers identifying accounts. - attr_accessor :eft - - # An array of IBAN numbers identifying accounts. - attr_accessor :international - - # An array of BACS numbers identifying accounts. - attr_accessor :bacs - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ach' => :'ach', - :'eft' => :'eft', - :'international' => :'international', - :'bacs' => :'bacs' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ach' => :'Array', - :'eft' => :'Array', - :'international' => :'Array', - :'bacs' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AuthGetNumbers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AuthGetNumbers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ach') - if (value = attributes[:'ach']).is_a?(Array) - self.ach = value - end - end - - if attributes.key?(:'eft') - if (value = attributes[:'eft']).is_a?(Array) - self.eft = value - end - end - - if attributes.key?(:'international') - if (value = attributes[:'international']).is_a?(Array) - self.international = value - end - end - - if attributes.key?(:'bacs') - if (value = attributes[:'bacs']).is_a?(Array) - self.bacs = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @ach.nil? - invalid_properties.push('invalid value for "ach", ach cannot be nil.') - end - - if @eft.nil? - invalid_properties.push('invalid value for "eft", eft cannot be nil.') - end - - if @international.nil? - invalid_properties.push('invalid value for "international", international cannot be nil.') - end - - if @bacs.nil? - invalid_properties.push('invalid value for "bacs", bacs cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @ach.nil? - return false if @eft.nil? - return false if @international.nil? - return false if @bacs.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ach == o.ach && - eft == o.eft && - international == o.international && - bacs == o.bacs - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ach, eft, international, bacs].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/auth_get_request.rb b/lib/plaid/models/auth_get_request.rb deleted file mode 100644 index d46e5c962..000000000 --- a/lib/plaid/models/auth_get_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AuthGetRequest defines the request schema for `/auth/get` - class AuthGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'options' => :'AuthGetRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AuthGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AuthGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/auth_get_request_options.rb b/lib/plaid/models/auth_get_request_options.rb deleted file mode 100644 index 7dd9528a0..000000000 --- a/lib/plaid/models/auth_get_request_options.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to filter `/auth/get` results. - class AuthGetRequestOptions - # 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. - attr_accessor :account_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_ids' => :'account_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AuthGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AuthGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_ids') - if (value = attributes[:'account_ids']).is_a?(Array) - self.account_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_ids == o.account_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/auth_get_response.rb b/lib/plaid/models/auth_get_response.rb deleted file mode 100644 index 27076f587..000000000 --- a/lib/plaid/models/auth_get_response.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # AuthGetResponse defines the response schema for `/auth/get` - class AuthGetResponse - # The `accounts` for which numbers are being retrieved. - attr_accessor :accounts - - attr_accessor :numbers - - attr_accessor :item - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'accounts' => :'accounts', - :'numbers' => :'numbers', - :'item' => :'item', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'accounts' => :'Array', - :'numbers' => :'AuthGetNumbers', - :'item' => :'Item', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AuthGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AuthGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - - if attributes.key?(:'numbers') - self.numbers = attributes[:'numbers'] - end - - if attributes.key?(:'item') - self.item = attributes[:'item'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @accounts.nil? - invalid_properties.push('invalid value for "accounts", accounts cannot be nil.') - end - - if @numbers.nil? - invalid_properties.push('invalid value for "numbers", numbers cannot be nil.') - end - - if @item.nil? - invalid_properties.push('invalid value for "item", item cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @accounts.nil? - return false if @numbers.nil? - return false if @item.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - accounts == o.accounts && - numbers == o.numbers && - item == o.item && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [accounts, numbers, item, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/auth_metadata.rb b/lib/plaid/models/auth_metadata.rb deleted file mode 100644 index a96306a70..000000000 --- a/lib/plaid/models/auth_metadata.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Metadata that captures information about the Auth features of an institution. - class AuthMetadata - attr_accessor :supported_methods - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'supported_methods' => :'supported_methods' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'supported_methods' => :'AuthSupportedMethods' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'supported_methods' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AuthMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AuthMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'supported_methods') - self.supported_methods = attributes[:'supported_methods'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - supported_methods == o.supported_methods - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [supported_methods].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/auth_supported_methods.rb b/lib/plaid/models/auth_supported_methods.rb deleted file mode 100644 index 9808ffdfb..000000000 --- a/lib/plaid/models/auth_supported_methods.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Metadata specifically related to which auth methods an institution supports. - class AuthSupportedMethods - # Indicates if instant auth is supported. - attr_accessor :instant_auth - - # Indicates if instant match is supported. - attr_accessor :instant_match - - # Indicates if automated microdeposits are supported. - attr_accessor :automated_micro_deposits - - # Indicates if instant microdeposits are supported. - attr_accessor :instant_micro_deposits - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'instant_auth' => :'instant_auth', - :'instant_match' => :'instant_match', - :'automated_micro_deposits' => :'automated_micro_deposits', - :'instant_micro_deposits' => :'instant_micro_deposits' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'instant_auth' => :'Boolean', - :'instant_match' => :'Boolean', - :'automated_micro_deposits' => :'Boolean', - :'instant_micro_deposits' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AuthSupportedMethods` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AuthSupportedMethods`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'instant_auth') - self.instant_auth = attributes[:'instant_auth'] - end - - if attributes.key?(:'instant_match') - self.instant_match = attributes[:'instant_match'] - end - - if attributes.key?(:'automated_micro_deposits') - self.automated_micro_deposits = attributes[:'automated_micro_deposits'] - end - - if attributes.key?(:'instant_micro_deposits') - self.instant_micro_deposits = attributes[:'instant_micro_deposits'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @instant_auth.nil? - invalid_properties.push('invalid value for "instant_auth", instant_auth cannot be nil.') - end - - if @instant_match.nil? - invalid_properties.push('invalid value for "instant_match", instant_match cannot be nil.') - end - - if @automated_micro_deposits.nil? - invalid_properties.push('invalid value for "automated_micro_deposits", automated_micro_deposits cannot be nil.') - end - - if @instant_micro_deposits.nil? - invalid_properties.push('invalid value for "instant_micro_deposits", instant_micro_deposits cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @instant_auth.nil? - return false if @instant_match.nil? - return false if @automated_micro_deposits.nil? - return false if @instant_micro_deposits.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - instant_auth == o.instant_auth && - instant_match == o.instant_match && - automated_micro_deposits == o.automated_micro_deposits && - instant_micro_deposits == o.instant_micro_deposits - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [instant_auth, instant_match, automated_micro_deposits, instant_micro_deposits].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/automatically_verified_webhook.rb b/lib/plaid/models/automatically_verified_webhook.rb deleted file mode 100644 index 599618b7d..000000000 --- a/lib/plaid/models/automatically_verified_webhook.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class AutomaticallyVerifiedWebhook - # `AUTH` - attr_accessor :webhook_type - - # `AUTOMATICALLY_VERIFIED` - attr_accessor :webhook_code - - # The `account_id` of the account associated with the webhook - attr_accessor :account_id - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :environment - - attr_accessor :error - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'account_id' => :'account_id', - :'item_id' => :'item_id', - :'environment' => :'environment', - :'error' => :'error' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'account_id' => :'String', - :'item_id' => :'String', - :'environment' => :'WebhookEnvironmentValues', - :'error' => :'PlaidError' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::AutomaticallyVerifiedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::AutomaticallyVerifiedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @account_id.nil? - return false if @item_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - account_id == o.account_id && - item_id == o.item_id && - environment == o.environment && - error == o.error - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, account_id, item_id, environment, error].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/balance_plus_attributes.rb b/lib/plaid/models/balance_plus_attributes.rb deleted file mode 100644 index db876ea14..000000000 --- a/lib/plaid/models/balance_plus_attributes.rb +++ /dev/null @@ -1,508 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Contains additional data that can be used to assess the ACH return 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 `is_savings_or_money_market_account`: Indicates whether the ACH transaction funding account is a savings/money market account For the full list and detailed documentation of attributes available, or to request that attributes not be returned, contact Sales or your Plaid account manager - class BalancePlusAttributes - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to unauthorized transactions over the past 7 days from the account that will be debited. - attr_accessor :unauthorized_transactions_count_7d - - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to unauthorized transactions over the past 30 days from the account that will be debited. - attr_accessor :unauthorized_transactions_count_30d - - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to unauthorized transactions over the past 60 days from the account that will be debited. - attr_accessor :unauthorized_transactions_count_60d - - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to unauthorized transactions over the past 90 days from the account that will be debited. - attr_accessor :unauthorized_transactions_count_90d - - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to non-sufficient funds/overdrafts over the past 7 days from the account that will be debited. - attr_accessor :nsf_overdraft_transactions_count_7d - - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to non-sufficient funds/overdrafts over the past 30 days from the account that will be debited. - attr_accessor :nsf_overdraft_transactions_count_30d - - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to non-sufficient funds/overdrafts over the past 60 days from the account that will be debited. - attr_accessor :nsf_overdraft_transactions_count_60d - - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to non-sufficient funds/overdrafts over the past 90 days from the account that will be debited. - attr_accessor :nsf_overdraft_transactions_count_90d - - # The number of days since the first time the Item was connected to an application via Plaid - attr_accessor :days_since_first_plaid_connection - - # The number of times the Item has been connected to applications via Plaid over the past 7 days - attr_accessor :plaid_connections_count_7d - - # The number of times the Item has been connected to applications via Plaid over the past 30 days - attr_accessor :plaid_connections_count_30d - - # The total number of times the Item has been connected to applications via Plaid - attr_accessor :total_plaid_connections_count - - # Indicates if the ACH transaction funding account is a savings/money market account - attr_accessor :is_savings_or_money_market_account - - # The number of times the account's phone numbers on file have changed over the past 28 days - attr_accessor :phone_change_count_28d - - # The number of times the account's phone numbers on file have changed over the past 90 days - attr_accessor :phone_change_count_90d - - # The number of times the account's email addresses on file have changed over the past 28 days - attr_accessor :email_change_count_28d - - # The number of times the account's email addresses on file have changed over the past 90 days - attr_accessor :email_change_count_90d - - # The number of times the account's addresses on file have changed over the past 28 days - attr_accessor :address_change_count_28d - - # The number of times the account's addresses on file have changed over the past 90 days - attr_accessor :address_change_count_90d - - # The number of non-OAuth authentication attempts via Plaid for this bank account over the past 3 days - attr_accessor :plaid_non_oauth_authentication_attempts_count_3d - - # The number of non-OAuth authentication attempts via Plaid for this bank account over the past 7 days - attr_accessor :plaid_non_oauth_authentication_attempts_count_7d - - # The number of non-OAuth authentication attempts via Plaid for this bank account over the past 30 days - attr_accessor :plaid_non_oauth_authentication_attempts_count_30d - - # The number of failed non-OAuth authentication attempts via Plaid for this bank account over the past 3 days - attr_accessor :failed_plaid_non_oauth_authentication_attempts_count_3d - - # The number of failed non-OAuth authentication attempts via Plaid for this bank account over the past 7 days - attr_accessor :failed_plaid_non_oauth_authentication_attempts_count_7d - - # The number of failed non-OAuth authentication attempts via Plaid for this bank account over the past 30 days - attr_accessor :failed_plaid_non_oauth_authentication_attempts_count_30d - - # Indicates if the receiver bank account is closed - attr_accessor :is_account_closed - - # Indicates if the receiver bank account is either frozen or restricted - attr_accessor :is_account_frozen_or_restricted - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'unauthorized_transactions_count_7d' => :'unauthorized_transactions_count_7d', - :'unauthorized_transactions_count_30d' => :'unauthorized_transactions_count_30d', - :'unauthorized_transactions_count_60d' => :'unauthorized_transactions_count_60d', - :'unauthorized_transactions_count_90d' => :'unauthorized_transactions_count_90d', - :'nsf_overdraft_transactions_count_7d' => :'nsf_overdraft_transactions_count_7d', - :'nsf_overdraft_transactions_count_30d' => :'nsf_overdraft_transactions_count_30d', - :'nsf_overdraft_transactions_count_60d' => :'nsf_overdraft_transactions_count_60d', - :'nsf_overdraft_transactions_count_90d' => :'nsf_overdraft_transactions_count_90d', - :'days_since_first_plaid_connection' => :'days_since_first_plaid_connection', - :'plaid_connections_count_7d' => :'plaid_connections_count_7d', - :'plaid_connections_count_30d' => :'plaid_connections_count_30d', - :'total_plaid_connections_count' => :'total_plaid_connections_count', - :'is_savings_or_money_market_account' => :'is_savings_or_money_market_account', - :'phone_change_count_28d' => :'phone_change_count_28d', - :'phone_change_count_90d' => :'phone_change_count_90d', - :'email_change_count_28d' => :'email_change_count_28d', - :'email_change_count_90d' => :'email_change_count_90d', - :'address_change_count_28d' => :'address_change_count_28d', - :'address_change_count_90d' => :'address_change_count_90d', - :'plaid_non_oauth_authentication_attempts_count_3d' => :'plaid_non_oauth_authentication_attempts_count_3d', - :'plaid_non_oauth_authentication_attempts_count_7d' => :'plaid_non_oauth_authentication_attempts_count_7d', - :'plaid_non_oauth_authentication_attempts_count_30d' => :'plaid_non_oauth_authentication_attempts_count_30d', - :'failed_plaid_non_oauth_authentication_attempts_count_3d' => :'failed_plaid_non_oauth_authentication_attempts_count_3d', - :'failed_plaid_non_oauth_authentication_attempts_count_7d' => :'failed_plaid_non_oauth_authentication_attempts_count_7d', - :'failed_plaid_non_oauth_authentication_attempts_count_30d' => :'failed_plaid_non_oauth_authentication_attempts_count_30d', - :'is_account_closed' => :'is_account_closed', - :'is_account_frozen_or_restricted' => :'is_account_frozen_or_restricted' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'unauthorized_transactions_count_7d' => :'Integer', - :'unauthorized_transactions_count_30d' => :'Integer', - :'unauthorized_transactions_count_60d' => :'Integer', - :'unauthorized_transactions_count_90d' => :'Integer', - :'nsf_overdraft_transactions_count_7d' => :'Integer', - :'nsf_overdraft_transactions_count_30d' => :'Integer', - :'nsf_overdraft_transactions_count_60d' => :'Integer', - :'nsf_overdraft_transactions_count_90d' => :'Integer', - :'days_since_first_plaid_connection' => :'Integer', - :'plaid_connections_count_7d' => :'Integer', - :'plaid_connections_count_30d' => :'Integer', - :'total_plaid_connections_count' => :'Integer', - :'is_savings_or_money_market_account' => :'Boolean', - :'phone_change_count_28d' => :'Integer', - :'phone_change_count_90d' => :'Integer', - :'email_change_count_28d' => :'Integer', - :'email_change_count_90d' => :'Integer', - :'address_change_count_28d' => :'Integer', - :'address_change_count_90d' => :'Integer', - :'plaid_non_oauth_authentication_attempts_count_3d' => :'Integer', - :'plaid_non_oauth_authentication_attempts_count_7d' => :'Integer', - :'plaid_non_oauth_authentication_attempts_count_30d' => :'Integer', - :'failed_plaid_non_oauth_authentication_attempts_count_3d' => :'Integer', - :'failed_plaid_non_oauth_authentication_attempts_count_7d' => :'Integer', - :'failed_plaid_non_oauth_authentication_attempts_count_30d' => :'Integer', - :'is_account_closed' => :'Boolean', - :'is_account_frozen_or_restricted' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'unauthorized_transactions_count_7d', - :'unauthorized_transactions_count_30d', - :'unauthorized_transactions_count_60d', - :'unauthorized_transactions_count_90d', - :'nsf_overdraft_transactions_count_7d', - :'nsf_overdraft_transactions_count_30d', - :'nsf_overdraft_transactions_count_60d', - :'nsf_overdraft_transactions_count_90d', - :'days_since_first_plaid_connection', - :'plaid_connections_count_7d', - :'plaid_connections_count_30d', - :'total_plaid_connections_count', - :'is_savings_or_money_market_account', - :'phone_change_count_28d', - :'phone_change_count_90d', - :'email_change_count_28d', - :'email_change_count_90d', - :'address_change_count_28d', - :'address_change_count_90d', - :'plaid_non_oauth_authentication_attempts_count_3d', - :'plaid_non_oauth_authentication_attempts_count_7d', - :'plaid_non_oauth_authentication_attempts_count_30d', - :'failed_plaid_non_oauth_authentication_attempts_count_3d', - :'failed_plaid_non_oauth_authentication_attempts_count_7d', - :'failed_plaid_non_oauth_authentication_attempts_count_30d', - :'is_account_closed', - :'is_account_frozen_or_restricted' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BalancePlusAttributes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BalancePlusAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'unauthorized_transactions_count_7d') - self.unauthorized_transactions_count_7d = attributes[:'unauthorized_transactions_count_7d'] - end - - if attributes.key?(:'unauthorized_transactions_count_30d') - self.unauthorized_transactions_count_30d = attributes[:'unauthorized_transactions_count_30d'] - end - - if attributes.key?(:'unauthorized_transactions_count_60d') - self.unauthorized_transactions_count_60d = attributes[:'unauthorized_transactions_count_60d'] - end - - if attributes.key?(:'unauthorized_transactions_count_90d') - self.unauthorized_transactions_count_90d = attributes[:'unauthorized_transactions_count_90d'] - end - - if attributes.key?(:'nsf_overdraft_transactions_count_7d') - self.nsf_overdraft_transactions_count_7d = attributes[:'nsf_overdraft_transactions_count_7d'] - end - - if attributes.key?(:'nsf_overdraft_transactions_count_30d') - self.nsf_overdraft_transactions_count_30d = attributes[:'nsf_overdraft_transactions_count_30d'] - end - - if attributes.key?(:'nsf_overdraft_transactions_count_60d') - self.nsf_overdraft_transactions_count_60d = attributes[:'nsf_overdraft_transactions_count_60d'] - end - - if attributes.key?(:'nsf_overdraft_transactions_count_90d') - self.nsf_overdraft_transactions_count_90d = attributes[:'nsf_overdraft_transactions_count_90d'] - end - - if attributes.key?(:'days_since_first_plaid_connection') - self.days_since_first_plaid_connection = attributes[:'days_since_first_plaid_connection'] - end - - if attributes.key?(:'plaid_connections_count_7d') - self.plaid_connections_count_7d = attributes[:'plaid_connections_count_7d'] - end - - if attributes.key?(:'plaid_connections_count_30d') - self.plaid_connections_count_30d = attributes[:'plaid_connections_count_30d'] - end - - if attributes.key?(:'total_plaid_connections_count') - self.total_plaid_connections_count = attributes[:'total_plaid_connections_count'] - end - - if attributes.key?(:'is_savings_or_money_market_account') - self.is_savings_or_money_market_account = attributes[:'is_savings_or_money_market_account'] - end - - if attributes.key?(:'phone_change_count_28d') - self.phone_change_count_28d = attributes[:'phone_change_count_28d'] - end - - if attributes.key?(:'phone_change_count_90d') - self.phone_change_count_90d = attributes[:'phone_change_count_90d'] - end - - if attributes.key?(:'email_change_count_28d') - self.email_change_count_28d = attributes[:'email_change_count_28d'] - end - - if attributes.key?(:'email_change_count_90d') - self.email_change_count_90d = attributes[:'email_change_count_90d'] - end - - if attributes.key?(:'address_change_count_28d') - self.address_change_count_28d = attributes[:'address_change_count_28d'] - end - - if attributes.key?(:'address_change_count_90d') - self.address_change_count_90d = attributes[:'address_change_count_90d'] - end - - if attributes.key?(:'plaid_non_oauth_authentication_attempts_count_3d') - self.plaid_non_oauth_authentication_attempts_count_3d = attributes[:'plaid_non_oauth_authentication_attempts_count_3d'] - end - - if attributes.key?(:'plaid_non_oauth_authentication_attempts_count_7d') - self.plaid_non_oauth_authentication_attempts_count_7d = attributes[:'plaid_non_oauth_authentication_attempts_count_7d'] - end - - if attributes.key?(:'plaid_non_oauth_authentication_attempts_count_30d') - self.plaid_non_oauth_authentication_attempts_count_30d = attributes[:'plaid_non_oauth_authentication_attempts_count_30d'] - end - - if attributes.key?(:'failed_plaid_non_oauth_authentication_attempts_count_3d') - self.failed_plaid_non_oauth_authentication_attempts_count_3d = attributes[:'failed_plaid_non_oauth_authentication_attempts_count_3d'] - end - - if attributes.key?(:'failed_plaid_non_oauth_authentication_attempts_count_7d') - self.failed_plaid_non_oauth_authentication_attempts_count_7d = attributes[:'failed_plaid_non_oauth_authentication_attempts_count_7d'] - end - - if attributes.key?(:'failed_plaid_non_oauth_authentication_attempts_count_30d') - self.failed_plaid_non_oauth_authentication_attempts_count_30d = attributes[:'failed_plaid_non_oauth_authentication_attempts_count_30d'] - end - - if attributes.key?(:'is_account_closed') - self.is_account_closed = attributes[:'is_account_closed'] - end - - if attributes.key?(:'is_account_frozen_or_restricted') - self.is_account_frozen_or_restricted = attributes[:'is_account_frozen_or_restricted'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - unauthorized_transactions_count_7d == o.unauthorized_transactions_count_7d && - unauthorized_transactions_count_30d == o.unauthorized_transactions_count_30d && - unauthorized_transactions_count_60d == o.unauthorized_transactions_count_60d && - unauthorized_transactions_count_90d == o.unauthorized_transactions_count_90d && - nsf_overdraft_transactions_count_7d == o.nsf_overdraft_transactions_count_7d && - nsf_overdraft_transactions_count_30d == o.nsf_overdraft_transactions_count_30d && - nsf_overdraft_transactions_count_60d == o.nsf_overdraft_transactions_count_60d && - nsf_overdraft_transactions_count_90d == o.nsf_overdraft_transactions_count_90d && - days_since_first_plaid_connection == o.days_since_first_plaid_connection && - plaid_connections_count_7d == o.plaid_connections_count_7d && - plaid_connections_count_30d == o.plaid_connections_count_30d && - total_plaid_connections_count == o.total_plaid_connections_count && - is_savings_or_money_market_account == o.is_savings_or_money_market_account && - phone_change_count_28d == o.phone_change_count_28d && - phone_change_count_90d == o.phone_change_count_90d && - email_change_count_28d == o.email_change_count_28d && - email_change_count_90d == o.email_change_count_90d && - address_change_count_28d == o.address_change_count_28d && - address_change_count_90d == o.address_change_count_90d && - plaid_non_oauth_authentication_attempts_count_3d == o.plaid_non_oauth_authentication_attempts_count_3d && - plaid_non_oauth_authentication_attempts_count_7d == o.plaid_non_oauth_authentication_attempts_count_7d && - plaid_non_oauth_authentication_attempts_count_30d == o.plaid_non_oauth_authentication_attempts_count_30d && - failed_plaid_non_oauth_authentication_attempts_count_3d == o.failed_plaid_non_oauth_authentication_attempts_count_3d && - failed_plaid_non_oauth_authentication_attempts_count_7d == o.failed_plaid_non_oauth_authentication_attempts_count_7d && - failed_plaid_non_oauth_authentication_attempts_count_30d == o.failed_plaid_non_oauth_authentication_attempts_count_30d && - is_account_closed == o.is_account_closed && - is_account_frozen_or_restricted == o.is_account_frozen_or_restricted - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [unauthorized_transactions_count_7d, unauthorized_transactions_count_30d, unauthorized_transactions_count_60d, unauthorized_transactions_count_90d, nsf_overdraft_transactions_count_7d, nsf_overdraft_transactions_count_30d, nsf_overdraft_transactions_count_60d, nsf_overdraft_transactions_count_90d, days_since_first_plaid_connection, plaid_connections_count_7d, plaid_connections_count_30d, total_plaid_connections_count, is_savings_or_money_market_account, phone_change_count_28d, phone_change_count_90d, email_change_count_28d, email_change_count_90d, address_change_count_28d, address_change_count_90d, plaid_non_oauth_authentication_attempts_count_3d, plaid_non_oauth_authentication_attempts_count_7d, plaid_non_oauth_authentication_attempts_count_30d, failed_plaid_non_oauth_authentication_attempts_count_3d, failed_plaid_non_oauth_authentication_attempts_count_7d, failed_plaid_non_oauth_authentication_attempts_count_30d, is_account_closed, is_account_frozen_or_restricted].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_income_complete_result.rb b/lib/plaid/models/bank_income_complete_result.rb deleted file mode 100644 index 8fc6c4dee..000000000 --- a/lib/plaid/models/bank_income_complete_result.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class BankIncomeCompleteResult - SUCCESS = "SUCCESS".freeze - FAILURE = "FAILURE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/bank_income_complete_webhook.rb b/lib/plaid/models/bank_income_complete_webhook.rb deleted file mode 100644 index 8dd88a55b..000000000 --- a/lib/plaid/models/bank_income_complete_webhook.rb +++ /dev/null @@ -1,306 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when a bank income report has finished generating or failed to generate, triggered by calling `/credit/bank_income/get` in CRA enabled client. - class BankIncomeCompleteWebhook - # `INCOME` - attr_accessor :webhook_type - - # `BANK_INCOME_COMPLETE` - attr_accessor :webhook_code - - # The `user_id` corresponding to the user the webhook has fired for. - attr_accessor :user_id - - attr_accessor :result - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'user_id' => :'user_id', - :'result' => :'result', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'user_id' => :'String', - :'result' => :'BankIncomeCompleteResult', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankIncomeCompleteWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankIncomeCompleteWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'result') - self.result = attributes[:'result'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @user_id.nil? - invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') - end - - if @result.nil? - invalid_properties.push('invalid value for "result", result cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @user_id.nil? - return false if @result.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - user_id == o.user_id && - result == o.result && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, user_id, result, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_income_refresh_complete_result.rb b/lib/plaid/models/bank_income_refresh_complete_result.rb deleted file mode 100644 index 49674e56b..000000000 --- a/lib/plaid/models/bank_income_refresh_complete_result.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class BankIncomeRefreshCompleteResult - SUCCESS = "SUCCESS".freeze - FAILURE = "FAILURE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/bank_income_refresh_complete_webhook.rb b/lib/plaid/models/bank_income_refresh_complete_webhook.rb deleted file mode 100644 index 62df6b16f..000000000 --- a/lib/plaid/models/bank_income_refresh_complete_webhook.rb +++ /dev/null @@ -1,306 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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). - class BankIncomeRefreshCompleteWebhook - # `INCOME` - attr_accessor :webhook_type - - # `BANK_INCOME_REFRESH_COMPLETE` - attr_accessor :webhook_code - - # The `user_id` corresponding to the user the webhook has fired for. - attr_accessor :user_id - - attr_accessor :result - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'user_id' => :'user_id', - :'result' => :'result', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'user_id' => :'String', - :'result' => :'BankIncomeRefreshCompleteResult', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankIncomeRefreshCompleteWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankIncomeRefreshCompleteWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'result') - self.result = attributes[:'result'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @user_id.nil? - invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') - end - - if @result.nil? - invalid_properties.push('invalid value for "result", result cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @user_id.nil? - return false if @result.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - user_id == o.user_id && - result == o.result && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, user_id, result, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_income_refresh_update_webhook.rb b/lib/plaid/models/bank_income_refresh_update_webhook.rb deleted file mode 100644 index 988608bc6..000000000 --- a/lib/plaid/models/bank_income_refresh_update_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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). - class BankIncomeRefreshUpdateWebhook - # `INCOME` - attr_accessor :webhook_type - - # `BANK_INCOME_REFRESH_UPDATE` - attr_accessor :webhook_code - - # The `user_id` corresponding to the user the webhook has fired for. - attr_accessor :user_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'user_id' => :'user_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'user_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankIncomeRefreshUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankIncomeRefreshUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @user_id.nil? - invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @user_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - user_id == o.user_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, user_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_initiated_return_risk.rb b/lib/plaid/models/bank_initiated_return_risk.rb deleted file mode 100644 index 95e6e901e..000000000 --- a/lib/plaid/models/bank_initiated_return_risk.rb +++ /dev/null @@ -1,301 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The object contains a risk score and a risk tier that evaluate the transaction return risk because an account is overdrawn or because an ineligible account is used. Common return codes in this category include: \"R01\", \"R02\", \"R03\", \"R04\", \"R06\", \"R08\", \"R09\", \"R13\", \"R16\", \"R17\", \"R20\", \"R23\". These returns have a turnaround time of 2 banking days. - class BankInitiatedReturnRisk - # A score from 1-99 that indicates the transaction return risk: a higher risk score suggests a higher return likelihood. - attr_accessor :score - - # In the `bank_initiated_return_risk` object, there are eight risk tiers corresponding to the scores: 1: Predicted bank-initiated return incidence rate between 0.0% - 0.5% 2: Predicted bank-initiated return incidence rate between 0.5% - 1.5% 3: Predicted bank-initiated return incidence rate between 1.5% - 3% 4: Predicted bank-initiated return incidence rate between 3% - 5% 5: Predicted bank-initiated return incidence rate between 5% - 10% 6: Predicted bank-initiated return incidence rate between 10% - 15% 7: Predicted bank-initiated return incidence rate between 15% and 50% 8: Predicted bank-initiated return incidence rate greater than 50% - attr_accessor :risk_tier - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'score' => :'score', - :'risk_tier' => :'risk_tier' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'score' => :'Integer', - :'risk_tier' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankInitiatedReturnRisk` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankInitiatedReturnRisk`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'score') - self.score = attributes[:'score'] - end - - if attributes.key?(:'risk_tier') - self.risk_tier = attributes[:'risk_tier'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @score.nil? - invalid_properties.push('invalid value for "score", score cannot be nil.') - end - - if @score > 99 - invalid_properties.push('invalid value for "score", must be smaller than or equal to 99.') - end - - if @score < 1 - invalid_properties.push('invalid value for "score", must be greater than or equal to 1.') - end - - - if @risk_tier.nil? - invalid_properties.push('invalid value for "risk_tier", risk_tier cannot be nil.') - end - - if @risk_tier > 8 - invalid_properties.push('invalid value for "risk_tier", must be smaller than or equal to 8.') - end - - if @risk_tier < 1 - invalid_properties.push('invalid value for "risk_tier", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @score.nil? - return false if @score > 99 - return false if @score < 1 - return false if @risk_tier.nil? - return false if @risk_tier > 8 - return false if @risk_tier < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] score Value to be assigned - def score=(score) - if score.nil? - fail ArgumentError, 'score cannot be nil' - end - - if score > 99 - fail ArgumentError, 'invalid value for "score", must be smaller than or equal to 99.' - end - - if score < 1 - fail ArgumentError, 'invalid value for "score", must be greater than or equal to 1.' - end - - - @score = score - end - - # Custom attribute writer method with validation - # @param [Object] risk_tier Value to be assigned - def risk_tier=(risk_tier) - if risk_tier.nil? - fail ArgumentError, 'risk_tier cannot be nil' - end - - if risk_tier > 8 - fail ArgumentError, 'invalid value for "risk_tier", must be smaller than or equal to 8.' - end - - if risk_tier < 1 - fail ArgumentError, 'invalid value for "risk_tier", must be greater than or equal to 1.' - end - - - @risk_tier = risk_tier - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - score == o.score && - risk_tier == o.risk_tier - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [score, risk_tier].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer.rb b/lib/plaid/models/bank_transfer.rb deleted file mode 100644 index 809f7865e..000000000 --- a/lib/plaid/models/bank_transfer.rb +++ /dev/null @@ -1,476 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Represents a bank transfer within the Bank Transfers API. - class BankTransfer - # Plaid’s unique identifier for a bank transfer. - attr_accessor :id - - attr_accessor :ach_class - - # The account ID that should be credited/debited for this bank transfer. - attr_accessor :account_id - - attr_accessor :type - - attr_accessor :user - - # The amount of the bank transfer (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :amount - - # The currency of the transfer amount, e.g. \"USD\" - attr_accessor :iso_currency_code - - # The description of the transfer. - attr_accessor :description - - # The datetime when this bank transfer was created. This will be of the form `2006-01-02T15:04:05Z` - attr_accessor :created - - attr_accessor :status - - attr_accessor :network - - # When `true`, you can still cancel this bank transfer. - attr_accessor :cancellable - - attr_accessor :failure_reason - - # A string containing the custom tag provided by the client in the create request. Will be null if not provided. - attr_accessor :custom_tag - - # 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 - attr_accessor :metadata - - # Plaid’s unique identifier for the origination account that was used for this transfer. - attr_accessor :origination_account_id - - attr_accessor :direction - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'ach_class' => :'ach_class', - :'account_id' => :'account_id', - :'type' => :'type', - :'user' => :'user', - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code', - :'description' => :'description', - :'created' => :'created', - :'status' => :'status', - :'network' => :'network', - :'cancellable' => :'cancellable', - :'failure_reason' => :'failure_reason', - :'custom_tag' => :'custom_tag', - :'metadata' => :'metadata', - :'origination_account_id' => :'origination_account_id', - :'direction' => :'direction' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'ach_class' => :'ACHClass', - :'account_id' => :'String', - :'type' => :'BankTransferType', - :'user' => :'BankTransferUser', - :'amount' => :'String', - :'iso_currency_code' => :'String', - :'description' => :'String', - :'created' => :'Time', - :'status' => :'BankTransferStatus', - :'network' => :'BankTransferNetwork', - :'cancellable' => :'Boolean', - :'failure_reason' => :'BankTransferFailure', - :'custom_tag' => :'String', - :'metadata' => :'Hash', - :'origination_account_id' => :'String', - :'direction' => :'BankTransferDirection' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'failure_reason', - :'custom_tag', - :'metadata', - :'direction' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransfer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransfer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'ach_class') - self.ach_class = attributes[:'ach_class'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'created') - self.created = attributes[:'created'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'network') - self.network = attributes[:'network'] - end - - if attributes.key?(:'cancellable') - self.cancellable = attributes[:'cancellable'] - end - - if attributes.key?(:'failure_reason') - self.failure_reason = attributes[:'failure_reason'] - end - - if attributes.key?(:'custom_tag') - self.custom_tag = attributes[:'custom_tag'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Hash) - self.metadata = value - end - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'direction') - self.direction = attributes[:'direction'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @ach_class.nil? - invalid_properties.push('invalid value for "ach_class", ach_class cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @created.nil? - invalid_properties.push('invalid value for "created", created cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @network.nil? - invalid_properties.push('invalid value for "network", network cannot be nil.') - end - - if @cancellable.nil? - invalid_properties.push('invalid value for "cancellable", cancellable cannot be nil.') - end - - - if @origination_account_id.nil? - invalid_properties.push('invalid value for "origination_account_id", origination_account_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @ach_class.nil? - return false if @account_id.nil? - return false if @type.nil? - return false if @user.nil? - return false if @amount.nil? - return false if @iso_currency_code.nil? - return false if @description.nil? - return false if @created.nil? - return false if @status.nil? - return false if @network.nil? - return false if @cancellable.nil? - return false if @metadata.length > 50 - return false if @origination_account_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] metadata Value to be assigned - def metadata=(metadata) - - @metadata = metadata - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - ach_class == o.ach_class && - account_id == o.account_id && - type == o.type && - user == o.user && - amount == o.amount && - iso_currency_code == o.iso_currency_code && - description == o.description && - created == o.created && - status == o.status && - network == o.network && - cancellable == o.cancellable && - failure_reason == o.failure_reason && - custom_tag == o.custom_tag && - metadata == o.metadata && - origination_account_id == o.origination_account_id && - direction == o.direction - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, ach_class, account_id, type, user, amount, iso_currency_code, description, created, status, network, cancellable, failure_reason, custom_tag, metadata, origination_account_id, direction].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_balance.rb b/lib/plaid/models/bank_transfer_balance.rb deleted file mode 100644 index 03b046215..000000000 --- a/lib/plaid/models/bank_transfer_balance.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the balance of a bank transfer - class BankTransferBalance - # The total available balance - the sum of all successful debit transfer amounts minus all credit transfer amounts. - attr_accessor :available - - # 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. - attr_accessor :transactable - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'available' => :'available', - :'transactable' => :'transactable' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'available' => :'String', - :'transactable' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferBalance` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'available') - self.available = attributes[:'available'] - end - - if attributes.key?(:'transactable') - self.transactable = attributes[:'transactable'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @available.nil? - invalid_properties.push('invalid value for "available", available cannot be nil.') - end - - if @transactable.nil? - invalid_properties.push('invalid value for "transactable", transactable cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @available.nil? - return false if @transactable.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - available == o.available && - transactable == o.transactable - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [available, transactable].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_balance_get_request.rb b/lib/plaid/models/bank_transfer_balance_get_request.rb deleted file mode 100644 index f4174b2aa..000000000 --- a/lib/plaid/models/bank_transfer_balance_get_request.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/bank_transfer/balance/get` - class BankTransferBalanceGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # If multiple origination accounts are available, `origination_account_id` must be used to specify the account for which balance will be returned. - attr_accessor :origination_account_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'origination_account_id' => :'origination_account_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'origination_account_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'origination_account_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferBalanceGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferBalanceGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - origination_account_id == o.origination_account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, origination_account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_balance_get_response.rb b/lib/plaid/models/bank_transfer_balance_get_response.rb deleted file mode 100644 index 037198e26..000000000 --- a/lib/plaid/models/bank_transfer_balance_get_response.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/bank_transfer/balance/get` - class BankTransferBalanceGetResponse - attr_accessor :balance - - # The ID of the origination account that this balance belongs to. - attr_accessor :origination_account_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'balance' => :'balance', - :'origination_account_id' => :'origination_account_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'balance' => :'BankTransferBalance', - :'origination_account_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'origination_account_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferBalanceGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferBalanceGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'balance') - self.balance = attributes[:'balance'] - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @balance.nil? - invalid_properties.push('invalid value for "balance", balance cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @balance.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - balance == o.balance && - origination_account_id == o.origination_account_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [balance, origination_account_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_cancel_request.rb b/lib/plaid/models/bank_transfer_cancel_request.rb deleted file mode 100644 index a2feafd82..000000000 --- a/lib/plaid/models/bank_transfer_cancel_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/bank_transfer/cancel` - class BankTransferCancelRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a bank transfer. - attr_accessor :bank_transfer_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'bank_transfer_id' => :'bank_transfer_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'bank_transfer_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferCancelRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferCancelRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'bank_transfer_id') - self.bank_transfer_id = attributes[:'bank_transfer_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @bank_transfer_id.nil? - invalid_properties.push('invalid value for "bank_transfer_id", bank_transfer_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @bank_transfer_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - bank_transfer_id == o.bank_transfer_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, bank_transfer_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_cancel_response.rb b/lib/plaid/models/bank_transfer_cancel_response.rb deleted file mode 100644 index 7478f7525..000000000 --- a/lib/plaid/models/bank_transfer_cancel_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/bank_transfer/cancel` - class BankTransferCancelResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferCancelResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferCancelResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_create_request.rb b/lib/plaid/models/bank_transfer_create_request.rb deleted file mode 100644 index 991c01048..000000000 --- a/lib/plaid/models/bank_transfer_create_request.rb +++ /dev/null @@ -1,497 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/bank_transfer/create` - class BankTransferCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A random key provided by the client, per unique bank transfer. Maximum of 50 characters. The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. For example, if a request to create a bank transfer fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single bank transfer is created. - attr_accessor :idempotency_key - - # The Plaid `access_token` for the account that will be debited or credited. - attr_accessor :access_token - - # The Plaid `account_id` for the account that will be debited or credited. - attr_accessor :account_id - - attr_accessor :type - - attr_accessor :network - - # The amount of the bank transfer (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :amount - - # The currency of the transfer amount – should be set to \"USD\". - attr_accessor :iso_currency_code - - # The transfer description. Maximum of 10 characters. - attr_accessor :description - - attr_accessor :ach_class - - attr_accessor :user - - # An arbitrary string provided by the client for storage with the bank transfer. May be up to 100 characters. - attr_accessor :custom_tag - - # 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 - attr_accessor :metadata - - # Plaid’s unique identifier for the origination account for this transfer. If you have more than one origination account, this value must be specified. Otherwise, this field should be left blank. - attr_accessor :origination_account_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'idempotency_key' => :'idempotency_key', - :'access_token' => :'access_token', - :'account_id' => :'account_id', - :'type' => :'type', - :'network' => :'network', - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code', - :'description' => :'description', - :'ach_class' => :'ach_class', - :'user' => :'user', - :'custom_tag' => :'custom_tag', - :'metadata' => :'metadata', - :'origination_account_id' => :'origination_account_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'idempotency_key' => :'String', - :'access_token' => :'String', - :'account_id' => :'String', - :'type' => :'BankTransferType', - :'network' => :'BankTransferNetwork', - :'amount' => :'String', - :'iso_currency_code' => :'String', - :'description' => :'String', - :'ach_class' => :'ACHClass', - :'user' => :'BankTransferUser', - :'custom_tag' => :'String', - :'metadata' => :'Hash', - :'origination_account_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'custom_tag', - :'metadata', - :'origination_account_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'idempotency_key') - self.idempotency_key = attributes[:'idempotency_key'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'network') - self.network = attributes[:'network'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'ach_class') - self.ach_class = attributes[:'ach_class'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'custom_tag') - self.custom_tag = attributes[:'custom_tag'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Hash) - self.metadata = value - end - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @idempotency_key.nil? - invalid_properties.push('invalid value for "idempotency_key", idempotency_key cannot be nil.') - end - - if @idempotency_key.to_s.length > 50 - invalid_properties.push('invalid value for "idempotency_key", the character length must be smaller than or equal to 50.') - end - - - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @network.nil? - invalid_properties.push('invalid value for "network", network cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @description.to_s.length > 10 - invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 10.') - end - - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if !@custom_tag.nil? && @custom_tag.to_s.length > 100 - invalid_properties.push('invalid value for "custom_tag", the character length must be smaller than or equal to 100.') - end - - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @idempotency_key.nil? - return false if @idempotency_key.to_s.length > 50 - return false if @access_token.nil? - return false if @account_id.nil? - return false if @type.nil? - return false if @network.nil? - return false if @amount.nil? - return false if @iso_currency_code.nil? - return false if @description.nil? - return false if @description.to_s.length > 10 - return false if @user.nil? - return false if !@custom_tag.nil? && @custom_tag.to_s.length > 100 - return false if !@metadata.nil? && @metadata.length > 50 - true - end - - # Custom attribute writer method with validation - # @param [Object] idempotency_key Value to be assigned - def idempotency_key=(idempotency_key) - if idempotency_key.nil? - fail ArgumentError, 'idempotency_key cannot be nil' - end - - if idempotency_key.to_s.length > 50 - fail ArgumentError, 'invalid value for "idempotency_key", the character length must be smaller than or equal to 50.' - end - - - @idempotency_key = idempotency_key - end - - # Custom attribute writer method with validation - # @param [Object] description Value to be assigned - def description=(description) - if description.nil? - fail ArgumentError, 'description cannot be nil' - end - - if description.to_s.length > 10 - fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 10.' - end - - - @description = description - end - - # Custom attribute writer method with validation - # @param [Object] custom_tag Value to be assigned - def custom_tag=(custom_tag) - if !custom_tag.nil? && custom_tag.to_s.length > 100 - fail ArgumentError, 'invalid value for "custom_tag", the character length must be smaller than or equal to 100.' - end - - - @custom_tag = custom_tag - end - - # Custom attribute writer method with validation - # @param [Object] metadata Value to be assigned - def metadata=(metadata) - - @metadata = metadata - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - idempotency_key == o.idempotency_key && - access_token == o.access_token && - account_id == o.account_id && - type == o.type && - network == o.network && - amount == o.amount && - iso_currency_code == o.iso_currency_code && - description == o.description && - ach_class == o.ach_class && - user == o.user && - custom_tag == o.custom_tag && - metadata == o.metadata && - origination_account_id == o.origination_account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, idempotency_key, access_token, account_id, type, network, amount, iso_currency_code, description, ach_class, user, custom_tag, metadata, origination_account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_create_response.rb b/lib/plaid/models/bank_transfer_create_response.rb deleted file mode 100644 index 137a2763a..000000000 --- a/lib/plaid/models/bank_transfer_create_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/bank_transfer/create` - class BankTransferCreateResponse - attr_accessor :bank_transfer - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_transfer' => :'bank_transfer', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_transfer' => :'BankTransfer', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_transfer') - self.bank_transfer = attributes[:'bank_transfer'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @bank_transfer.nil? - invalid_properties.push('invalid value for "bank_transfer", bank_transfer cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @bank_transfer.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_transfer == o.bank_transfer && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_transfer, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_direction.rb b/lib/plaid/models/bank_transfer_direction.rb deleted file mode 100644 index 83b52e355..000000000 --- a/lib/plaid/models/bank_transfer_direction.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class BankTransferDirection - OUTBOUND = "outbound".freeze - INBOUND = "inbound".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/bank_transfer_event.rb b/lib/plaid/models/bank_transfer_event.rb deleted file mode 100644 index 7f02d8210..000000000 --- a/lib/plaid/models/bank_transfer_event.rb +++ /dev/null @@ -1,403 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Represents an event in the Bank Transfers API. - class BankTransferEvent - # Plaid’s unique identifier for this event. IDs are sequential unsigned 64-bit integers. - attr_accessor :event_id - - # The datetime when this event occurred. This will be of the form `2006-01-02T15:04:05Z`. - attr_accessor :timestamp - - attr_accessor :event_type - - # The account ID associated with the bank transfer. - attr_accessor :account_id - - # Plaid’s unique identifier for a bank transfer. - attr_accessor :bank_transfer_id - - # The ID of the origination account that this balance belongs to. - attr_accessor :origination_account_id - - attr_accessor :bank_transfer_type - - # The bank transfer amount. - attr_accessor :bank_transfer_amount - - # The currency of the bank transfer amount. - attr_accessor :bank_transfer_iso_currency_code - - attr_accessor :failure_reason - - attr_accessor :direction - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'event_id' => :'event_id', - :'timestamp' => :'timestamp', - :'event_type' => :'event_type', - :'account_id' => :'account_id', - :'bank_transfer_id' => :'bank_transfer_id', - :'origination_account_id' => :'origination_account_id', - :'bank_transfer_type' => :'bank_transfer_type', - :'bank_transfer_amount' => :'bank_transfer_amount', - :'bank_transfer_iso_currency_code' => :'bank_transfer_iso_currency_code', - :'failure_reason' => :'failure_reason', - :'direction' => :'direction' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'event_id' => :'Integer', - :'timestamp' => :'Time', - :'event_type' => :'BankTransferEventType', - :'account_id' => :'String', - :'bank_transfer_id' => :'String', - :'origination_account_id' => :'String', - :'bank_transfer_type' => :'BankTransferType', - :'bank_transfer_amount' => :'String', - :'bank_transfer_iso_currency_code' => :'String', - :'failure_reason' => :'BankTransferFailure', - :'direction' => :'BankTransferDirection' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'origination_account_id', - :'failure_reason', - :'direction' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferEvent` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'event_id') - self.event_id = attributes[:'event_id'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - - if attributes.key?(:'event_type') - self.event_type = attributes[:'event_type'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'bank_transfer_id') - self.bank_transfer_id = attributes[:'bank_transfer_id'] - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'bank_transfer_type') - self.bank_transfer_type = attributes[:'bank_transfer_type'] - end - - if attributes.key?(:'bank_transfer_amount') - self.bank_transfer_amount = attributes[:'bank_transfer_amount'] - end - - if attributes.key?(:'bank_transfer_iso_currency_code') - self.bank_transfer_iso_currency_code = attributes[:'bank_transfer_iso_currency_code'] - end - - if attributes.key?(:'failure_reason') - self.failure_reason = attributes[:'failure_reason'] - end - - if attributes.key?(:'direction') - self.direction = attributes[:'direction'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @event_id.nil? - invalid_properties.push('invalid value for "event_id", event_id cannot be nil.') - end - - if @event_id < 0 - invalid_properties.push('invalid value for "event_id", must be greater than or equal to 0.') - end - - - if @timestamp.nil? - invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.') - end - - if @event_type.nil? - invalid_properties.push('invalid value for "event_type", event_type cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @bank_transfer_id.nil? - invalid_properties.push('invalid value for "bank_transfer_id", bank_transfer_id cannot be nil.') - end - - if @bank_transfer_type.nil? - invalid_properties.push('invalid value for "bank_transfer_type", bank_transfer_type cannot be nil.') - end - - if @bank_transfer_amount.nil? - invalid_properties.push('invalid value for "bank_transfer_amount", bank_transfer_amount cannot be nil.') - end - - if @bank_transfer_iso_currency_code.nil? - invalid_properties.push('invalid value for "bank_transfer_iso_currency_code", bank_transfer_iso_currency_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @event_id.nil? - return false if @event_id < 0 - return false if @timestamp.nil? - return false if @event_type.nil? - return false if @account_id.nil? - return false if @bank_transfer_id.nil? - return false if @bank_transfer_type.nil? - return false if @bank_transfer_amount.nil? - return false if @bank_transfer_iso_currency_code.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] event_id Value to be assigned - def event_id=(event_id) - if event_id.nil? - fail ArgumentError, 'event_id cannot be nil' - end - - if event_id < 0 - fail ArgumentError, 'invalid value for "event_id", must be greater than or equal to 0.' - end - - - @event_id = event_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - event_id == o.event_id && - timestamp == o.timestamp && - event_type == o.event_type && - account_id == o.account_id && - bank_transfer_id == o.bank_transfer_id && - origination_account_id == o.origination_account_id && - bank_transfer_type == o.bank_transfer_type && - bank_transfer_amount == o.bank_transfer_amount && - bank_transfer_iso_currency_code == o.bank_transfer_iso_currency_code && - failure_reason == o.failure_reason && - direction == o.direction - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [event_id, timestamp, event_type, account_id, bank_transfer_id, origination_account_id, bank_transfer_type, bank_transfer_amount, bank_transfer_iso_currency_code, failure_reason, direction].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_event_list_bank_transfer_type.rb b/lib/plaid/models/bank_transfer_event_list_bank_transfer_type.rb deleted file mode 100644 index c7e8a35cf..000000000 --- a/lib/plaid/models/bank_transfer_event_list_bank_transfer_type.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class BankTransferEventListBankTransferType - DEBIT = "debit".freeze - CREDIT = "credit".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/bank_transfer_event_list_direction.rb b/lib/plaid/models/bank_transfer_event_list_direction.rb deleted file mode 100644 index 0d5bd3a6b..000000000 --- a/lib/plaid/models/bank_transfer_event_list_direction.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class BankTransferEventListDirection - INBOUND = "inbound".freeze - OUTBOUND = "outbound".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/bank_transfer_event_list_request.rb b/lib/plaid/models/bank_transfer_event_list_request.rb deleted file mode 100644 index 53469eba9..000000000 --- a/lib/plaid/models/bank_transfer_event_list_request.rb +++ /dev/null @@ -1,409 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/bank_transfer/event/list` - class BankTransferEventListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The start datetime of bank transfers to list. This should be in RFC 3339 format (i.e. `2019-12-06T22:35:49Z`) - attr_accessor :start_date - - # The end datetime of bank transfers to list. This should be in RFC 3339 format (i.e. `2019-12-06T22:35:49Z`) - attr_accessor :end_date - - # Plaid’s unique identifier for a bank transfer. - attr_accessor :bank_transfer_id - - # The account ID to get events for all transactions to/from an account. - attr_accessor :account_id - - attr_accessor :bank_transfer_type - - # Filter events by event type. - attr_accessor :event_types - - # The maximum number of bank transfer events to return. If the number of events matching the above parameters is greater than `count`, the most recent events will be returned. - attr_accessor :count - - # The offset into the list of bank transfer events. When `count`=25 and `offset`=0, the first 25 events will be returned. When `count`=25 and `offset`=25, the next 25 bank transfer events will be returned. - attr_accessor :offset - - # The origination account ID to get events for transfers from a specific origination account. - attr_accessor :origination_account_id - - attr_accessor :direction - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'bank_transfer_id' => :'bank_transfer_id', - :'account_id' => :'account_id', - :'bank_transfer_type' => :'bank_transfer_type', - :'event_types' => :'event_types', - :'count' => :'count', - :'offset' => :'offset', - :'origination_account_id' => :'origination_account_id', - :'direction' => :'direction' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'start_date' => :'Time', - :'end_date' => :'Time', - :'bank_transfer_id' => :'String', - :'account_id' => :'String', - :'bank_transfer_type' => :'BankTransferEventListBankTransferType', - :'event_types' => :'Array', - :'count' => :'Integer', - :'offset' => :'Integer', - :'origination_account_id' => :'String', - :'direction' => :'BankTransferEventListDirection' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'start_date', - :'end_date', - :'bank_transfer_id', - :'account_id', - :'bank_transfer_type', - :'count', - :'offset', - :'origination_account_id', - :'direction' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferEventListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferEventListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'bank_transfer_id') - self.bank_transfer_id = attributes[:'bank_transfer_id'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'bank_transfer_type') - self.bank_transfer_type = attributes[:'bank_transfer_type'] - end - - if attributes.key?(:'event_types') - if (value = attributes[:'event_types']).is_a?(Array) - self.event_types = value - end - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 25 - end - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - else - self.offset = 0 - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'direction') - self.direction = attributes[:'direction'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@count.nil? && @count > 25 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 25.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - if !@offset.nil? && @offset < 0 - invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@count.nil? && @count > 25 - return false if !@count.nil? && @count < 1 - return false if !@offset.nil? && @offset < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 25 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 25.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Custom attribute writer method with validation - # @param [Object] offset Value to be assigned - def offset=(offset) - if !offset.nil? && offset < 0 - fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.' - end - - - @offset = offset - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - start_date == o.start_date && - end_date == o.end_date && - bank_transfer_id == o.bank_transfer_id && - account_id == o.account_id && - bank_transfer_type == o.bank_transfer_type && - event_types == o.event_types && - count == o.count && - offset == o.offset && - origination_account_id == o.origination_account_id && - direction == o.direction - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, start_date, end_date, bank_transfer_id, account_id, bank_transfer_type, event_types, count, offset, origination_account_id, direction].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_event_list_response.rb b/lib/plaid/models/bank_transfer_event_list_response.rb deleted file mode 100644 index 820aada75..000000000 --- a/lib/plaid/models/bank_transfer_event_list_response.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/bank_transfer/event/list` - class BankTransferEventListResponse - attr_accessor :bank_transfer_events - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_transfer_events' => :'bank_transfer_events', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_transfer_events' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferEventListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferEventListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_transfer_events') - if (value = attributes[:'bank_transfer_events']).is_a?(Array) - self.bank_transfer_events = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @bank_transfer_events.nil? - invalid_properties.push('invalid value for "bank_transfer_events", bank_transfer_events cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @bank_transfer_events.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_transfer_events == o.bank_transfer_events && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_transfer_events, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_event_sync_request.rb b/lib/plaid/models/bank_transfer_event_sync_request.rb deleted file mode 100644 index 94655a2c5..000000000 --- a/lib/plaid/models/bank_transfer_event_sync_request.rb +++ /dev/null @@ -1,306 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/bank_transfer/event/sync` - class BankTransferEventSyncRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The latest (largest) `event_id` fetched via the sync endpoint, or 0 initially. - attr_accessor :after_id - - # The maximum number of bank transfer events to return. - attr_accessor :count - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'after_id' => :'after_id', - :'count' => :'count' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'after_id' => :'Integer', - :'count' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'count' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferEventSyncRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferEventSyncRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'after_id') - self.after_id = attributes[:'after_id'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 25 - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @after_id.nil? - invalid_properties.push('invalid value for "after_id", after_id cannot be nil.') - end - - if @after_id < 0 - invalid_properties.push('invalid value for "after_id", must be greater than or equal to 0.') - end - - - if !@count.nil? && @count > 25 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 25.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @after_id.nil? - return false if @after_id < 0 - return false if !@count.nil? && @count > 25 - return false if !@count.nil? && @count < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] after_id Value to be assigned - def after_id=(after_id) - if after_id.nil? - fail ArgumentError, 'after_id cannot be nil' - end - - if after_id < 0 - fail ArgumentError, 'invalid value for "after_id", must be greater than or equal to 0.' - end - - - @after_id = after_id - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 25 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 25.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - after_id == o.after_id && - count == o.count - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, after_id, count].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_event_sync_response.rb b/lib/plaid/models/bank_transfer_event_sync_response.rb deleted file mode 100644 index 350ad50c3..000000000 --- a/lib/plaid/models/bank_transfer_event_sync_response.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/bank_transfer/event/sync` - class BankTransferEventSyncResponse - attr_accessor :bank_transfer_events - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_transfer_events' => :'bank_transfer_events', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_transfer_events' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferEventSyncResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferEventSyncResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_transfer_events') - if (value = attributes[:'bank_transfer_events']).is_a?(Array) - self.bank_transfer_events = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @bank_transfer_events.nil? - invalid_properties.push('invalid value for "bank_transfer_events", bank_transfer_events cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @bank_transfer_events.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_transfer_events == o.bank_transfer_events && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_transfer_events, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_event_type.rb b/lib/plaid/models/bank_transfer_event_type.rb deleted file mode 100644 index d844b7db0..000000000 --- a/lib/plaid/models/bank_transfer_event_type.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class BankTransferEventType - PENDING = "pending".freeze - CANCELLED = "cancelled".freeze - FAILED = "failed".freeze - POSTED = "posted".freeze - REVERSED = "reversed".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/bank_transfer_failure.rb b/lib/plaid/models/bank_transfer_failure.rb deleted file mode 100644 index 2910a0433..000000000 --- a/lib/plaid/models/bank_transfer_failure.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The failure reason if the type of this transfer is `\"failed\"` or `\"reversed\"`. Null value otherwise. - class BankTransferFailure - # The ACH return code, e.g. `R01`. A return code will be provided if and only if the transfer status is `reversed`. For a full listing of ACH return codes, see [Bank Transfers errors](https://plaid.com/docs/errors/bank-transfers/#ach-return-codes). - attr_accessor :ach_return_code - - # A human-readable description of the reason for the failure or reversal. - attr_accessor :description - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ach_return_code' => :'ach_return_code', - :'description' => :'description' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ach_return_code' => :'String', - :'description' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'ach_return_code', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferFailure` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferFailure`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ach_return_code') - self.ach_return_code = attributes[:'ach_return_code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ach_return_code == o.ach_return_code && - description == o.description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ach_return_code, description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_get_request.rb b/lib/plaid/models/bank_transfer_get_request.rb deleted file mode 100644 index a239ea6f2..000000000 --- a/lib/plaid/models/bank_transfer_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/bank_transfer/get` - class BankTransferGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a bank transfer. - attr_accessor :bank_transfer_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'bank_transfer_id' => :'bank_transfer_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'bank_transfer_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'bank_transfer_id') - self.bank_transfer_id = attributes[:'bank_transfer_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @bank_transfer_id.nil? - invalid_properties.push('invalid value for "bank_transfer_id", bank_transfer_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @bank_transfer_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - bank_transfer_id == o.bank_transfer_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, bank_transfer_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_get_response.rb b/lib/plaid/models/bank_transfer_get_response.rb deleted file mode 100644 index be95e3237..000000000 --- a/lib/plaid/models/bank_transfer_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/bank_transfer/get` - class BankTransferGetResponse - attr_accessor :bank_transfer - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_transfer' => :'bank_transfer', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_transfer' => :'BankTransfer', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_transfer') - self.bank_transfer = attributes[:'bank_transfer'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @bank_transfer.nil? - invalid_properties.push('invalid value for "bank_transfer", bank_transfer cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @bank_transfer.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_transfer == o.bank_transfer && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_transfer, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_list_request.rb b/lib/plaid/models/bank_transfer_list_request.rb deleted file mode 100644 index dd4016360..000000000 --- a/lib/plaid/models/bank_transfer_list_request.rb +++ /dev/null @@ -1,363 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/bank_transfer/list` - class BankTransferListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The start datetime of bank transfers to list. This should be in RFC 3339 format (i.e. `2019-12-06T22:35:49Z`) - attr_accessor :start_date - - # The end datetime of bank transfers to list. This should be in RFC 3339 format (i.e. `2019-12-06T22:35:49Z`) - attr_accessor :end_date - - # The maximum number of bank transfers to return. - attr_accessor :count - - # The number of bank transfers to skip before returning results. - attr_accessor :offset - - # Filter bank transfers to only those originated through the specified origination account. - attr_accessor :origination_account_id - - attr_accessor :direction - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'count' => :'count', - :'offset' => :'offset', - :'origination_account_id' => :'origination_account_id', - :'direction' => :'direction' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'start_date' => :'Time', - :'end_date' => :'Time', - :'count' => :'Integer', - :'offset' => :'Integer', - :'origination_account_id' => :'String', - :'direction' => :'BankTransferDirection' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'start_date', - :'end_date', - :'origination_account_id', - :'direction' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 25 - end - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - else - self.offset = 0 - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'direction') - self.direction = attributes[:'direction'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@count.nil? && @count > 25 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 25.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - if !@offset.nil? && @offset < 0 - invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@count.nil? && @count > 25 - return false if !@count.nil? && @count < 1 - return false if !@offset.nil? && @offset < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 25 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 25.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Custom attribute writer method with validation - # @param [Object] offset Value to be assigned - def offset=(offset) - if !offset.nil? && offset < 0 - fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.' - end - - - @offset = offset - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - start_date == o.start_date && - end_date == o.end_date && - count == o.count && - offset == o.offset && - origination_account_id == o.origination_account_id && - direction == o.direction - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, start_date, end_date, count, offset, origination_account_id, direction].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_list_response.rb b/lib/plaid/models/bank_transfer_list_response.rb deleted file mode 100644 index 16e11507e..000000000 --- a/lib/plaid/models/bank_transfer_list_response.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/bank_transfer/list` - class BankTransferListResponse - attr_accessor :bank_transfers - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_transfers' => :'bank_transfers', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_transfers' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_transfers') - if (value = attributes[:'bank_transfers']).is_a?(Array) - self.bank_transfers = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @bank_transfers.nil? - invalid_properties.push('invalid value for "bank_transfers", bank_transfers cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @bank_transfers.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_transfers == o.bank_transfers && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_transfers, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_migrate_account_request.rb b/lib/plaid/models/bank_transfer_migrate_account_request.rb deleted file mode 100644 index 8b0bcdf8b..000000000 --- a/lib/plaid/models/bank_transfer_migrate_account_request.rb +++ /dev/null @@ -1,286 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/bank_transfer/migrate_account` - class BankTransferMigrateAccountRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user's account number. - attr_accessor :account_number - - # The user's routing number. - attr_accessor :routing_number - - # The user's wire transfer routing number. This is the ABA number; for some institutions, this may differ from the ACH number used in `routing_number`. - attr_accessor :wire_routing_number - - # The type of the bank account (`checking` or `savings`). - attr_accessor :account_type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'account_number' => :'account_number', - :'routing_number' => :'routing_number', - :'wire_routing_number' => :'wire_routing_number', - :'account_type' => :'account_type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'account_number' => :'String', - :'routing_number' => :'String', - :'wire_routing_number' => :'String', - :'account_type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferMigrateAccountRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferMigrateAccountRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'account_number') - self.account_number = attributes[:'account_number'] - end - - if attributes.key?(:'routing_number') - self.routing_number = attributes[:'routing_number'] - end - - if attributes.key?(:'wire_routing_number') - self.wire_routing_number = attributes[:'wire_routing_number'] - end - - if attributes.key?(:'account_type') - self.account_type = attributes[:'account_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_number.nil? - invalid_properties.push('invalid value for "account_number", account_number cannot be nil.') - end - - if @routing_number.nil? - invalid_properties.push('invalid value for "routing_number", routing_number cannot be nil.') - end - - if @account_type.nil? - invalid_properties.push('invalid value for "account_type", account_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_number.nil? - return false if @routing_number.nil? - return false if @account_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - account_number == o.account_number && - routing_number == o.routing_number && - wire_routing_number == o.wire_routing_number && - account_type == o.account_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, account_number, routing_number, wire_routing_number, account_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_migrate_account_response.rb b/lib/plaid/models/bank_transfer_migrate_account_response.rb deleted file mode 100644 index bf65bb0ef..000000000 --- a/lib/plaid/models/bank_transfer_migrate_account_response.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/bank_transfer/migrate_account` - class BankTransferMigrateAccountResponse - # The Plaid `access_token` for the newly created Item. - attr_accessor :access_token - - # The Plaid `account_id` for the newly created Item. - attr_accessor :account_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'access_token' => :'access_token', - :'account_id' => :'account_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'access_token' => :'String', - :'account_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferMigrateAccountResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferMigrateAccountResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @account_id.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - access_token == o.access_token && - account_id == o.account_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [access_token, account_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_network.rb b/lib/plaid/models/bank_transfer_network.rb deleted file mode 100644 index 104489a30..000000000 --- a/lib/plaid/models/bank_transfer_network.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class BankTransferNetwork - ACH = "ach".freeze - SAME_DAY_ACH = "same-day-ach".freeze - WIRE = "wire".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/bank_transfer_status.rb b/lib/plaid/models/bank_transfer_status.rb deleted file mode 100644 index 957c851a1..000000000 --- a/lib/plaid/models/bank_transfer_status.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class BankTransferStatus - PENDING = "pending".freeze - POSTED = "posted".freeze - CANCELLED = "cancelled".freeze - FAILED = "failed".freeze - REVERSED = "reversed".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/bank_transfer_sweep.rb b/lib/plaid/models/bank_transfer_sweep.rb deleted file mode 100644 index 84e047bdc..000000000 --- a/lib/plaid/models/bank_transfer_sweep.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # BankTransferSweep describes a sweep transfer. - class BankTransferSweep - # Identifier of the sweep. - attr_accessor :id - - # The datetime when the sweep occurred, in RFC 3339 format. - attr_accessor :created_at - - # The amount of the sweep. - attr_accessor :amount - - # The currency of the sweep, e.g. \"USD\". - attr_accessor :iso_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'created_at' => :'created_at', - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'created_at' => :'Time', - :'amount' => :'String', - :'iso_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferSweep` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferSweep`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @created_at.nil? - return false if @amount.nil? - return false if @iso_currency_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - created_at == o.created_at && - amount == o.amount && - iso_currency_code == o.iso_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, created_at, amount, iso_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_sweep_get_request.rb b/lib/plaid/models/bank_transfer_sweep_get_request.rb deleted file mode 100644 index f56c17c87..000000000 --- a/lib/plaid/models/bank_transfer_sweep_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/bank_transfer/sweep/get` - class BankTransferSweepGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Identifier of the sweep. - attr_accessor :sweep_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'sweep_id' => :'sweep_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'sweep_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferSweepGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferSweepGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'sweep_id') - self.sweep_id = attributes[:'sweep_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @sweep_id.nil? - invalid_properties.push('invalid value for "sweep_id", sweep_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @sweep_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - sweep_id == o.sweep_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, sweep_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_sweep_get_response.rb b/lib/plaid/models/bank_transfer_sweep_get_response.rb deleted file mode 100644 index 43e7bf3a8..000000000 --- a/lib/plaid/models/bank_transfer_sweep_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # BankTransferSweepGetResponse defines the response schema for `/bank_transfer/sweep/get` - class BankTransferSweepGetResponse - attr_accessor :sweep - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sweep' => :'sweep', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sweep' => :'BankTransferSweep', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferSweepGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferSweepGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sweep') - self.sweep = attributes[:'sweep'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @sweep.nil? - invalid_properties.push('invalid value for "sweep", sweep cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @sweep.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sweep == o.sweep && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sweep, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_sweep_list_request.rb b/lib/plaid/models/bank_transfer_sweep_list_request.rb deleted file mode 100644 index f85ee85c0..000000000 --- a/lib/plaid/models/bank_transfer_sweep_list_request.rb +++ /dev/null @@ -1,303 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # BankTransferSweepListRequest defines the request schema for `/bank_transfer/sweep/list` - class BankTransferSweepListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # If multiple origination accounts are available, `origination_account_id` must be used to specify the account that the sweeps belong to. - attr_accessor :origination_account_id - - # The start datetime of sweeps to return (RFC 3339 format). - attr_accessor :start_time - - # The end datetime of sweeps to return (RFC 3339 format). - attr_accessor :end_time - - # The maximum number of sweeps to return. - attr_accessor :count - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'origination_account_id' => :'origination_account_id', - :'start_time' => :'start_time', - :'end_time' => :'end_time', - :'count' => :'count' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'origination_account_id' => :'String', - :'start_time' => :'Time', - :'end_time' => :'Time', - :'count' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'origination_account_id', - :'start_time', - :'end_time', - :'count' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferSweepListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferSweepListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'start_time') - self.start_time = attributes[:'start_time'] - end - - if attributes.key?(:'end_time') - self.end_time = attributes[:'end_time'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 25 - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@count.nil? && @count > 25 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 25.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@count.nil? && @count > 25 - return false if !@count.nil? && @count < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 25 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 25.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - origination_account_id == o.origination_account_id && - start_time == o.start_time && - end_time == o.end_time && - count == o.count - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, origination_account_id, start_time, end_time, count].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_sweep_list_response.rb b/lib/plaid/models/bank_transfer_sweep_list_response.rb deleted file mode 100644 index e4812a53d..000000000 --- a/lib/plaid/models/bank_transfer_sweep_list_response.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # BankTransferSweepListResponse defines the response schema for `/bank_transfer/sweep/list` - class BankTransferSweepListResponse - attr_accessor :sweeps - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sweeps' => :'sweeps', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sweeps' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferSweepListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferSweepListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sweeps') - if (value = attributes[:'sweeps']).is_a?(Array) - self.sweeps = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @sweeps.nil? - invalid_properties.push('invalid value for "sweeps", sweeps cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @sweeps.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sweeps == o.sweeps && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sweeps, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfer_type.rb b/lib/plaid/models/bank_transfer_type.rb deleted file mode 100644 index 9616bb734..000000000 --- a/lib/plaid/models/bank_transfer_type.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class BankTransferType - DEBIT = "debit".freeze - CREDIT = "credit".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/bank_transfer_user.rb b/lib/plaid/models/bank_transfer_user.rb deleted file mode 100644 index 7712adaa5..000000000 --- a/lib/plaid/models/bank_transfer_user.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The legal name and other information for the account holder. - class BankTransferUser - # The account holder’s full legal name. If the transfer `ach_class` is `ccd`, this should be the business name of the account holder. - attr_accessor :legal_name - - # The account holder’s email. - attr_accessor :email_address - - # The account holder's routing number. This field is only used in response data. Do not provide this field when making requests. - attr_accessor :routing_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'legal_name' => :'legal_name', - :'email_address' => :'email_address', - :'routing_number' => :'routing_number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'legal_name' => :'String', - :'email_address' => :'String', - :'routing_number' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'email_address', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransferUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransferUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'routing_number') - self.routing_number = attributes[:'routing_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @legal_name.nil? - invalid_properties.push('invalid value for "legal_name", legal_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @legal_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - legal_name == o.legal_name && - email_address == o.email_address && - routing_number == o.routing_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [legal_name, email_address, routing_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfers_events_update_webhook.rb b/lib/plaid/models/bank_transfers_events_update_webhook.rb deleted file mode 100644 index e475247a6..000000000 --- a/lib/plaid/models/bank_transfers_events_update_webhook.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when new bank transfer events are available. Receiving this webhook indicates you should fetch the new events from `/bank_transfer/event/sync`. - class BankTransfersEventsUpdateWebhook - # `BANK_TRANSFERS` - attr_accessor :webhook_type - - # `BANK_TRANSFERS_EVENTS_UPDATE` - attr_accessor :webhook_code - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransfersEventsUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransfersEventsUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/bank_transfers_events_update_webhook_for_auth.rb b/lib/plaid/models/bank_transfers_events_update_webhook_for_auth.rb deleted file mode 100644 index a7cf292d9..000000000 --- a/lib/plaid/models/bank_transfers_events_update_webhook_for_auth.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when new ACH events are available. To begin receiving this webhook, you must first register your webhook listener endpoint via the [webhooks page in the Dashboard](https://dashboard.plaid.com/team/webhooks). The `BANK_TRANSFERS_EVENTS_UPDATE` webhook can be used to track the progress of ACH transfers used in [micro-deposit verification](/docs/auth/coverage/microdeposit-events/). Receiving this webhook indicates you should fetch the new events from `/bank_transfer/event/sync`. Note that [Transfer](https://plaid.com/docs/transfer) customers should use Transfer webhooks instead of using `BANK_TRANSFERS_EVENTS_UPDATE`; see [micro-deposit events documentation](https://plaid.com/docs/auth/coverage/microdeposit-events/) for more details. - class BankTransfersEventsUpdateWebhookForAuth - # `BANK_TRANSFERS` - attr_accessor :webhook_type - - # `BANK_TRANSFERS_EVENTS_UPDATE` - attr_accessor :webhook_code - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BankTransfersEventsUpdateWebhookForAuth` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BankTransfersEventsUpdateWebhookForAuth`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_report.rb b/lib/plaid/models/base_report.rb deleted file mode 100644 index a0896e000..000000000 --- a/lib/plaid/models/base_report.rb +++ /dev/null @@ -1,273 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing a Base Report - class BaseReport - # A unique ID identifying an Base Report. Like all Plaid identifiers, this ID is case sensitive. - attr_accessor :report_id - - # 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\"). - attr_accessor :date_generated - - # The number of days of transaction history requested. - attr_accessor :days_requested - - # Data returned by Plaid about each of the Items included in the Base Report. - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report_id' => :'report_id', - :'date_generated' => :'date_generated', - :'days_requested' => :'days_requested', - :'items' => :'items' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'report_id' => :'String', - :'date_generated' => :'Time', - :'days_requested' => :'Float', - :'items' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReport` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report_id') - self.report_id = attributes[:'report_id'] - end - - if attributes.key?(:'date_generated') - self.date_generated = attributes[:'date_generated'] - end - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @report_id.nil? - invalid_properties.push('invalid value for "report_id", report_id cannot be nil.') - end - - if @date_generated.nil? - invalid_properties.push('invalid value for "date_generated", date_generated cannot be nil.') - end - - if @days_requested.nil? - invalid_properties.push('invalid value for "days_requested", days_requested cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @report_id.nil? - return false if @date_generated.nil? - return false if @days_requested.nil? - return false if @items.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report_id == o.report_id && - date_generated == o.date_generated && - days_requested == o.days_requested && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report_id, date_generated, days_requested, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_report_account.rb b/lib/plaid/models/base_report_account.rb deleted file mode 100644 index 5c447183f..000000000 --- a/lib/plaid/models/base_report_account.rb +++ /dev/null @@ -1,393 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Base Report information about an account - class BaseReportAccount - attr_accessor :balances - - # 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. - attr_accessor :mask - - # The name of the account, either assigned by the user or by the financial institution itself - attr_accessor :name - - # The official name of the account as given by the financial institution - attr_accessor :official_name - - attr_accessor :type - - attr_accessor :subtype - - # 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. - attr_accessor :days_available - - # Transaction history associated with the account. Only returned by Base Report endpoints. Transaction history returned by endpoints such as `/transactions/get` or `/investments/transactions/get` will be returned in the top-level `transactions` field instead. - attr_accessor :transactions - - # 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. - attr_accessor :owners - - attr_accessor :ownership_type - - # Calculated data about the historical balances on the account. Only returned by Base Report endpoints and currently not supported by `brokerage` or `investment` accounts. - attr_accessor :historical_balances - - attr_accessor :account_insights - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'balances' => :'balances', - :'mask' => :'mask', - :'name' => :'name', - :'official_name' => :'official_name', - :'type' => :'type', - :'subtype' => :'subtype', - :'days_available' => :'days_available', - :'transactions' => :'transactions', - :'owners' => :'owners', - :'ownership_type' => :'ownership_type', - :'historical_balances' => :'historical_balances', - :'account_insights' => :'account_insights' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'balances' => :'BaseReportAccountBalances', - :'mask' => :'String', - :'name' => :'String', - :'official_name' => :'String', - :'type' => :'AccountType', - :'subtype' => :'AccountSubtype', - :'days_available' => :'Float', - :'transactions' => :'Array', - :'owners' => :'Array', - :'ownership_type' => :'OwnershipType', - :'historical_balances' => :'Array', - :'account_insights' => :'BaseReportAccountInsights' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'mask', - :'official_name', - :'subtype', - :'ownership_type', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReportAccount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReportAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'balances') - self.balances = attributes[:'balances'] - end - - if attributes.key?(:'mask') - self.mask = attributes[:'mask'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'official_name') - self.official_name = attributes[:'official_name'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'subtype') - self.subtype = attributes[:'subtype'] - end - - if attributes.key?(:'days_available') - self.days_available = attributes[:'days_available'] - end - - if attributes.key?(:'transactions') - if (value = attributes[:'transactions']).is_a?(Array) - self.transactions = value - end - end - - if attributes.key?(:'owners') - if (value = attributes[:'owners']).is_a?(Array) - self.owners = value - end - end - - if attributes.key?(:'ownership_type') - self.ownership_type = attributes[:'ownership_type'] - end - - if attributes.key?(:'historical_balances') - if (value = attributes[:'historical_balances']).is_a?(Array) - self.historical_balances = value - end - end - - if attributes.key?(:'account_insights') - self.account_insights = attributes[:'account_insights'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @balances.nil? - invalid_properties.push('invalid value for "balances", balances cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @days_available.nil? - invalid_properties.push('invalid value for "days_available", days_available cannot be nil.') - end - - if @transactions.nil? - invalid_properties.push('invalid value for "transactions", transactions cannot be nil.') - end - - if @owners.nil? - invalid_properties.push('invalid value for "owners", owners cannot be nil.') - end - - if @historical_balances.nil? - invalid_properties.push('invalid value for "historical_balances", historical_balances cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @balances.nil? - return false if @name.nil? - return false if @type.nil? - return false if @days_available.nil? - return false if @transactions.nil? - return false if @owners.nil? - return false if @historical_balances.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - balances == o.balances && - mask == o.mask && - name == o.name && - official_name == o.official_name && - type == o.type && - subtype == o.subtype && - days_available == o.days_available && - transactions == o.transactions && - owners == o.owners && - ownership_type == o.ownership_type && - historical_balances == o.historical_balances && - account_insights == o.account_insights - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [balances, mask, name, official_name, type, subtype, days_available, transactions, owners, ownership_type, historical_balances, account_insights].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_report_account_balances.rb b/lib/plaid/models/base_report_account_balances.rb deleted file mode 100644 index 1a6796a93..000000000 --- a/lib/plaid/models/base_report_account_balances.rb +++ /dev/null @@ -1,319 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Base Report information about an account's balances - class 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`. - attr_accessor :available - - # 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`. - attr_accessor :current - - # 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. - attr_accessor :limit - - # The ISO-4217 currency code of the balance. Always null if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - # 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. 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. - attr_accessor :last_updated_datetime - - # The average historical balance for the entire report - attr_accessor :average_balance - - # The average historical balance of each calendar month - attr_accessor :average_monthly_balances - - # The average historical balance from the most recent 30 days - attr_accessor :most_recent_thirty_day_average_balance - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'available' => :'available', - :'current' => :'current', - :'limit' => :'limit', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'last_updated_datetime' => :'last_updated_datetime', - :'average_balance' => :'average_balance', - :'average_monthly_balances' => :'average_monthly_balances', - :'most_recent_thirty_day_average_balance' => :'most_recent_thirty_day_average_balance' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'available' => :'Float', - :'current' => :'Float', - :'limit' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'last_updated_datetime' => :'Time', - :'average_balance' => :'Float', - :'average_monthly_balances' => :'Array', - :'most_recent_thirty_day_average_balance' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'available', - :'current', - :'limit', - :'iso_currency_code', - :'unofficial_currency_code', - :'last_updated_datetime', - :'average_balance', - :'most_recent_thirty_day_average_balance' - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'AccountBalance', - :'BaseReportAccountBalancesAllOf' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReportAccountBalances` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReportAccountBalances`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'available') - self.available = attributes[:'available'] - end - - if attributes.key?(:'current') - self.current = attributes[:'current'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'last_updated_datetime') - self.last_updated_datetime = attributes[:'last_updated_datetime'] - end - - if attributes.key?(:'average_balance') - self.average_balance = attributes[:'average_balance'] - end - - if attributes.key?(:'average_monthly_balances') - if (value = attributes[:'average_monthly_balances']).is_a?(Array) - self.average_monthly_balances = value - end - end - - if attributes.key?(:'most_recent_thirty_day_average_balance') - self.most_recent_thirty_day_average_balance = attributes[:'most_recent_thirty_day_average_balance'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - available == o.available && - current == o.current && - limit == o.limit && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - last_updated_datetime == o.last_updated_datetime && - average_balance == o.average_balance && - average_monthly_balances == o.average_monthly_balances && - most_recent_thirty_day_average_balance == o.most_recent_thirty_day_average_balance - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [available, current, limit, iso_currency_code, unofficial_currency_code, last_updated_datetime, average_balance, average_monthly_balances, most_recent_thirty_day_average_balance].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_report_account_balances_all_of.rb b/lib/plaid/models/base_report_account_balances_all_of.rb deleted file mode 100644 index ac16e5df4..000000000 --- a/lib/plaid/models/base_report_account_balances_all_of.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class BaseReportAccountBalancesAllOf - # The average historical balance for the entire report - attr_accessor :average_balance - - # The average historical balance of each calendar month - attr_accessor :average_monthly_balances - - # The average historical balance from the most recent 30 days - attr_accessor :most_recent_thirty_day_average_balance - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'average_balance' => :'average_balance', - :'average_monthly_balances' => :'average_monthly_balances', - :'most_recent_thirty_day_average_balance' => :'most_recent_thirty_day_average_balance' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'average_balance' => :'Float', - :'average_monthly_balances' => :'Array', - :'most_recent_thirty_day_average_balance' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'average_balance', - :'most_recent_thirty_day_average_balance' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReportAccountBalancesAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReportAccountBalancesAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'average_balance') - self.average_balance = attributes[:'average_balance'] - end - - if attributes.key?(:'average_monthly_balances') - if (value = attributes[:'average_monthly_balances']).is_a?(Array) - self.average_monthly_balances = value - end - end - - if attributes.key?(:'most_recent_thirty_day_average_balance') - self.most_recent_thirty_day_average_balance = attributes[:'most_recent_thirty_day_average_balance'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - average_balance == o.average_balance && - average_monthly_balances == o.average_monthly_balances && - most_recent_thirty_day_average_balance == o.most_recent_thirty_day_average_balance - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [average_balance, average_monthly_balances, most_recent_thirty_day_average_balance].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_report_account_insights.rb b/lib/plaid/models/base_report_account_insights.rb deleted file mode 100644 index 480c64c1d..000000000 --- a/lib/plaid/models/base_report_account_insights.rb +++ /dev/null @@ -1,325 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Calculated insights derived from transaction-level data. - class BaseReportAccountInsights - # Date of the earliest transaction in the base report for the account. - attr_accessor :oldest_transaction_date - - # Date of the most recent transaction in the base report for the account. - attr_accessor :most_recent_transaction_date - - # Number of days days available in the base report for the account. - attr_accessor :days_available - - # Average number of days between sequential transactions - attr_accessor :average_days_between_transactions - - # Longest gap between sequential transactions - attr_accessor :longest_gap_between_transactions - - # The number of debits into the account. This field will be null for non-depository accounts. - attr_accessor :number_of_inflows - - # 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. - attr_accessor :average_inflow_amount - - # The number of credit into the account. This field will be null for non-depository accounts. - attr_accessor :number_of_outflows - - # 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. - attr_accessor :average_outflow_amount - - # Number of days with no transactions - attr_accessor :number_of_days_no_transactions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'oldest_transaction_date' => :'oldest_transaction_date', - :'most_recent_transaction_date' => :'most_recent_transaction_date', - :'days_available' => :'days_available', - :'average_days_between_transactions' => :'average_days_between_transactions', - :'longest_gap_between_transactions' => :'longest_gap_between_transactions', - :'number_of_inflows' => :'number_of_inflows', - :'average_inflow_amount' => :'average_inflow_amount', - :'number_of_outflows' => :'number_of_outflows', - :'average_outflow_amount' => :'average_outflow_amount', - :'number_of_days_no_transactions' => :'number_of_days_no_transactions' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'oldest_transaction_date' => :'Date', - :'most_recent_transaction_date' => :'Date', - :'days_available' => :'Integer', - :'average_days_between_transactions' => :'Float', - :'longest_gap_between_transactions' => :'Array', - :'number_of_inflows' => :'Array', - :'average_inflow_amount' => :'Array', - :'number_of_outflows' => :'Array', - :'average_outflow_amount' => :'Array', - :'number_of_days_no_transactions' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'number_of_inflows', - :'average_inflow_amount', - :'number_of_outflows', - :'average_outflow_amount', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReportAccountInsights` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReportAccountInsights`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'oldest_transaction_date') - self.oldest_transaction_date = attributes[:'oldest_transaction_date'] - end - - if attributes.key?(:'most_recent_transaction_date') - self.most_recent_transaction_date = attributes[:'most_recent_transaction_date'] - end - - if attributes.key?(:'days_available') - self.days_available = attributes[:'days_available'] - end - - if attributes.key?(:'average_days_between_transactions') - self.average_days_between_transactions = attributes[:'average_days_between_transactions'] - end - - if attributes.key?(:'longest_gap_between_transactions') - if (value = attributes[:'longest_gap_between_transactions']).is_a?(Array) - self.longest_gap_between_transactions = value - end - end - - if attributes.key?(:'number_of_inflows') - if (value = attributes[:'number_of_inflows']).is_a?(Array) - self.number_of_inflows = value - end - end - - if attributes.key?(:'average_inflow_amount') - if (value = attributes[:'average_inflow_amount']).is_a?(Array) - self.average_inflow_amount = value - end - end - - if attributes.key?(:'number_of_outflows') - if (value = attributes[:'number_of_outflows']).is_a?(Array) - self.number_of_outflows = value - end - end - - if attributes.key?(:'average_outflow_amount') - if (value = attributes[:'average_outflow_amount']).is_a?(Array) - self.average_outflow_amount = value - end - end - - if attributes.key?(:'number_of_days_no_transactions') - self.number_of_days_no_transactions = attributes[:'number_of_days_no_transactions'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - oldest_transaction_date == o.oldest_transaction_date && - most_recent_transaction_date == o.most_recent_transaction_date && - days_available == o.days_available && - average_days_between_transactions == o.average_days_between_transactions && - longest_gap_between_transactions == o.longest_gap_between_transactions && - number_of_inflows == o.number_of_inflows && - average_inflow_amount == o.average_inflow_amount && - number_of_outflows == o.number_of_outflows && - average_outflow_amount == o.average_outflow_amount && - number_of_days_no_transactions == o.number_of_days_no_transactions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [oldest_transaction_date, most_recent_transaction_date, days_available, average_days_between_transactions, longest_gap_between_transactions, number_of_inflows, average_inflow_amount, number_of_outflows, average_outflow_amount, number_of_days_no_transactions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_report_average_flow_insights.rb b/lib/plaid/models/base_report_average_flow_insights.rb deleted file mode 100644 index d2f4c4b7a..000000000 --- a/lib/plaid/models/base_report_average_flow_insights.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Average dollar amount of credit or debit transactions out of the account. This field will only added for depository accounts - class BaseReportAverageFlowInsights - # The start date of this time period. The date will be returned in an ISO 8601 format (YYYY-MM-DD). - attr_accessor :start_date - - # The end date of this time period. The date will be returned in an ISO 8601 format (YYYY-MM-DD). - attr_accessor :end_date - - attr_accessor :total_amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'total_amount' => :'total_amount' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_date' => :'Date', - :'end_date' => :'Date', - :'total_amount' => :'CreditAmountWithCurrency' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReportAverageFlowInsights` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReportAverageFlowInsights`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'total_amount') - self.total_amount = attributes[:'total_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_date == o.start_date && - end_date == o.end_date && - total_amount == o.total_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_date, end_date, total_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_report_average_monthly_balances.rb b/lib/plaid/models/base_report_average_monthly_balances.rb deleted file mode 100644 index 573abd7bf..000000000 --- a/lib/plaid/models/base_report_average_monthly_balances.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Average balance in dollar amount per month - class BaseReportAverageMonthlyBalances - # The start date of this time period. The date will be returned in an ISO 8601 format (YYYY-MM-DD). - attr_accessor :start_date - - # The end date of this time period. The date will be returned in an ISO 8601 format (YYYY-MM-DD). - attr_accessor :end_date - - attr_accessor :average_balance - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'average_balance' => :'average_balance' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_date' => :'String', - :'end_date' => :'String', - :'average_balance' => :'CreditAmountWithCurrency' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReportAverageMonthlyBalances` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReportAverageMonthlyBalances`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'average_balance') - self.average_balance = attributes[:'average_balance'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_date == o.start_date && - end_date == o.end_date && - average_balance == o.average_balance - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_date, end_date, average_balance].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_report_get_request.rb b/lib/plaid/models/base_report_get_request.rb deleted file mode 100644 index d0499bdde..000000000 --- a/lib/plaid/models/base_report_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # BaseReportGetRequest defines the request schema for `/cra/base_report/get` - class BaseReportGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReportGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReportGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_token.nil? - invalid_properties.push('invalid value for "user_token", user_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_report_get_response.rb b/lib/plaid/models/base_report_get_response.rb deleted file mode 100644 index 31d97fca4..000000000 --- a/lib/plaid/models/base_report_get_response.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # BaseReportGetResponse defines the response schema for `/cra/base_report/get` - class BaseReportGetResponse - attr_accessor :report - - # 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 - attr_accessor :warnings - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report' => :'report', - :'warnings' => :'warnings', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'report' => :'BaseReport', - :'warnings' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReportGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReportGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report') - self.report = attributes[:'report'] - end - - if attributes.key?(:'warnings') - if (value = attributes[:'warnings']).is_a?(Array) - self.warnings = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @report.nil? - invalid_properties.push('invalid value for "report", report cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @report.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report == o.report && - warnings == o.warnings && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report, warnings, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_report_item.rb b/lib/plaid/models/base_report_item.rb deleted file mode 100644 index 1767be2ef..000000000 --- a/lib/plaid/models/base_report_item.rb +++ /dev/null @@ -1,273 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A representation of an Item within a Base Report. - class BaseReportItem - # The full financial institution name associated with the Item. - attr_accessor :institution_name - - # The id of the financial institution associated with the Item. - attr_accessor :institution_id - - # The date and time when this Item’s data was last retrieved from the financial institution, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :date_last_updated - - # Data about each of the accounts open on the Item. - attr_accessor :accounts - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'institution_name' => :'institution_name', - :'institution_id' => :'institution_id', - :'date_last_updated' => :'date_last_updated', - :'accounts' => :'accounts' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'institution_name' => :'String', - :'institution_id' => :'String', - :'date_last_updated' => :'Time', - :'accounts' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReportItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReportItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'institution_name') - self.institution_name = attributes[:'institution_name'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'date_last_updated') - self.date_last_updated = attributes[:'date_last_updated'] - end - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @institution_name.nil? - invalid_properties.push('invalid value for "institution_name", institution_name cannot be nil.') - end - - if @institution_id.nil? - invalid_properties.push('invalid value for "institution_id", institution_id cannot be nil.') - end - - if @date_last_updated.nil? - invalid_properties.push('invalid value for "date_last_updated", date_last_updated cannot be nil.') - end - - if @accounts.nil? - invalid_properties.push('invalid value for "accounts", accounts cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @institution_name.nil? - return false if @institution_id.nil? - return false if @date_last_updated.nil? - return false if @accounts.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - institution_name == o.institution_name && - institution_id == o.institution_id && - date_last_updated == o.date_last_updated && - accounts == o.accounts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [institution_name, institution_id, date_last_updated, accounts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_report_longest_gap_insights.rb b/lib/plaid/models/base_report_longest_gap_insights.rb deleted file mode 100644 index dcf0e4eaf..000000000 --- a/lib/plaid/models/base_report_longest_gap_insights.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Largest number of days between sequential transactions per calendar month - class BaseReportLongestGapInsights - # The start date of this time period. The date will be returned in an ISO 8601 format (YYYY-MM-DD). - attr_accessor :start_date - - # The end date of this time period. The date will be returned in an ISO 8601 format (YYYY-MM-DD). - attr_accessor :end_date - - # Largest number of days between sequential transactions for this time period. - attr_accessor :days - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'days' => :'days' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_date' => :'Date', - :'end_date' => :'Date', - :'days' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReportLongestGapInsights` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReportLongestGapInsights`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'days') - self.days = attributes[:'days'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_date == o.start_date && - end_date == o.end_date && - days == o.days - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_date, end_date, days].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_report_number_flow_insights.rb b/lib/plaid/models/base_report_number_flow_insights.rb deleted file mode 100644 index 432374ac0..000000000 --- a/lib/plaid/models/base_report_number_flow_insights.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The number of credits or debits out of the account. This field will only added for depository accounts - class BaseReportNumberFlowInsights - # The start date of this time period. The date will be returned in an ISO 8601 format (YYYY-MM-DD). - attr_accessor :start_date - - # The end date of this time period. The date will be returned in an ISO 8601 format (YYYY-MM-DD). - attr_accessor :end_date - - # The number of credits or debits out of the account for this time period. - attr_accessor :count - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'count' => :'count' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_date' => :'Date', - :'end_date' => :'Date', - :'count' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReportNumberFlowInsights` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReportNumberFlowInsights`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_date == o.start_date && - end_date == o.end_date && - count == o.count - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_date, end_date, count].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_report_transaction.rb b/lib/plaid/models/base_report_transaction.rb deleted file mode 100644 index d74b3bc34..000000000 --- a/lib/plaid/models/base_report_transaction.rb +++ /dev/null @@ -1,352 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A transaction on the Base Report - class BaseReportTransaction - # 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. - attr_accessor :amount - - # The ISO-4217 currency code of the transaction. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - # The string returned by the financial institution to describe the transaction. - attr_accessor :original_description - - attr_accessor :credit_category - - # The check number of the transaction. This field is only populated for check transactions. - attr_accessor :check_number - - # 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](https://wikipedia.org/wiki/ISO_8601) format ( `YYYY-MM-DD` ). - attr_accessor :date - - # The date on which the transaction took place, in IS0 8601 format. - attr_accessor :date_transacted - - attr_accessor :location - - # The merchant name, as enriched by Plaid from the `name` field. This is typically a more human-readable version of the merchant counterparty in the transaction. For some bank transactions (such as checks or account transfers) where there is no meaningful merchant name, this value will be `null`. - attr_accessor :merchant_name - - # When `true`, identifies the transaction as pending or unsettled. Pending transaction details (name, type, amount, category ID) may change before they are settled. - attr_accessor :pending - - # The name of the account owner. This field is not typically populated and only relevant when dealing with sub-accounts. - attr_accessor :account_owner - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'original_description' => :'original_description', - :'credit_category' => :'credit_category', - :'check_number' => :'check_number', - :'date' => :'date', - :'date_transacted' => :'date_transacted', - :'location' => :'location', - :'merchant_name' => :'merchant_name', - :'pending' => :'pending', - :'account_owner' => :'account_owner' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'original_description' => :'String', - :'credit_category' => :'CreditCategory', - :'check_number' => :'String', - :'date' => :'Date', - :'date_transacted' => :'String', - :'location' => :'Location', - :'merchant_name' => :'String', - :'pending' => :'Boolean', - :'account_owner' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'iso_currency_code', - :'unofficial_currency_code', - :'original_description', - :'credit_category', - :'check_number', - :'date_transacted', - :'merchant_name', - :'account_owner' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReportTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReportTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'original_description') - self.original_description = attributes[:'original_description'] - end - - if attributes.key?(:'credit_category') - self.credit_category = attributes[:'credit_category'] - end - - if attributes.key?(:'check_number') - self.check_number = attributes[:'check_number'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'date_transacted') - self.date_transacted = attributes[:'date_transacted'] - end - - if attributes.key?(:'location') - self.location = attributes[:'location'] - end - - if attributes.key?(:'merchant_name') - self.merchant_name = attributes[:'merchant_name'] - end - - if attributes.key?(:'pending') - self.pending = attributes[:'pending'] - end - - if attributes.key?(:'account_owner') - self.account_owner = attributes[:'account_owner'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @date.nil? - invalid_properties.push('invalid value for "date", date cannot be nil.') - end - - if @pending.nil? - invalid_properties.push('invalid value for "pending", pending cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amount.nil? - return false if @date.nil? - return false if @pending.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - original_description == o.original_description && - credit_category == o.credit_category && - check_number == o.check_number && - date == o.date && - date_transacted == o.date_transacted && - location == o.location && - merchant_name == o.merchant_name && - pending == o.pending && - account_owner == o.account_owner - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, iso_currency_code, unofficial_currency_code, original_description, credit_category, check_number, date, date_transacted, location, merchant_name, pending, account_owner].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_report_warning.rb b/lib/plaid/models/base_report_warning.rb deleted file mode 100644 index 5e3b45fb6..000000000 --- a/lib/plaid/models/base_report_warning.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class BaseReportWarning - # The warning type, which will always be `BASE_REPORT_WARNING` - attr_accessor :warning_type - - attr_accessor :warning_code - - attr_accessor :cause - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'warning_type' => :'warning_type', - :'warning_code' => :'warning_code', - :'cause' => :'cause' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'warning_type' => :'String', - :'warning_code' => :'BaseReportWarningCode', - :'cause' => :'Cause' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReportWarning` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReportWarning`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'warning_type') - self.warning_type = attributes[:'warning_type'] - end - - if attributes.key?(:'warning_code') - self.warning_code = attributes[:'warning_code'] - end - - if attributes.key?(:'cause') - self.cause = attributes[:'cause'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @warning_type.nil? - invalid_properties.push('invalid value for "warning_type", warning_type cannot be nil.') - end - - if @warning_code.nil? - invalid_properties.push('invalid value for "warning_code", warning_code cannot be nil.') - end - - if @cause.nil? - invalid_properties.push('invalid value for "cause", cause cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @warning_type.nil? - return false if @warning_code.nil? - return false if @cause.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - warning_type == o.warning_type && - warning_code == o.warning_code && - cause == o.cause - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [warning_type, warning_code, cause].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_report_warning_code.rb b/lib/plaid/models/base_report_warning_code.rb deleted file mode 100644 index 1591e4559..000000000 --- a/lib/plaid/models/base_report_warning_code.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class BaseReportWarningCode - OWNERS_UNAVAILABLE = "OWNERS_UNAVAILABLE".freeze - TRANSACTIONS_UNAVAILABLE = "TRANSACTIONS_UNAVAILABLE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/base_reports_error_webhook.rb b/lib/plaid/models/base_reports_error_webhook.rb deleted file mode 100644 index d811d5f6f..000000000 --- a/lib/plaid/models/base_reports_error_webhook.rb +++ /dev/null @@ -1,302 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when Base Report generation has failed. The resulting `error` will have an `error_type` of `BASE_REPORT_ERROR`. - class BaseReportsErrorWebhook - # `BASE_REPORT` - attr_accessor :webhook_type - - # `ERROR` - attr_accessor :webhook_code - - attr_accessor :error - - # The `user_id` corresponding to the User ID the webhook has fired for. - attr_accessor :user_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'error' => :'error', - :'user_id' => :'user_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'error' => :'PlaidError', - :'user_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReportsErrorWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReportsErrorWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @user_id.nil? - invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @user_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - error == o.error && - user_id == o.user_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, error, user_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/base_reports_product_ready_webhook.rb b/lib/plaid/models/base_reports_product_ready_webhook.rb deleted file mode 100644 index 9932e9576..000000000 --- a/lib/plaid/models/base_reports_product_ready_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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`. - class BaseReportsProductReadyWebhook - # `BASE_REPORT` - attr_accessor :webhook_type - - # `PRODUCT_READY` - attr_accessor :webhook_code - - # The `user_id` corresponding to the User ID the webhook has fired for. - attr_accessor :user_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'user_id' => :'user_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'user_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BaseReportsProductReadyWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BaseReportsProductReadyWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @user_id.nil? - invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @user_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - user_id == o.user_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, user_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_audit_trail.rb b/lib/plaid/models/beacon_audit_trail.rb deleted file mode 100644 index ba0e9309f..000000000 --- a/lib/plaid/models/beacon_audit_trail.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the last change made to the parent object specifying what caused the change as well as when it occurred. - class BeaconAuditTrail - attr_accessor :source - - # ID of the associated user. - attr_accessor :dashboard_user_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'source' => :'source', - :'dashboard_user_id' => :'dashboard_user_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'source' => :'BeaconAuditTrailSource', - :'dashboard_user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'dashboard_user_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconAuditTrail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconAuditTrail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'source') - self.source = attributes[:'source'] - end - - if attributes.key?(:'dashboard_user_id') - self.dashboard_user_id = attributes[:'dashboard_user_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @source.nil? - invalid_properties.push('invalid value for "source", source cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @source.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - source == o.source && - dashboard_user_id == o.dashboard_user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [source, dashboard_user_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_audit_trail_source.rb b/lib/plaid/models/beacon_audit_trail_source.rb deleted file mode 100644 index 3ced33818..000000000 --- a/lib/plaid/models/beacon_audit_trail_source.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class BeaconAuditTrailSource - DASHBOARD = "dashboard".freeze - API = "api".freeze - SYSTEM = "system".freeze - BULK_IMPORT = "bulk_import".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/beacon_duplicate_detected_webhook.rb b/lib/plaid/models/beacon_duplicate_detected_webhook.rb deleted file mode 100644 index c34d74e4d..000000000 --- a/lib/plaid/models/beacon_duplicate_detected_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when a Beacon User created within your organization matches one of your existing users. - class BeaconDuplicateDetectedWebhook - # `BEACON` - attr_accessor :webhook_type - - # `DUPLICATE_DETECTED` - attr_accessor :webhook_code - - # The ID of the associated Beacon Duplicate. - attr_accessor :beacon_duplicate_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'beacon_duplicate_id' => :'beacon_duplicate_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'beacon_duplicate_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconDuplicateDetectedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconDuplicateDetectedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'beacon_duplicate_id') - self.beacon_duplicate_id = attributes[:'beacon_duplicate_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @beacon_duplicate_id.nil? - invalid_properties.push('invalid value for "beacon_duplicate_id", beacon_duplicate_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @beacon_duplicate_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - beacon_duplicate_id == o.beacon_duplicate_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, beacon_duplicate_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_duplicate_get_request.rb b/lib/plaid/models/beacon_duplicate_get_request.rb deleted file mode 100644 index 93b7b1390..000000000 --- a/lib/plaid/models/beacon_duplicate_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for getting a Beacon Duplicate - class BeaconDuplicateGetRequest - # ID of the associated Beacon Duplicate. - attr_accessor :beacon_duplicate_id - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'beacon_duplicate_id' => :'beacon_duplicate_id', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'beacon_duplicate_id' => :'String', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconDuplicateGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconDuplicateGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'beacon_duplicate_id') - self.beacon_duplicate_id = attributes[:'beacon_duplicate_id'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @beacon_duplicate_id.nil? - invalid_properties.push('invalid value for "beacon_duplicate_id", beacon_duplicate_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @beacon_duplicate_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - beacon_duplicate_id == o.beacon_duplicate_id && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [beacon_duplicate_id, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_duplicate_get_response.rb b/lib/plaid/models/beacon_duplicate_get_response.rb deleted file mode 100644 index aca01e417..000000000 --- a/lib/plaid/models/beacon_duplicate_get_response.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A Beacon Duplicate represents a pair of matching Beacon Users and an analysis of the fields they matched on. - class BeaconDuplicateGetResponse - # ID of the associated Beacon Duplicate. - attr_accessor :id - - attr_accessor :beacon_user1 - - attr_accessor :beacon_user2 - - attr_accessor :analysis - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'beacon_user1' => :'beacon_user1', - :'beacon_user2' => :'beacon_user2', - :'analysis' => :'analysis', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'beacon_user1' => :'BeaconUserRevision', - :'beacon_user2' => :'BeaconUserRevision', - :'analysis' => :'BeaconMatchSummaryAnalysis', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconDuplicateGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconDuplicateGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'beacon_user1') - self.beacon_user1 = attributes[:'beacon_user1'] - end - - if attributes.key?(:'beacon_user2') - self.beacon_user2 = attributes[:'beacon_user2'] - end - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @beacon_user1.nil? - invalid_properties.push('invalid value for "beacon_user1", beacon_user1 cannot be nil.') - end - - if @beacon_user2.nil? - invalid_properties.push('invalid value for "beacon_user2", beacon_user2 cannot be nil.') - end - - if @analysis.nil? - invalid_properties.push('invalid value for "analysis", analysis cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @beacon_user1.nil? - return false if @beacon_user2.nil? - return false if @analysis.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - beacon_user1 == o.beacon_user1 && - beacon_user2 == o.beacon_user2 && - analysis == o.analysis && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, beacon_user1, beacon_user2, analysis, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_match_summary_analysis.rb b/lib/plaid/models/beacon_match_summary_analysis.rb deleted file mode 100644 index b3b7b8dbf..000000000 --- a/lib/plaid/models/beacon_match_summary_analysis.rb +++ /dev/null @@ -1,331 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Analysis of which fields matched between one Beacon User and another. - class BeaconMatchSummaryAnalysis - attr_accessor :address - - attr_accessor :date_of_birth - - attr_accessor :email_address - - attr_accessor :name - - attr_accessor :id_number - - attr_accessor :ip_address - - attr_accessor :phone_number - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'address' => :'address', - :'date_of_birth' => :'date_of_birth', - :'email_address' => :'email_address', - :'name' => :'name', - :'id_number' => :'id_number', - :'ip_address' => :'ip_address', - :'phone_number' => :'phone_number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'address' => :'BeaconMatchSummaryCode', - :'date_of_birth' => :'BeaconMatchSummaryCode', - :'email_address' => :'BeaconMatchSummaryCode', - :'name' => :'BeaconMatchSummaryCode', - :'id_number' => :'BeaconMatchSummaryCode', - :'ip_address' => :'BeaconMatchSummaryCode', - :'phone_number' => :'BeaconMatchSummaryCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconMatchSummaryAnalysis` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconMatchSummaryAnalysis`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'id_number') - self.id_number = attributes[:'id_number'] - end - - if attributes.key?(:'ip_address') - self.ip_address = attributes[:'ip_address'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @address.nil? - invalid_properties.push('invalid value for "address", address cannot be nil.') - end - - if @date_of_birth.nil? - invalid_properties.push('invalid value for "date_of_birth", date_of_birth cannot be nil.') - end - - if @email_address.nil? - invalid_properties.push('invalid value for "email_address", email_address cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @id_number.nil? - invalid_properties.push('invalid value for "id_number", id_number cannot be nil.') - end - - if @ip_address.nil? - invalid_properties.push('invalid value for "ip_address", ip_address cannot be nil.') - end - - if @phone_number.nil? - invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @address.nil? - return false if @date_of_birth.nil? - return false if @email_address.nil? - return false if @name.nil? - return false if @id_number.nil? - return false if @ip_address.nil? - return false if @phone_number.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - address == o.address && - date_of_birth == o.date_of_birth && - email_address == o.email_address && - name == o.name && - id_number == o.id_number && - ip_address == o.ip_address && - phone_number == o.phone_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [address, date_of_birth, email_address, name, id_number, ip_address, phone_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_match_summary_code.rb b/lib/plaid/models/beacon_match_summary_code.rb deleted file mode 100644 index 05d776d98..000000000 --- a/lib/plaid/models/beacon_match_summary_code.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class BeaconMatchSummaryCode - MATCH = "match".freeze - PARTIAL_MATCH = "partial_match".freeze - NO_MATCH = "no_match".freeze - NO_DATA = "no_data".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/beacon_report.rb b/lib/plaid/models/beacon_report.rb deleted file mode 100644 index 46fae6e78..000000000 --- a/lib/plaid/models/beacon_report.rb +++ /dev/null @@ -1,331 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class BeaconReport - # ID of the associated Beacon Report. - attr_accessor :id - - # ID of the associated Beacon User. - attr_accessor :beacon_user_id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - attr_accessor :type - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :fraud_date - - attr_accessor :fraud_amount - - attr_accessor :audit_trail - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'beacon_user_id' => :'beacon_user_id', - :'created_at' => :'created_at', - :'type' => :'type', - :'fraud_date' => :'fraud_date', - :'fraud_amount' => :'fraud_amount', - :'audit_trail' => :'audit_trail' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'beacon_user_id' => :'String', - :'created_at' => :'Time', - :'type' => :'BeaconReportType', - :'fraud_date' => :'Date', - :'fraud_amount' => :'FraudAmount', - :'audit_trail' => :'BeaconAuditTrail' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'fraud_amount', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReport` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'beacon_user_id') - self.beacon_user_id = attributes[:'beacon_user_id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'fraud_date') - self.fraud_date = attributes[:'fraud_date'] - end - - if attributes.key?(:'fraud_amount') - self.fraud_amount = attributes[:'fraud_amount'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @beacon_user_id.nil? - invalid_properties.push('invalid value for "beacon_user_id", beacon_user_id cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @fraud_date.nil? - invalid_properties.push('invalid value for "fraud_date", fraud_date cannot be nil.') - end - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @beacon_user_id.nil? - return false if @created_at.nil? - return false if @type.nil? - return false if @fraud_date.nil? - return false if @audit_trail.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - beacon_user_id == o.beacon_user_id && - created_at == o.created_at && - type == o.type && - fraud_date == o.fraud_date && - fraud_amount == o.fraud_amount && - audit_trail == o.audit_trail - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, beacon_user_id, created_at, type, fraud_date, fraud_amount, audit_trail].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_create_request.rb b/lib/plaid/models/beacon_report_create_request.rb deleted file mode 100644 index b4d206fce..000000000 --- a/lib/plaid/models/beacon_report_create_request.rb +++ /dev/null @@ -1,307 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for creating a Beacon Report - class BeaconReportCreateRequest - # ID of the associated Beacon User. - attr_accessor :beacon_user_id - - attr_accessor :type - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :fraud_date - - attr_accessor :fraud_amount - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'beacon_user_id' => :'beacon_user_id', - :'type' => :'type', - :'fraud_date' => :'fraud_date', - :'fraud_amount' => :'fraud_amount', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'beacon_user_id' => :'String', - :'type' => :'BeaconReportType', - :'fraud_date' => :'Date', - :'fraud_amount' => :'FraudAmount', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'fraud_amount', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'beacon_user_id') - self.beacon_user_id = attributes[:'beacon_user_id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'fraud_date') - self.fraud_date = attributes[:'fraud_date'] - end - - if attributes.key?(:'fraud_amount') - self.fraud_amount = attributes[:'fraud_amount'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @beacon_user_id.nil? - invalid_properties.push('invalid value for "beacon_user_id", beacon_user_id cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @fraud_date.nil? - invalid_properties.push('invalid value for "fraud_date", fraud_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @beacon_user_id.nil? - return false if @type.nil? - return false if @fraud_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - beacon_user_id == o.beacon_user_id && - type == o.type && - fraud_date == o.fraud_date && - fraud_amount == o.fraud_amount && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [beacon_user_id, type, fraud_date, fraud_amount, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_create_response.rb b/lib/plaid/models/beacon_report_create_response.rb deleted file mode 100644 index 35670dfc9..000000000 --- a/lib/plaid/models/beacon_report_create_response.rb +++ /dev/null @@ -1,346 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class BeaconReportCreateResponse - # ID of the associated Beacon Report. - attr_accessor :id - - # ID of the associated Beacon User. - attr_accessor :beacon_user_id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - attr_accessor :type - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :fraud_date - - attr_accessor :fraud_amount - - attr_accessor :audit_trail - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'beacon_user_id' => :'beacon_user_id', - :'created_at' => :'created_at', - :'type' => :'type', - :'fraud_date' => :'fraud_date', - :'fraud_amount' => :'fraud_amount', - :'audit_trail' => :'audit_trail', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'beacon_user_id' => :'String', - :'created_at' => :'Time', - :'type' => :'BeaconReportType', - :'fraud_date' => :'Date', - :'fraud_amount' => :'FraudAmount', - :'audit_trail' => :'BeaconAuditTrail', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'fraud_amount', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'beacon_user_id') - self.beacon_user_id = attributes[:'beacon_user_id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'fraud_date') - self.fraud_date = attributes[:'fraud_date'] - end - - if attributes.key?(:'fraud_amount') - self.fraud_amount = attributes[:'fraud_amount'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @beacon_user_id.nil? - invalid_properties.push('invalid value for "beacon_user_id", beacon_user_id cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @fraud_date.nil? - invalid_properties.push('invalid value for "fraud_date", fraud_date cannot be nil.') - end - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @beacon_user_id.nil? - return false if @created_at.nil? - return false if @type.nil? - return false if @fraud_date.nil? - return false if @audit_trail.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - beacon_user_id == o.beacon_user_id && - created_at == o.created_at && - type == o.type && - fraud_date == o.fraud_date && - fraud_amount == o.fraud_amount && - audit_trail == o.audit_trail && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, beacon_user_id, created_at, type, fraud_date, fraud_amount, audit_trail, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_created_webhook.rb b/lib/plaid/models/beacon_report_created_webhook.rb deleted file mode 100644 index 45566f988..000000000 --- a/lib/plaid/models/beacon_report_created_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when one of your Beacon Users is first reported to the Beacon network. - class BeaconReportCreatedWebhook - # `BEACON` - attr_accessor :webhook_type - - # `REPORT_CREATED` - attr_accessor :webhook_code - - # The ID of the associated Beacon Report. - attr_accessor :beacon_report_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'beacon_report_id' => :'beacon_report_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'beacon_report_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportCreatedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportCreatedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'beacon_report_id') - self.beacon_report_id = attributes[:'beacon_report_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @beacon_report_id.nil? - invalid_properties.push('invalid value for "beacon_report_id", beacon_report_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @beacon_report_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - beacon_report_id == o.beacon_report_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, beacon_report_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_get_request.rb b/lib/plaid/models/beacon_report_get_request.rb deleted file mode 100644 index e06c45f70..000000000 --- a/lib/plaid/models/beacon_report_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for getting a Beacon Report - class BeaconReportGetRequest - # ID of the associated Beacon Report. - attr_accessor :beacon_report_id - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'beacon_report_id' => :'beacon_report_id', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'beacon_report_id' => :'String', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'beacon_report_id') - self.beacon_report_id = attributes[:'beacon_report_id'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @beacon_report_id.nil? - invalid_properties.push('invalid value for "beacon_report_id", beacon_report_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @beacon_report_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - beacon_report_id == o.beacon_report_id && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [beacon_report_id, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_get_response.rb b/lib/plaid/models/beacon_report_get_response.rb deleted file mode 100644 index a1820b7bf..000000000 --- a/lib/plaid/models/beacon_report_get_response.rb +++ /dev/null @@ -1,346 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class BeaconReportGetResponse - # ID of the associated Beacon Report. - attr_accessor :id - - # ID of the associated Beacon User. - attr_accessor :beacon_user_id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - attr_accessor :type - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :fraud_date - - attr_accessor :fraud_amount - - attr_accessor :audit_trail - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'beacon_user_id' => :'beacon_user_id', - :'created_at' => :'created_at', - :'type' => :'type', - :'fraud_date' => :'fraud_date', - :'fraud_amount' => :'fraud_amount', - :'audit_trail' => :'audit_trail', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'beacon_user_id' => :'String', - :'created_at' => :'Time', - :'type' => :'BeaconReportType', - :'fraud_date' => :'Date', - :'fraud_amount' => :'FraudAmount', - :'audit_trail' => :'BeaconAuditTrail', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'fraud_amount', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'beacon_user_id') - self.beacon_user_id = attributes[:'beacon_user_id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'fraud_date') - self.fraud_date = attributes[:'fraud_date'] - end - - if attributes.key?(:'fraud_amount') - self.fraud_amount = attributes[:'fraud_amount'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @beacon_user_id.nil? - invalid_properties.push('invalid value for "beacon_user_id", beacon_user_id cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @fraud_date.nil? - invalid_properties.push('invalid value for "fraud_date", fraud_date cannot be nil.') - end - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @beacon_user_id.nil? - return false if @created_at.nil? - return false if @type.nil? - return false if @fraud_date.nil? - return false if @audit_trail.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - beacon_user_id == o.beacon_user_id && - created_at == o.created_at && - type == o.type && - fraud_date == o.fraud_date && - fraud_amount == o.fraud_amount && - audit_trail == o.audit_trail && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, beacon_user_id, created_at, type, fraud_date, fraud_amount, audit_trail, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_list_request.rb b/lib/plaid/models/beacon_report_list_request.rb deleted file mode 100644 index bb3cea1f5..000000000 --- a/lib/plaid/models/beacon_report_list_request.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for listing Beacon Reports - class BeaconReportListRequest - # ID of the associated Beacon User. - attr_accessor :beacon_user_id - - # An identifier that determines which page of results you receive. - attr_accessor :cursor - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'beacon_user_id' => :'beacon_user_id', - :'cursor' => :'cursor', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'beacon_user_id' => :'String', - :'cursor' => :'String', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'beacon_user_id') - self.beacon_user_id = attributes[:'beacon_user_id'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @beacon_user_id.nil? - invalid_properties.push('invalid value for "beacon_user_id", beacon_user_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @beacon_user_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - beacon_user_id == o.beacon_user_id && - cursor == o.cursor && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [beacon_user_id, cursor, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_list_response.rb b/lib/plaid/models/beacon_report_list_response.rb deleted file mode 100644 index 0191cabf4..000000000 --- a/lib/plaid/models/beacon_report_list_response.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The response schema for `/beacon/report/list` - class BeaconReportListResponse - attr_accessor :beacon_reports - - # An identifier that determines which page of results you receive. - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'beacon_reports' => :'beacon_reports', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'beacon_reports' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'beacon_reports') - if (value = attributes[:'beacon_reports']).is_a?(Array) - self.beacon_reports = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @beacon_reports.nil? - invalid_properties.push('invalid value for "beacon_reports", beacon_reports cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @beacon_reports.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - beacon_reports == o.beacon_reports && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [beacon_reports, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_syndication.rb b/lib/plaid/models/beacon_report_syndication.rb deleted file mode 100644 index 712f65d6f..000000000 --- a/lib/plaid/models/beacon_report_syndication.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A Beacon Report Syndication represents a Beacon Report created either by your organization or another Beacon customer that matches a specific Beacon User you've created. 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. - class BeaconReportSyndication - # ID of the associated Beacon Report Syndication. - attr_accessor :id - - attr_accessor :report - - attr_accessor :analysis - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'report' => :'report', - :'analysis' => :'analysis' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'report' => :'BeaconReportSyndicationOriginalReport', - :'analysis' => :'BeaconReportSyndicationAnalysis' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportSyndication` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportSyndication`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'report') - self.report = attributes[:'report'] - end - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @report.nil? - invalid_properties.push('invalid value for "report", report cannot be nil.') - end - - if @analysis.nil? - invalid_properties.push('invalid value for "analysis", analysis cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @report.nil? - return false if @analysis.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - report == o.report && - analysis == o.analysis - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, report, analysis].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_syndication_analysis.rb b/lib/plaid/models/beacon_report_syndication_analysis.rb deleted file mode 100644 index dc022d282..000000000 --- a/lib/plaid/models/beacon_report_syndication_analysis.rb +++ /dev/null @@ -1,331 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Analysis of which fields matched between the originally reported Beacon User and the Beacon User that the report was syndicated to. - class BeaconReportSyndicationAnalysis - attr_accessor :address - - attr_accessor :date_of_birth - - attr_accessor :email_address - - attr_accessor :name - - attr_accessor :id_number - - attr_accessor :ip_address - - attr_accessor :phone_number - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'address' => :'address', - :'date_of_birth' => :'date_of_birth', - :'email_address' => :'email_address', - :'name' => :'name', - :'id_number' => :'id_number', - :'ip_address' => :'ip_address', - :'phone_number' => :'phone_number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'address' => :'BeaconMatchSummaryCode', - :'date_of_birth' => :'BeaconMatchSummaryCode', - :'email_address' => :'BeaconMatchSummaryCode', - :'name' => :'BeaconMatchSummaryCode', - :'id_number' => :'BeaconMatchSummaryCode', - :'ip_address' => :'BeaconMatchSummaryCode', - :'phone_number' => :'BeaconMatchSummaryCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportSyndicationAnalysis` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportSyndicationAnalysis`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'id_number') - self.id_number = attributes[:'id_number'] - end - - if attributes.key?(:'ip_address') - self.ip_address = attributes[:'ip_address'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @address.nil? - invalid_properties.push('invalid value for "address", address cannot be nil.') - end - - if @date_of_birth.nil? - invalid_properties.push('invalid value for "date_of_birth", date_of_birth cannot be nil.') - end - - if @email_address.nil? - invalid_properties.push('invalid value for "email_address", email_address cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @id_number.nil? - invalid_properties.push('invalid value for "id_number", id_number cannot be nil.') - end - - if @ip_address.nil? - invalid_properties.push('invalid value for "ip_address", ip_address cannot be nil.') - end - - if @phone_number.nil? - invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @address.nil? - return false if @date_of_birth.nil? - return false if @email_address.nil? - return false if @name.nil? - return false if @id_number.nil? - return false if @ip_address.nil? - return false if @phone_number.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - address == o.address && - date_of_birth == o.date_of_birth && - email_address == o.email_address && - name == o.name && - id_number == o.id_number && - ip_address == o.ip_address && - phone_number == o.phone_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [address, date_of_birth, email_address, name, id_number, ip_address, phone_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_syndication_created_webhook.rb b/lib/plaid/models/beacon_report_syndication_created_webhook.rb deleted file mode 100644 index 4888907e6..000000000 --- a/lib/plaid/models/beacon_report_syndication_created_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when a report created on the Beacon Network matches with one of your Beacon Users. - class BeaconReportSyndicationCreatedWebhook - # `BEACON` - attr_accessor :webhook_type - - # `REPORT_SYNDICATION_CREATED` - attr_accessor :webhook_code - - # The ID of the associated Beacon Report Syndication. - attr_accessor :beacon_report_syndication_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'beacon_report_syndication_id' => :'beacon_report_syndication_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'beacon_report_syndication_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportSyndicationCreatedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportSyndicationCreatedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'beacon_report_syndication_id') - self.beacon_report_syndication_id = attributes[:'beacon_report_syndication_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @beacon_report_syndication_id.nil? - invalid_properties.push('invalid value for "beacon_report_syndication_id", beacon_report_syndication_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @beacon_report_syndication_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - beacon_report_syndication_id == o.beacon_report_syndication_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, beacon_report_syndication_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_syndication_get_request.rb b/lib/plaid/models/beacon_report_syndication_get_request.rb deleted file mode 100644 index 1b5e14bd0..000000000 --- a/lib/plaid/models/beacon_report_syndication_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for getting a Beacon Report Syndication - class BeaconReportSyndicationGetRequest - # ID of the associated Beacon Report Syndication. - attr_accessor :beacon_report_syndication_id - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'beacon_report_syndication_id' => :'beacon_report_syndication_id', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'beacon_report_syndication_id' => :'String', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportSyndicationGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportSyndicationGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'beacon_report_syndication_id') - self.beacon_report_syndication_id = attributes[:'beacon_report_syndication_id'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @beacon_report_syndication_id.nil? - invalid_properties.push('invalid value for "beacon_report_syndication_id", beacon_report_syndication_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @beacon_report_syndication_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - beacon_report_syndication_id == o.beacon_report_syndication_id && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [beacon_report_syndication_id, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_syndication_get_response.rb b/lib/plaid/models/beacon_report_syndication_get_response.rb deleted file mode 100644 index 54fda7783..000000000 --- a/lib/plaid/models/beacon_report_syndication_get_response.rb +++ /dev/null @@ -1,269 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A Beacon Report Syndication represents a Beacon Report created either by your organization or another Beacon customer that matches a specific Beacon User you've created. 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. - class BeaconReportSyndicationGetResponse - # ID of the associated Beacon Report Syndication. - attr_accessor :id - - attr_accessor :report - - attr_accessor :analysis - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'report' => :'report', - :'analysis' => :'analysis', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'report' => :'BeaconReportSyndicationOriginalReport', - :'analysis' => :'BeaconReportSyndicationAnalysis', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportSyndicationGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportSyndicationGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'report') - self.report = attributes[:'report'] - end - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @report.nil? - invalid_properties.push('invalid value for "report", report cannot be nil.') - end - - if @analysis.nil? - invalid_properties.push('invalid value for "analysis", analysis cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @report.nil? - return false if @analysis.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - report == o.report && - analysis == o.analysis && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, report, analysis, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_syndication_list_request.rb b/lib/plaid/models/beacon_report_syndication_list_request.rb deleted file mode 100644 index 3ef1f7482..000000000 --- a/lib/plaid/models/beacon_report_syndication_list_request.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for listing Beacon Report Syndications - class BeaconReportSyndicationListRequest - # ID of the associated Beacon User. - attr_accessor :beacon_user_id - - # An identifier that determines which page of results you receive. - attr_accessor :cursor - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'beacon_user_id' => :'beacon_user_id', - :'cursor' => :'cursor', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'beacon_user_id' => :'String', - :'cursor' => :'String', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportSyndicationListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportSyndicationListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'beacon_user_id') - self.beacon_user_id = attributes[:'beacon_user_id'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @beacon_user_id.nil? - invalid_properties.push('invalid value for "beacon_user_id", beacon_user_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @beacon_user_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - beacon_user_id == o.beacon_user_id && - cursor == o.cursor && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [beacon_user_id, cursor, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_syndication_list_response.rb b/lib/plaid/models/beacon_report_syndication_list_response.rb deleted file mode 100644 index 0c262765d..000000000 --- a/lib/plaid/models/beacon_report_syndication_list_response.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The response schema for `/beacon/report_syndication/list` - class BeaconReportSyndicationListResponse - attr_accessor :beacon_report_syndications - - # An identifier that determines which page of results you receive. - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'beacon_report_syndications' => :'beacon_report_syndications', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'beacon_report_syndications' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportSyndicationListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportSyndicationListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'beacon_report_syndications') - if (value = attributes[:'beacon_report_syndications']).is_a?(Array) - self.beacon_report_syndications = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @beacon_report_syndications.nil? - invalid_properties.push('invalid value for "beacon_report_syndications", beacon_report_syndications cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @beacon_report_syndications.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - beacon_report_syndications == o.beacon_report_syndications && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [beacon_report_syndications, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_syndication_original_report.rb b/lib/plaid/models/beacon_report_syndication_original_report.rb deleted file mode 100644 index 0a2d898de..000000000 --- a/lib/plaid/models/beacon_report_syndication_original_report.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class BeaconReportSyndicationOriginalReport - # ID of the associated Beacon Report. - attr_accessor :id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - attr_accessor :type - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :fraud_date - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'created_at' => :'created_at', - :'type' => :'type', - :'fraud_date' => :'fraud_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'created_at' => :'Time', - :'type' => :'BeaconReportType', - :'fraud_date' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportSyndicationOriginalReport` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportSyndicationOriginalReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'fraud_date') - self.fraud_date = attributes[:'fraud_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @fraud_date.nil? - invalid_properties.push('invalid value for "fraud_date", fraud_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @created_at.nil? - return false if @type.nil? - return false if @fraud_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - created_at == o.created_at && - type == o.type && - fraud_date == o.fraud_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, created_at, type, fraud_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_report_type.rb b/lib/plaid/models/beacon_report_type.rb deleted file mode 100644 index 001e394ac..000000000 --- a/lib/plaid/models/beacon_report_type.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class BeaconReportType - FIRST_PARTY = "first_party".freeze - STOLEN = "stolen".freeze - SYNTHETIC = "synthetic".freeze - ACCOUNT_TAKEOVER = "account_takeover".freeze - UNKNOWN = "unknown".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/beacon_report_updated_webhook.rb b/lib/plaid/models/beacon_report_updated_webhook.rb deleted file mode 100644 index a292db89b..000000000 --- a/lib/plaid/models/beacon_report_updated_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when one of your existing Beacon Reports has been modified or removed from the Beacon Network. - class BeaconReportUpdatedWebhook - # `BEACON` - attr_accessor :webhook_type - - # `REPORT_UPDATED` - attr_accessor :webhook_code - - # The ID of the associated Beacon Report. - attr_accessor :beacon_report_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'beacon_report_id' => :'beacon_report_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'beacon_report_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconReportUpdatedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconReportUpdatedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'beacon_report_id') - self.beacon_report_id = attributes[:'beacon_report_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @beacon_report_id.nil? - invalid_properties.push('invalid value for "beacon_report_id", beacon_report_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @beacon_report_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - beacon_report_id == o.beacon_report_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, beacon_report_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_address.rb b/lib/plaid/models/beacon_user_address.rb deleted file mode 100644 index bbcee1c1f..000000000 --- a/lib/plaid/models/beacon_user_address.rb +++ /dev/null @@ -1,310 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Even if an address has been collected, 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 a postal code - class BeaconUserAddress - # The primary street portion of an address. If an address is provided, this field will always be filled. - attr_accessor :street - - # Extra street information, like an apartment or suite number. - attr_accessor :street2 - - # City from the end user's address - attr_accessor :city - - # An ISO 3166-2 subdivision code. Related terms would be \"state\", \"province\", \"prefecture\", \"zone\", \"subdivision\", etc. - attr_accessor :region - - # The postal code for the associated address. Between 2 and 10 alphanumeric characters. For US-based addresses this must be 5 numeric digits. - attr_accessor :postal_code - - # Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'street' => :'street', - :'street2' => :'street2', - :'city' => :'city', - :'region' => :'region', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'street' => :'String', - :'street2' => :'String', - :'city' => :'String', - :'region' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'street2', - :'region', - :'postal_code', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'street2') - self.street2 = attributes[:'street2'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @street.nil? - invalid_properties.push('invalid value for "street", street cannot be nil.') - end - - if @city.nil? - invalid_properties.push('invalid value for "city", city cannot be nil.') - end - - if @country.nil? - invalid_properties.push('invalid value for "country", country cannot be nil.') - end - - if @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @street.nil? - return false if @city.nil? - return false if @country.nil? - return false if @country.to_s.length < 2 - true - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if country.nil? - fail ArgumentError, 'country cannot be nil' - end - - if country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - street == o.street && - street2 == o.street2 && - city == o.city && - region == o.region && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [street, street2, city, region, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_create_request.rb b/lib/plaid/models/beacon_user_create_request.rb deleted file mode 100644 index 8f83ce049..000000000 --- a/lib/plaid/models/beacon_user_create_request.rb +++ /dev/null @@ -1,296 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for creating a Beacon User. The primary use for this endpoint is to add a new end user to Beacon for fraud and duplicate scanning. This endpoint can also be used to import historical fraud cases into the Beacon Network without being charged for creating a Beacon User. To import historical fraud cases, embed the fraud report in the optional `report` section of the request payload. - class BeaconUserCreateRequest - # ID of the associated Beacon Program. - attr_accessor :program_id - - # 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`. - attr_accessor :client_user_id - - attr_accessor :user - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'program_id' => :'program_id', - :'client_user_id' => :'client_user_id', - :'user' => :'user', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'program_id' => :'String', - :'client_user_id' => :'String', - :'user' => :'BeaconUserRequestData', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'program_id') - self.program_id = attributes[:'program_id'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @program_id.nil? - invalid_properties.push('invalid value for "program_id", program_id cannot be nil.') - end - - if @client_user_id.nil? - invalid_properties.push('invalid value for "client_user_id", client_user_id cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @program_id.nil? - return false if @client_user_id.nil? - return false if @client_user_id.to_s.length < 1 - return false if @user.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.nil? - fail ArgumentError, 'client_user_id cannot be nil' - end - - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - program_id == o.program_id && - client_user_id == o.client_user_id && - user == o.user && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [program_id, client_user_id, user, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_create_response.rb b/lib/plaid/models/beacon_user_create_response.rb deleted file mode 100644 index 3613ea226..000000000 --- a/lib/plaid/models/beacon_user_create_response.rb +++ /dev/null @@ -1,386 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A Beacon User represents an end user that has been scanned against the Beacon Network. - class BeaconUserCreateResponse - # ID of the associated Beacon User. - attr_accessor :id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - # An ISO8601 formatted timestamp. This field indicates the last time the resource was modified. - attr_accessor :updated_at - - attr_accessor :status - - # ID of the associated Beacon Program. - attr_accessor :program_id - - # 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`. - attr_accessor :client_user_id - - attr_accessor :user - - attr_accessor :audit_trail - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'created_at' => :'created_at', - :'updated_at' => :'updated_at', - :'status' => :'status', - :'program_id' => :'program_id', - :'client_user_id' => :'client_user_id', - :'user' => :'user', - :'audit_trail' => :'audit_trail', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'created_at' => :'Time', - :'updated_at' => :'Time', - :'status' => :'BeaconUserStatus', - :'program_id' => :'String', - :'client_user_id' => :'String', - :'user' => :'BeaconUserData', - :'audit_trail' => :'BeaconAuditTrail', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'updated_at') - self.updated_at = attributes[:'updated_at'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'program_id') - self.program_id = attributes[:'program_id'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @updated_at.nil? - invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @program_id.nil? - invalid_properties.push('invalid value for "program_id", program_id cannot be nil.') - end - - if @client_user_id.nil? - invalid_properties.push('invalid value for "client_user_id", client_user_id cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @created_at.nil? - return false if @updated_at.nil? - return false if @status.nil? - return false if @program_id.nil? - return false if @client_user_id.nil? - return false if @client_user_id.to_s.length < 1 - return false if @user.nil? - return false if @audit_trail.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.nil? - fail ArgumentError, 'client_user_id cannot be nil' - end - - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - created_at == o.created_at && - updated_at == o.updated_at && - status == o.status && - program_id == o.program_id && - client_user_id == o.client_user_id && - user == o.user && - audit_trail == o.audit_trail && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, created_at, updated_at, status, program_id, client_user_id, user, audit_trail, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_data.rb b/lib/plaid/models/beacon_user_data.rb deleted file mode 100644 index 0e1957183..000000000 --- a/lib/plaid/models/beacon_user_data.rb +++ /dev/null @@ -1,297 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A Beacon User's data and resulting analysis when checked against duplicate records and the Beacon Fraud Network. - class BeaconUserData - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :date_of_birth - - attr_accessor :name - - attr_accessor :address - - # A valid email address. - attr_accessor :email_address - - # A phone number in E.164 format. - attr_accessor :phone_number - - attr_accessor :id_number - - # An IPv4 or IPV6 address. - attr_accessor :ip_address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'date_of_birth' => :'date_of_birth', - :'name' => :'name', - :'address' => :'address', - :'email_address' => :'email_address', - :'phone_number' => :'phone_number', - :'id_number' => :'id_number', - :'ip_address' => :'ip_address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'date_of_birth' => :'Date', - :'name' => :'BeaconUserName', - :'address' => :'BeaconUserAddress', - :'email_address' => :'String', - :'phone_number' => :'String', - :'id_number' => :'BeaconUserIDNumber', - :'ip_address' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'email_address', - :'phone_number', - :'id_number', - :'ip_address' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'id_number') - self.id_number = attributes[:'id_number'] - end - - if attributes.key?(:'ip_address') - self.ip_address = attributes[:'ip_address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @date_of_birth.nil? - invalid_properties.push('invalid value for "date_of_birth", date_of_birth cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @address.nil? - invalid_properties.push('invalid value for "address", address cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @date_of_birth.nil? - return false if @name.nil? - return false if @address.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - date_of_birth == o.date_of_birth && - name == o.name && - address == o.address && - email_address == o.email_address && - phone_number == o.phone_number && - id_number == o.id_number && - ip_address == o.ip_address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [date_of_birth, name, address, email_address, phone_number, id_number, ip_address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_get_request.rb b/lib/plaid/models/beacon_user_get_request.rb deleted file mode 100644 index 435d70b52..000000000 --- a/lib/plaid/models/beacon_user_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for fetching a Beacon User - class BeaconUserGetRequest - # ID of the associated Beacon User. - attr_accessor :beacon_user_id - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'beacon_user_id' => :'beacon_user_id', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'beacon_user_id' => :'String', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'beacon_user_id') - self.beacon_user_id = attributes[:'beacon_user_id'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @beacon_user_id.nil? - invalid_properties.push('invalid value for "beacon_user_id", beacon_user_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @beacon_user_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - beacon_user_id == o.beacon_user_id && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [beacon_user_id, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_get_response.rb b/lib/plaid/models/beacon_user_get_response.rb deleted file mode 100644 index 0cfc3a362..000000000 --- a/lib/plaid/models/beacon_user_get_response.rb +++ /dev/null @@ -1,386 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A Beacon User represents an end user that has been scanned against the Beacon Network. - class BeaconUserGetResponse - # ID of the associated Beacon User. - attr_accessor :id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - # An ISO8601 formatted timestamp. This field indicates the last time the resource was modified. - attr_accessor :updated_at - - attr_accessor :status - - # ID of the associated Beacon Program. - attr_accessor :program_id - - # 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`. - attr_accessor :client_user_id - - attr_accessor :user - - attr_accessor :audit_trail - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'created_at' => :'created_at', - :'updated_at' => :'updated_at', - :'status' => :'status', - :'program_id' => :'program_id', - :'client_user_id' => :'client_user_id', - :'user' => :'user', - :'audit_trail' => :'audit_trail', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'created_at' => :'Time', - :'updated_at' => :'Time', - :'status' => :'BeaconUserStatus', - :'program_id' => :'String', - :'client_user_id' => :'String', - :'user' => :'BeaconUserData', - :'audit_trail' => :'BeaconAuditTrail', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'updated_at') - self.updated_at = attributes[:'updated_at'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'program_id') - self.program_id = attributes[:'program_id'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @updated_at.nil? - invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @program_id.nil? - invalid_properties.push('invalid value for "program_id", program_id cannot be nil.') - end - - if @client_user_id.nil? - invalid_properties.push('invalid value for "client_user_id", client_user_id cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @created_at.nil? - return false if @updated_at.nil? - return false if @status.nil? - return false if @program_id.nil? - return false if @client_user_id.nil? - return false if @client_user_id.to_s.length < 1 - return false if @user.nil? - return false if @audit_trail.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.nil? - fail ArgumentError, 'client_user_id cannot be nil' - end - - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - created_at == o.created_at && - updated_at == o.updated_at && - status == o.status && - program_id == o.program_id && - client_user_id == o.client_user_id && - user == o.user && - audit_trail == o.audit_trail && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, created_at, updated_at, status, program_id, client_user_id, user, audit_trail, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_id_number.rb b/lib/plaid/models/beacon_user_id_number.rb deleted file mode 100644 index 473143e34..000000000 --- a/lib/plaid/models/beacon_user_id_number.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The ID number associated with a Beacon User. - class BeaconUserIDNumber - # Value of identity document value typed in by user. Alpha-numeric, with all formatting characters stripped. - attr_accessor :value - - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'type' => :'type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'String', - :'type' => :'IDNumberType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserIDNumber` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserIDNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @value.nil? - return false if @type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_name.rb b/lib/plaid/models/beacon_user_name.rb deleted file mode 100644 index 88d3cab5e..000000000 --- a/lib/plaid/models/beacon_user_name.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The full name for a given Beacon User. - class BeaconUserName - # A string with at least one non-whitespace character, with a max length of 100 characters. - attr_accessor :given_name - - # A string with at least one non-whitespace character, with a max length of 100 characters. - attr_accessor :family_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'given_name', - :'family_name' => :'family_name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserName` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @given_name.nil? - invalid_properties.push('invalid value for "given_name", given_name cannot be nil.') - end - - if @family_name.nil? - invalid_properties.push('invalid value for "family_name", family_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @given_name.nil? - return false if @family_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_name_nullable.rb b/lib/plaid/models/beacon_user_name_nullable.rb deleted file mode 100644 index e08a1a51a..000000000 --- a/lib/plaid/models/beacon_user_name_nullable.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The full name for a given Beacon User. - class BeaconUserNameNullable - # A string with at least one non-whitespace character, with a max length of 100 characters. - attr_accessor :given_name - - # A string with at least one non-whitespace character, with a max length of 100 characters. - attr_accessor :family_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'given_name', - :'family_name' => :'family_name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserNameNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserNameNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @given_name.nil? - invalid_properties.push('invalid value for "given_name", given_name cannot be nil.') - end - - if @family_name.nil? - invalid_properties.push('invalid value for "family_name", family_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @given_name.nil? - return false if @family_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_request_address.rb b/lib/plaid/models/beacon_user_request_address.rb deleted file mode 100644 index a447518c2..000000000 --- a/lib/plaid/models/beacon_user_request_address.rb +++ /dev/null @@ -1,310 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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). - class BeaconUserRequestAddress - # The primary street portion of an address. If an address is provided, this field will always be filled. - attr_accessor :street - - # Extra street information, like an apartment or suite number. - attr_accessor :street2 - - # City from the end user's address - attr_accessor :city - - # An ISO 3166-2 subdivision code. Related terms would be \"state\", \"province\", \"prefecture\", \"zone\", \"subdivision\", etc. - attr_accessor :region - - # The postal code for the associated address. Between 2 and 10 alphanumeric characters. For US-based addresses this must be 5 numeric digits. - attr_accessor :postal_code - - # Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'street' => :'street', - :'street2' => :'street2', - :'city' => :'city', - :'region' => :'region', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'street' => :'String', - :'street2' => :'String', - :'city' => :'String', - :'region' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'street2', - :'region', - :'postal_code', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserRequestAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserRequestAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'street2') - self.street2 = attributes[:'street2'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @street.nil? - invalid_properties.push('invalid value for "street", street cannot be nil.') - end - - if @city.nil? - invalid_properties.push('invalid value for "city", city cannot be nil.') - end - - if @country.nil? - invalid_properties.push('invalid value for "country", country cannot be nil.') - end - - if @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @street.nil? - return false if @city.nil? - return false if @country.nil? - return false if @country.to_s.length < 2 - true - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if country.nil? - fail ArgumentError, 'country cannot be nil' - end - - if country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - street == o.street && - street2 == o.street2 && - city == o.city && - region == o.region && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [street, street2, city, region, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_request_address_nullable.rb b/lib/plaid/models/beacon_user_request_address_nullable.rb deleted file mode 100644 index 0e87656d2..000000000 --- a/lib/plaid/models/beacon_user_request_address_nullable.rb +++ /dev/null @@ -1,310 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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). - class BeaconUserRequestAddressNullable - # The primary street portion of an address. If an address is provided, this field will always be filled. - attr_accessor :street - - # Extra street information, like an apartment or suite number. - attr_accessor :street2 - - # City from the end user's address - attr_accessor :city - - # An ISO 3166-2 subdivision code. Related terms would be \"state\", \"province\", \"prefecture\", \"zone\", \"subdivision\", etc. - attr_accessor :region - - # The postal code for the associated address. Between 2 and 10 alphanumeric characters. For US-based addresses this must be 5 numeric digits. - attr_accessor :postal_code - - # Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'street' => :'street', - :'street2' => :'street2', - :'city' => :'city', - :'region' => :'region', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'street' => :'String', - :'street2' => :'String', - :'city' => :'String', - :'region' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'street2', - :'region', - :'postal_code', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserRequestAddressNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserRequestAddressNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'street2') - self.street2 = attributes[:'street2'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @street.nil? - invalid_properties.push('invalid value for "street", street cannot be nil.') - end - - if @city.nil? - invalid_properties.push('invalid value for "city", city cannot be nil.') - end - - if @country.nil? - invalid_properties.push('invalid value for "country", country cannot be nil.') - end - - if @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @street.nil? - return false if @city.nil? - return false if @country.nil? - return false if @country.to_s.length < 2 - true - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if country.nil? - fail ArgumentError, 'country cannot be nil' - end - - if country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - street == o.street && - street2 == o.street2 && - city == o.city && - region == o.region && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [street, street2, city, region, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_request_data.rb b/lib/plaid/models/beacon_user_request_data.rb deleted file mode 100644 index 3ccb65c08..000000000 --- a/lib/plaid/models/beacon_user_request_data.rb +++ /dev/null @@ -1,296 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A Beacon User's data which is used to check against duplicate records and the Beacon Fraud Network. - class BeaconUserRequestData - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :date_of_birth - - attr_accessor :name - - attr_accessor :address - - # A valid email address. - attr_accessor :email_address - - # A phone number in E.164 format. - attr_accessor :phone_number - - attr_accessor :id_number - - # An IPv4 or IPV6 address. - attr_accessor :ip_address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'date_of_birth' => :'date_of_birth', - :'name' => :'name', - :'address' => :'address', - :'email_address' => :'email_address', - :'phone_number' => :'phone_number', - :'id_number' => :'id_number', - :'ip_address' => :'ip_address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'date_of_birth' => :'Date', - :'name' => :'BeaconUserName', - :'address' => :'BeaconUserRequestAddress', - :'email_address' => :'String', - :'phone_number' => :'String', - :'id_number' => :'BeaconUserIDNumber', - :'ip_address' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'phone_number', - :'id_number', - :'ip_address' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserRequestData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserRequestData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'id_number') - self.id_number = attributes[:'id_number'] - end - - if attributes.key?(:'ip_address') - self.ip_address = attributes[:'ip_address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @date_of_birth.nil? - invalid_properties.push('invalid value for "date_of_birth", date_of_birth cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @address.nil? - invalid_properties.push('invalid value for "address", address cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @date_of_birth.nil? - return false if @name.nil? - return false if @address.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - date_of_birth == o.date_of_birth && - name == o.name && - address == o.address && - email_address == o.email_address && - phone_number == o.phone_number && - id_number == o.id_number && - ip_address == o.ip_address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [date_of_birth, name, address, email_address, phone_number, id_number, ip_address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_review_request.rb b/lib/plaid/models/beacon_user_review_request.rb deleted file mode 100644 index 5bac4f904..000000000 --- a/lib/plaid/models/beacon_user_review_request.rb +++ /dev/null @@ -1,282 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for updating the status of a Beacon User - class BeaconUserReviewRequest - # ID of the associated Beacon User. - attr_accessor :beacon_user_id - - attr_accessor :status - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'beacon_user_id' => :'beacon_user_id', - :'status' => :'status', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'beacon_user_id' => :'String', - :'status' => :'BeaconUserStatus', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserReviewRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserReviewRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'beacon_user_id') - self.beacon_user_id = attributes[:'beacon_user_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @beacon_user_id.nil? - invalid_properties.push('invalid value for "beacon_user_id", beacon_user_id cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @beacon_user_id.nil? - return false if @status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - beacon_user_id == o.beacon_user_id && - status == o.status && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [beacon_user_id, status, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_revision.rb b/lib/plaid/models/beacon_user_revision.rb deleted file mode 100644 index 49723b99e..000000000 --- a/lib/plaid/models/beacon_user_revision.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A Beacon User Revision identifies a Beacon User at some point in its revision history. - class BeaconUserRevision - # ID of the associated Beacon User. - attr_accessor :id - - # The `version` field begins with 1 and increments with each subsequent revision. - attr_accessor :version - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'version' => :'version' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'version' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserRevision` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserRevision`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @version.nil? - invalid_properties.push('invalid value for "version", version cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @version.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - version == o.version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, version].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_status.rb b/lib/plaid/models/beacon_user_status.rb deleted file mode 100644 index f7a71971f..000000000 --- a/lib/plaid/models/beacon_user_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class BeaconUserStatus - REJECTED = "rejected".freeze - PENDING_REVIEW = "pending_review".freeze - CLEARED = "cleared".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/beacon_user_status_updated_webhook.rb b/lib/plaid/models/beacon_user_status_updated_webhook.rb deleted file mode 100644 index 9c6c044e5..000000000 --- a/lib/plaid/models/beacon_user_status_updated_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when a Beacon User status has changed, which can occur manually via the dashboard or when information is reported to the Beacon network. - class BeaconUserStatusUpdatedWebhook - # `BEACON` - attr_accessor :webhook_type - - # `USER_STATUS_UPDATED` - attr_accessor :webhook_code - - # The ID of the associated Beacon user. - attr_accessor :beacon_user_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'beacon_user_id' => :'beacon_user_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'beacon_user_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserStatusUpdatedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserStatusUpdatedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'beacon_user_id') - self.beacon_user_id = attributes[:'beacon_user_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @beacon_user_id.nil? - invalid_properties.push('invalid value for "beacon_user_id", beacon_user_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @beacon_user_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - beacon_user_id == o.beacon_user_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, beacon_user_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_update_request.rb b/lib/plaid/models/beacon_user_update_request.rb deleted file mode 100644 index 790a74174..000000000 --- a/lib/plaid/models/beacon_user_update_request.rb +++ /dev/null @@ -1,260 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for updating the identity data of a Beacon User. - class BeaconUserUpdateRequest - # ID of the associated Beacon User. - attr_accessor :beacon_user_id - - attr_accessor :user - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'beacon_user_id' => :'beacon_user_id', - :'user' => :'user', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'beacon_user_id' => :'String', - :'user' => :'BeaconUserUpdateRequestData', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserUpdateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'beacon_user_id') - self.beacon_user_id = attributes[:'beacon_user_id'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @beacon_user_id.nil? - invalid_properties.push('invalid value for "beacon_user_id", beacon_user_id cannot be nil.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @beacon_user_id.nil? - return false if @user.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - beacon_user_id == o.beacon_user_id && - user == o.user && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [beacon_user_id, user, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_update_request_data.rb b/lib/plaid/models/beacon_user_update_request_data.rb deleted file mode 100644 index 5b7ec93ee..000000000 --- a/lib/plaid/models/beacon_user_update_request_data.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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,. - class BeaconUserUpdateRequestData - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :date_of_birth - - attr_accessor :name - - attr_accessor :address - - # A valid email address. - attr_accessor :email_address - - # A phone number in E.164 format. - attr_accessor :phone_number - - attr_accessor :id_number - - # An IPv4 or IPV6 address. - attr_accessor :ip_address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'date_of_birth' => :'date_of_birth', - :'name' => :'name', - :'address' => :'address', - :'email_address' => :'email_address', - :'phone_number' => :'phone_number', - :'id_number' => :'id_number', - :'ip_address' => :'ip_address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'date_of_birth' => :'Date', - :'name' => :'BeaconUserNameNullable', - :'address' => :'BeaconUserRequestAddressNullable', - :'email_address' => :'String', - :'phone_number' => :'String', - :'id_number' => :'BeaconUserIDNumber', - :'ip_address' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'address', - :'phone_number', - :'id_number', - :'ip_address' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserUpdateRequestData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserUpdateRequestData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'id_number') - self.id_number = attributes[:'id_number'] - end - - if attributes.key?(:'ip_address') - self.ip_address = attributes[:'ip_address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - date_of_birth == o.date_of_birth && - name == o.name && - address == o.address && - email_address == o.email_address && - phone_number == o.phone_number && - id_number == o.id_number && - ip_address == o.ip_address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [date_of_birth, name, address, email_address, phone_number, id_number, ip_address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/beacon_user_update_response.rb b/lib/plaid/models/beacon_user_update_response.rb deleted file mode 100644 index 874d935f0..000000000 --- a/lib/plaid/models/beacon_user_update_response.rb +++ /dev/null @@ -1,386 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A Beacon User represents an end user that has been scanned against the Beacon Network. - class BeaconUserUpdateResponse - # ID of the associated Beacon User. - attr_accessor :id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - # An ISO8601 formatted timestamp. This field indicates the last time the resource was modified. - attr_accessor :updated_at - - attr_accessor :status - - # ID of the associated Beacon Program. - attr_accessor :program_id - - # 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`. - attr_accessor :client_user_id - - attr_accessor :user - - attr_accessor :audit_trail - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'created_at' => :'created_at', - :'updated_at' => :'updated_at', - :'status' => :'status', - :'program_id' => :'program_id', - :'client_user_id' => :'client_user_id', - :'user' => :'user', - :'audit_trail' => :'audit_trail', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'created_at' => :'Time', - :'updated_at' => :'Time', - :'status' => :'BeaconUserStatus', - :'program_id' => :'String', - :'client_user_id' => :'String', - :'user' => :'BeaconUserData', - :'audit_trail' => :'BeaconAuditTrail', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::BeaconUserUpdateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::BeaconUserUpdateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'updated_at') - self.updated_at = attributes[:'updated_at'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'program_id') - self.program_id = attributes[:'program_id'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @updated_at.nil? - invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @program_id.nil? - invalid_properties.push('invalid value for "program_id", program_id cannot be nil.') - end - - if @client_user_id.nil? - invalid_properties.push('invalid value for "client_user_id", client_user_id cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @created_at.nil? - return false if @updated_at.nil? - return false if @status.nil? - return false if @program_id.nil? - return false if @client_user_id.nil? - return false if @client_user_id.to_s.length < 1 - return false if @user.nil? - return false if @audit_trail.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.nil? - fail ArgumentError, 'client_user_id cannot be nil' - end - - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - created_at == o.created_at && - updated_at == o.updated_at && - status == o.status && - program_id == o.program_id && - client_user_id == o.client_user_id && - user == o.user && - audit_trail == o.audit_trail && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, created_at, updated_at, status, program_id, client_user_id, user, audit_trail, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/categories_get_response.rb b/lib/plaid/models/categories_get_response.rb deleted file mode 100644 index 4a73edaf8..000000000 --- a/lib/plaid/models/categories_get_response.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CategoriesGetResponse defines the response schema for `/categories/get` - class CategoriesGetResponse - # An array of all of the transaction categories used by Plaid. - attr_accessor :categories - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'categories' => :'categories', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'categories' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CategoriesGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CategoriesGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'categories') - if (value = attributes[:'categories']).is_a?(Array) - self.categories = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @categories.nil? - invalid_properties.push('invalid value for "categories", categories cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @categories.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - categories == o.categories && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [categories, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/category.rb b/lib/plaid/models/category.rb deleted file mode 100644 index 31161cc9a..000000000 --- a/lib/plaid/models/category.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information describing a transaction category - class Category - # An identifying number for the category. `category_id` is a Plaid-specific identifier and does not necessarily correspond to merchant category codes. - attr_accessor :category_id - - # `place` for physical transactions or `special` for other transactions such as bank charges. - attr_accessor :group - - # A hierarchical array of the categories to which this `category_id` belongs. - attr_accessor :hierarchy - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'category_id' => :'category_id', - :'group' => :'group', - :'hierarchy' => :'hierarchy' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'category_id' => :'String', - :'group' => :'String', - :'hierarchy' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Category` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Category`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'category_id') - self.category_id = attributes[:'category_id'] - end - - if attributes.key?(:'group') - self.group = attributes[:'group'] - end - - if attributes.key?(:'hierarchy') - if (value = attributes[:'hierarchy']).is_a?(Array) - self.hierarchy = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @category_id.nil? - invalid_properties.push('invalid value for "category_id", category_id cannot be nil.') - end - - if @group.nil? - invalid_properties.push('invalid value for "group", group cannot be nil.') - end - - if @hierarchy.nil? - invalid_properties.push('invalid value for "hierarchy", hierarchy cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @category_id.nil? - return false if @group.nil? - return false if @hierarchy.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - category_id == o.category_id && - group == o.group && - hierarchy == o.hierarchy - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [category_id, group, hierarchy].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/category_insight_details.rb b/lib/plaid/models/category_insight_details.rb deleted file mode 100644 index 07c0b950f..000000000 --- a/lib/plaid/models/category_insight_details.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Insights object for categories. - class CategoryInsightDetails - # Category name. - attr_accessor :name - - # The number of transactions associated with this category. - attr_accessor :transaction_count - - # Sum of outflow amounts. - attr_accessor :total_outflows - - # Sum of inflow amounts. - attr_accessor :total_inflows - - # The most common counterparties associated with this category sorted by outflow. - attr_accessor :top_counterparties - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'transaction_count' => :'transaction_count', - :'total_outflows' => :'total_outflows', - :'total_inflows' => :'total_inflows', - :'top_counterparties' => :'top_counterparties' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'transaction_count' => :'Integer', - :'total_outflows' => :'Float', - :'total_inflows' => :'Float', - :'top_counterparties' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CategoryInsightDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CategoryInsightDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'transaction_count') - self.transaction_count = attributes[:'transaction_count'] - end - - if attributes.key?(:'total_outflows') - self.total_outflows = attributes[:'total_outflows'] - end - - if attributes.key?(:'total_inflows') - self.total_inflows = attributes[:'total_inflows'] - end - - if attributes.key?(:'top_counterparties') - if (value = attributes[:'top_counterparties']).is_a?(Array) - self.top_counterparties = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @transaction_count.nil? - invalid_properties.push('invalid value for "transaction_count", transaction_count cannot be nil.') - end - - if @total_outflows.nil? - invalid_properties.push('invalid value for "total_outflows", total_outflows cannot be nil.') - end - - if @total_inflows.nil? - invalid_properties.push('invalid value for "total_inflows", total_inflows cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @transaction_count.nil? - return false if @total_outflows.nil? - return false if @total_inflows.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - transaction_count == o.transaction_count && - total_outflows == o.total_outflows && - total_inflows == o.total_inflows && - top_counterparties == o.top_counterparties - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, transaction_count, total_outflows, total_inflows, top_counterparties].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/category_insights.rb b/lib/plaid/models/category_insights.rb deleted file mode 100644 index 3a030e96c..000000000 --- a/lib/plaid/models/category_insights.rb +++ /dev/null @@ -1,235 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Insights on a user's top personal finance categories. - class CategoryInsights - # List of insights of top primary personal finance categories ranked by outflow. - attr_accessor :primary_category_insights - - # List of insights of top detailed personal finance categories ranked by outflow. - attr_accessor :detailed_category_insights - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'primary_category_insights' => :'primary_category_insights', - :'detailed_category_insights' => :'detailed_category_insights' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'primary_category_insights' => :'Array', - :'detailed_category_insights' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CategoryInsights` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CategoryInsights`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'primary_category_insights') - if (value = attributes[:'primary_category_insights']).is_a?(Array) - self.primary_category_insights = value - end - end - - if attributes.key?(:'detailed_category_insights') - if (value = attributes[:'detailed_category_insights']).is_a?(Array) - self.detailed_category_insights = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - primary_category_insights == o.primary_category_insights && - detailed_category_insights == o.detailed_category_insights - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [primary_category_insights, detailed_category_insights].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cause.rb b/lib/plaid/models/cause.rb deleted file mode 100644 index bcbf39150..000000000 --- a/lib/plaid/models/cause.rb +++ /dev/null @@ -1,365 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class Cause - attr_accessor :error_type - - # The particular error code. Safe for programmatic use. - attr_accessor :error_code - - # A developer-friendly representation of the error code. This may change over time and is not safe for programmatic use. - attr_accessor :error_message - - # 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. - attr_accessor :display_message - - # A unique ID identifying the request, to be used for troubleshooting purposes. This field will be omitted in errors provided by webhooks. - attr_accessor :request_id - - # 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. `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. - attr_accessor :causes - - # The HTTP status code associated with the error. This will only be returned in the response body when the error information is provided via a webhook. - attr_accessor :status - - # The URL of a Plaid documentation page with more information about the error - attr_accessor :documentation_url - - # Suggested steps for resolving the error - attr_accessor :suggested_action - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'error_type' => :'error_type', - :'error_code' => :'error_code', - :'error_message' => :'error_message', - :'display_message' => :'display_message', - :'request_id' => :'request_id', - :'causes' => :'causes', - :'status' => :'status', - :'documentation_url' => :'documentation_url', - :'suggested_action' => :'suggested_action', - :'item_id' => :'item_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'error_type' => :'PlaidErrorType', - :'error_code' => :'String', - :'error_message' => :'String', - :'display_message' => :'String', - :'request_id' => :'String', - :'causes' => :'Array', - :'status' => :'Integer', - :'documentation_url' => :'String', - :'suggested_action' => :'String', - :'item_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'display_message', - :'status', - :'suggested_action', - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'CauseAllOf', - :'PlaidError' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Cause` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Cause`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'error_type') - self.error_type = attributes[:'error_type'] - end - - if attributes.key?(:'error_code') - self.error_code = attributes[:'error_code'] - end - - if attributes.key?(:'error_message') - self.error_message = attributes[:'error_message'] - end - - if attributes.key?(:'display_message') - self.display_message = attributes[:'display_message'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'causes') - if (value = attributes[:'causes']).is_a?(Array) - self.causes = value - end - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'documentation_url') - self.documentation_url = attributes[:'documentation_url'] - end - - if attributes.key?(:'suggested_action') - self.suggested_action = attributes[:'suggested_action'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @error_type.nil? - invalid_properties.push('invalid value for "error_type", error_type cannot be nil.') - end - - if @error_code.nil? - invalid_properties.push('invalid value for "error_code", error_code cannot be nil.') - end - - if @error_message.nil? - invalid_properties.push('invalid value for "error_message", error_message cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @error_type.nil? - return false if @error_code.nil? - return false if @error_message.nil? - return false if @item_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - error_type == o.error_type && - error_code == o.error_code && - error_message == o.error_message && - display_message == o.display_message && - request_id == o.request_id && - causes == o.causes && - status == o.status && - documentation_url == o.documentation_url && - suggested_action == o.suggested_action && - item_id == o.item_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [error_type, error_code, error_message, display_message, request_id, causes, status, documentation_url, suggested_action, item_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cause_all_of.rb b/lib/plaid/models/cause_all_of.rb deleted file mode 100644 index 3112166bf..000000000 --- a/lib/plaid/models/cause_all_of.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CauseAllOf - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_id' => :'item_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CauseAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CauseAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_id == o.item_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/client_provided_enhanced_transaction.rb b/lib/plaid/models/client_provided_enhanced_transaction.rb deleted file mode 100644 index 36d2be9e9..000000000 --- a/lib/plaid/models/client_provided_enhanced_transaction.rb +++ /dev/null @@ -1,285 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A client-provided transaction that Plaid has enhanced. - class ClientProvidedEnhancedTransaction - # Unique transaction identifier to tie transactions back to clients' systems. - attr_accessor :id - - # The raw description of the transaction. - attr_accessor :description - - # 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. - attr_accessor :amount - - # The ISO-4217 currency code of the transaction. - attr_accessor :iso_currency_code - - attr_accessor :enhancements - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'description' => :'description', - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code', - :'enhancements' => :'enhancements' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'description' => :'String', - :'amount' => :'Float', - :'iso_currency_code' => :'String', - :'enhancements' => :'Enhancements' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ClientProvidedEnhancedTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ClientProvidedEnhancedTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'enhancements') - self.enhancements = attributes[:'enhancements'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - if @enhancements.nil? - invalid_properties.push('invalid value for "enhancements", enhancements cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @description.nil? - return false if @amount.nil? - return false if @iso_currency_code.nil? - return false if @enhancements.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - description == o.description && - amount == o.amount && - iso_currency_code == o.iso_currency_code && - enhancements == o.enhancements - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, description, amount, iso_currency_code, enhancements].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/client_provided_enriched_transaction.rb b/lib/plaid/models/client_provided_enriched_transaction.rb deleted file mode 100644 index 1c2ab2eba..000000000 --- a/lib/plaid/models/client_provided_enriched_transaction.rb +++ /dev/null @@ -1,356 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A client-provided transaction that Plaid has enriched. - class ClientProvidedEnrichedTransaction - # The unique ID for the transaction as provided by you in the request. - attr_accessor :id - - # A unique user id used to group transactions for a given user, as a unique identifier from your application. Personally identifiable information, such as an email address or phone number, should not be used in the client_user_id. - attr_accessor :client_user_id - - # A unique account id used to group transactions for a given account, as a unique identifier from your application. Personally identifiable information, such as an email address or phone number, should not be used in the client_account_id. - attr_accessor :client_account_id - - # The account type 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). - attr_accessor :account_type - - # 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). - attr_accessor :account_subtype - - # The raw description of the transaction. - attr_accessor :description - - # The absolute value of the transaction (>= 0) - attr_accessor :amount - - attr_accessor :direction - - # The ISO-4217 currency code of the transaction e.g. USD. - attr_accessor :iso_currency_code - - attr_accessor :enrichments - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'client_user_id' => :'client_user_id', - :'client_account_id' => :'client_account_id', - :'account_type' => :'account_type', - :'account_subtype' => :'account_subtype', - :'description' => :'description', - :'amount' => :'amount', - :'direction' => :'direction', - :'iso_currency_code' => :'iso_currency_code', - :'enrichments' => :'enrichments' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'client_user_id' => :'String', - :'client_account_id' => :'String', - :'account_type' => :'String', - :'account_subtype' => :'String', - :'description' => :'String', - :'amount' => :'Float', - :'direction' => :'EnrichTransactionDirection', - :'iso_currency_code' => :'String', - :'enrichments' => :'Enrichments' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ClientProvidedEnrichedTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ClientProvidedEnrichedTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'client_account_id') - self.client_account_id = attributes[:'client_account_id'] - end - - if attributes.key?(:'account_type') - self.account_type = attributes[:'account_type'] - end - - if attributes.key?(:'account_subtype') - self.account_subtype = attributes[:'account_subtype'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'direction') - self.direction = attributes[:'direction'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'enrichments') - self.enrichments = attributes[:'enrichments'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - if @enrichments.nil? - invalid_properties.push('invalid value for "enrichments", enrichments cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @description.nil? - return false if @amount.nil? - return false if @iso_currency_code.nil? - return false if @enrichments.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - client_user_id == o.client_user_id && - client_account_id == o.client_account_id && - account_type == o.account_type && - account_subtype == o.account_subtype && - description == o.description && - amount == o.amount && - direction == o.direction && - iso_currency_code == o.iso_currency_code && - enrichments == o.enrichments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, client_user_id, client_account_id, account_type, account_subtype, description, amount, direction, iso_currency_code, enrichments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/client_provided_raw_transaction.rb b/lib/plaid/models/client_provided_raw_transaction.rb deleted file mode 100644 index 5e41ab1c2..000000000 --- a/lib/plaid/models/client_provided_raw_transaction.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A client-provided transaction for Plaid to enhance. - class ClientProvidedRawTransaction - # A unique ID for the transaction used to help you tie data back to your systems. - attr_accessor :id - - # The raw description of the transaction. - attr_accessor :description - - # The value of the transaction with direction. (NOTE: this will affect enrichment results, so directions are important):. Negative (-) for credits (e.g., incoming transfers, refunds) Positive (+) for debits (e.g., purchases, fees, outgoing transfers) - attr_accessor :amount - - # The ISO-4217 currency code of the transaction e.g. USD. - attr_accessor :iso_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'description' => :'description', - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'description' => :'String', - :'amount' => :'Float', - :'iso_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ClientProvidedRawTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ClientProvidedRawTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @description.nil? - return false if @amount.nil? - return false if @iso_currency_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - description == o.description && - amount == o.amount && - iso_currency_code == o.iso_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, description, amount, iso_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/client_provided_transaction.rb b/lib/plaid/models/client_provided_transaction.rb deleted file mode 100644 index 1a6cd3ef9..000000000 --- a/lib/plaid/models/client_provided_transaction.rb +++ /dev/null @@ -1,376 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A client-provided transaction for Plaid to enrich. - class ClientProvidedTransaction - # A unique ID for the transaction used to help you tie data back to your systems. - attr_accessor :id - - # A unique user id used to group transactions for a given user, as a unique identifier from your application. Personally identifiable information, such as an email address or phone number, should not be used in the client_user_id. - attr_accessor :client_user_id - - # A unique account id used to group transactions for a given account, as a unique identifier from your application. Personally identifiable information, such as an email address or phone number, should not be used in the client_account_id. - attr_accessor :client_account_id - - # The account type 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). - attr_accessor :account_type - - # 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). - attr_accessor :account_subtype - - # The raw description of the transaction. If you have location data in available an unstructured format, it may be appended to the `description` field. - attr_accessor :description - - # The absolute value of the transaction (>= 0). When testing Enrich, note that `amount` data should be realistic. Unrealistic or inaccurate `amount` data may result in reduced quality output. - attr_accessor :amount - - attr_accessor :direction - - # The ISO-4217 currency code of the transaction e.g. USD. - attr_accessor :iso_currency_code - - attr_accessor :location - - # Merchant category codes (MCCs) are four-digit numbers that describe a merchant's primary business activities. - attr_accessor :mcc - - # The date the transaction posted, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format. - attr_accessor :date_posted - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'client_user_id' => :'client_user_id', - :'client_account_id' => :'client_account_id', - :'account_type' => :'account_type', - :'account_subtype' => :'account_subtype', - :'description' => :'description', - :'amount' => :'amount', - :'direction' => :'direction', - :'iso_currency_code' => :'iso_currency_code', - :'location' => :'location', - :'mcc' => :'mcc', - :'date_posted' => :'date_posted' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'client_user_id' => :'String', - :'client_account_id' => :'String', - :'account_type' => :'String', - :'account_subtype' => :'String', - :'description' => :'String', - :'amount' => :'Float', - :'direction' => :'EnrichTransactionDirection', - :'iso_currency_code' => :'String', - :'location' => :'ClientProvidedTransactionLocation', - :'mcc' => :'String', - :'date_posted' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ClientProvidedTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ClientProvidedTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'client_account_id') - self.client_account_id = attributes[:'client_account_id'] - end - - if attributes.key?(:'account_type') - self.account_type = attributes[:'account_type'] - end - - if attributes.key?(:'account_subtype') - self.account_subtype = attributes[:'account_subtype'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'direction') - self.direction = attributes[:'direction'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'location') - self.location = attributes[:'location'] - end - - if attributes.key?(:'mcc') - self.mcc = attributes[:'mcc'] - end - - if attributes.key?(:'date_posted') - self.date_posted = attributes[:'date_posted'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @direction.nil? - invalid_properties.push('invalid value for "direction", direction cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @description.nil? - return false if @amount.nil? - return false if @direction.nil? - return false if @iso_currency_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - client_user_id == o.client_user_id && - client_account_id == o.client_account_id && - account_type == o.account_type && - account_subtype == o.account_subtype && - description == o.description && - amount == o.amount && - direction == o.direction && - iso_currency_code == o.iso_currency_code && - location == o.location && - mcc == o.mcc && - date_posted == o.date_posted - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, client_user_id, client_account_id, account_type, account_subtype, description, amount, direction, iso_currency_code, location, mcc, date_posted].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/client_provided_transaction_location.rb b/lib/plaid/models/client_provided_transaction_location.rb deleted file mode 100644 index ce6bd8fdf..000000000 --- a/lib/plaid/models/client_provided_transaction_location.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A representation of where a transaction took place. Use this field to pass in structured location information you may have about your transactions. Providing location data is optional but can increase result quality. If you have unstructured location information, it may be appended to the `description` field. - class ClientProvidedTransactionLocation - # The country where the transaction occurred. - attr_accessor :country - - # The region or state where the transaction occurred. - attr_accessor :region - - # The city where the transaction occurred. - attr_accessor :city - - # The street address where the transaction occurred. - attr_accessor :address - - # The postal code where the transaction occurred. - attr_accessor :postal_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'country' => :'country', - :'region' => :'region', - :'city' => :'city', - :'address' => :'address', - :'postal_code' => :'postal_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'country' => :'String', - :'region' => :'String', - :'city' => :'String', - :'address' => :'String', - :'postal_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ClientProvidedTransactionLocation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ClientProvidedTransactionLocation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - country == o.country && - region == o.region && - city == o.city && - address == o.address && - postal_code == o.postal_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [country, region, city, address, postal_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/connected_application.rb b/lib/plaid/models/connected_application.rb deleted file mode 100644 index f9bd4a71f..000000000 --- a/lib/plaid/models/connected_application.rb +++ /dev/null @@ -1,310 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Describes the connected application for a particular end user. - class ConnectedApplication - # This field will map to the application ID that is returned from /item/application/list, or provided to the institution in an oauth redirect. - attr_accessor :application_id - - # The name of the application - attr_accessor :name - - # A human-readable name of the application for display purposes - attr_accessor :display_name - - # A URL that links to the application logo image. - attr_accessor :logo_url - - # The URL for the application's website - attr_accessor :application_url - - # A string provided by the connected app stating why they use their respective enabled products. - attr_accessor :reason_for_access - - # The date this application was linked in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format in UTC. - attr_accessor :created_at - - attr_accessor :scopes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'application_id' => :'application_id', - :'name' => :'name', - :'display_name' => :'display_name', - :'logo_url' => :'logo_url', - :'application_url' => :'application_url', - :'reason_for_access' => :'reason_for_access', - :'created_at' => :'created_at', - :'scopes' => :'scopes' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'application_id' => :'String', - :'name' => :'String', - :'display_name' => :'String', - :'logo_url' => :'String', - :'application_url' => :'String', - :'reason_for_access' => :'String', - :'created_at' => :'Time', - :'scopes' => :'ScopesNullable' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'display_name', - :'logo_url', - :'application_url', - :'reason_for_access', - :'scopes' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ConnectedApplication` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ConnectedApplication`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'display_name') - self.display_name = attributes[:'display_name'] - end - - if attributes.key?(:'logo_url') - self.logo_url = attributes[:'logo_url'] - end - - if attributes.key?(:'application_url') - self.application_url = attributes[:'application_url'] - end - - if attributes.key?(:'reason_for_access') - self.reason_for_access = attributes[:'reason_for_access'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'scopes') - self.scopes = attributes[:'scopes'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @application_id.nil? - invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @application_id.nil? - return false if @name.nil? - return false if @created_at.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - application_id == o.application_id && - name == o.name && - display_name == o.display_name && - logo_url == o.logo_url && - application_url == o.application_url && - reason_for_access == o.reason_for_access && - created_at == o.created_at && - scopes == o.scopes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [application_id, name, display_name, logo_url, application_url, reason_for_access, created_at, scopes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/consumer_report_permissible_purpose.rb b/lib/plaid/models/consumer_report_permissible_purpose.rb deleted file mode 100644 index 8506fa3f0..000000000 --- a/lib/plaid/models/consumer_report_permissible_purpose.rb +++ /dev/null @@ -1,45 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class ConsumerReportPermissiblePurpose - ACCOUNT_REVIEW_CREDIT = "ACCOUNT_REVIEW_CREDIT".freeze - ACCOUNT_REVIEW_NON_CREDIT = "ACCOUNT_REVIEW_NON_CREDIT".freeze - EMPLOYMENT = "EMPLOYMENT".freeze - EXTENSION_OF_CREDIT = "EXTENSION_OF_CREDIT".freeze - LEGITIMATE_BUSINESS_NEED_TENANT_SCREENING = "LEGITIMATE_BUSINESS_NEED_TENANT_SCREENING".freeze - LEGITIMATE_BUSINESS_NEED_OTHER = "LEGITIMATE_BUSINESS_NEED_OTHER".freeze - WRITTEN_INSTRUCTION_PREQUALIFICATION = "WRITTEN_INSTRUCTION_PREQUALIFICATION".freeze - WRITTEN_INSTRUCTION_OTHER = "WRITTEN_INSTRUCTION_OTHER".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/consumer_report_user_identity.rb b/lib/plaid/models/consumer_report_user_identity.rb deleted file mode 100644 index 223656898..000000000 --- a/lib/plaid/models/consumer_report_user_identity.rb +++ /dev/null @@ -1,289 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class ConsumerReportUserIdentity - # The user's first name - attr_accessor :first_name - - # The user's last name - attr_accessor :last_name - - # 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`. - attr_accessor :phone_numbers - - # The user's emails - attr_accessor :emails - - attr_accessor :primary_address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'first_name' => :'first_name', - :'last_name' => :'last_name', - :'phone_numbers' => :'phone_numbers', - :'emails' => :'emails', - :'primary_address' => :'primary_address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'first_name' => :'String', - :'last_name' => :'String', - :'phone_numbers' => :'Array', - :'emails' => :'Array', - :'primary_address' => :'AddressData' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ConsumerReportUserIdentity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ConsumerReportUserIdentity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - end - - if attributes.key?(:'last_name') - self.last_name = attributes[:'last_name'] - end - - if attributes.key?(:'phone_numbers') - if (value = attributes[:'phone_numbers']).is_a?(Array) - self.phone_numbers = value - end - end - - if attributes.key?(:'emails') - if (value = attributes[:'emails']).is_a?(Array) - self.emails = value - end - end - - if attributes.key?(:'primary_address') - self.primary_address = attributes[:'primary_address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @first_name.nil? - invalid_properties.push('invalid value for "first_name", first_name cannot be nil.') - end - - if @last_name.nil? - invalid_properties.push('invalid value for "last_name", last_name cannot be nil.') - end - - if @phone_numbers.nil? - invalid_properties.push('invalid value for "phone_numbers", phone_numbers cannot be nil.') - end - - if @emails.nil? - invalid_properties.push('invalid value for "emails", emails cannot be nil.') - end - - if @primary_address.nil? - invalid_properties.push('invalid value for "primary_address", primary_address cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @first_name.nil? - return false if @last_name.nil? - return false if @phone_numbers.nil? - return false if @emails.nil? - return false if @primary_address.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - first_name == o.first_name && - last_name == o.last_name && - phone_numbers == o.phone_numbers && - emails == o.emails && - primary_address == o.primary_address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [first_name, last_name, phone_numbers, emails, primary_address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/counterparty.rb b/lib/plaid/models/counterparty.rb deleted file mode 100644 index 4f71141e2..000000000 --- a/lib/plaid/models/counterparty.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The counterparty, such as the merchant or financial institution, is extracted by Plaid from the raw description. - class Counterparty - # The name of the counterparty, such as the merchant or the financial institution, as extracted by Plaid from the raw description. - attr_accessor :name - - # A unique, stable, Plaid-generated ID that maps to the counterparty. - attr_accessor :entity_id - - attr_accessor :type - - # The website associated with the counterparty. - attr_accessor :website - - # The URL of a logo associated with the counterparty, if available. The logo will always be 100×100 pixel PNG file. - attr_accessor :logo_url - - # A description of how confident we are that the provided counterparty is involved in the transaction. `VERY_HIGH`: We recognize this counterparty and we are more than 98% confident that it is involved in this transaction. `HIGH`: We recognize this counterparty and we are more than 90% confident that it is involved in this transaction. `MEDIUM`: We are moderately confident that this counterparty was involved in this transaction, but some details may differ from our records. `LOW`: We didn’t find a matching counterparty in our records, so we are returning a cleansed name parsed out of the request description. `UNKNOWN`: We don’t know the confidence level for this counterparty. - attr_accessor :confidence_level - - # 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. - attr_accessor :phone_number - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'entity_id' => :'entity_id', - :'type' => :'type', - :'website' => :'website', - :'logo_url' => :'logo_url', - :'confidence_level' => :'confidence_level', - :'phone_number' => :'phone_number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'entity_id' => :'String', - :'type' => :'CounterpartyType', - :'website' => :'String', - :'logo_url' => :'String', - :'confidence_level' => :'String', - :'phone_number' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'entity_id', - :'website', - :'logo_url', - :'confidence_level', - :'phone_number' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Counterparty` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Counterparty`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'entity_id') - self.entity_id = attributes[:'entity_id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'website') - self.website = attributes[:'website'] - end - - if attributes.key?(:'logo_url') - self.logo_url = attributes[:'logo_url'] - end - - if attributes.key?(:'confidence_level') - self.confidence_level = attributes[:'confidence_level'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - entity_id == o.entity_id && - type == o.type && - website == o.website && - logo_url == o.logo_url && - confidence_level == o.confidence_level && - phone_number == o.phone_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, entity_id, type, website, logo_url, confidence_level, phone_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/counterparty_insights.rb b/lib/plaid/models/counterparty_insights.rb deleted file mode 100644 index 91c01008d..000000000 --- a/lib/plaid/models/counterparty_insights.rb +++ /dev/null @@ -1,235 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Insights around a user's counterparties - class CounterpartyInsights - # Insights related to a user’s transactions with other financial institutions, including detected account types. - attr_accessor :financial_institution_insights - - # Insights about a user’s top merchants, ranked by spend. - attr_accessor :merchant_insights - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'financial_institution_insights' => :'financial_institution_insights', - :'merchant_insights' => :'merchant_insights' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'financial_institution_insights' => :'Array', - :'merchant_insights' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CounterpartyInsights` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CounterpartyInsights`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'financial_institution_insights') - if (value = attributes[:'financial_institution_insights']).is_a?(Array) - self.financial_institution_insights = value - end - end - - if attributes.key?(:'merchant_insights') - if (value = attributes[:'merchant_insights']).is_a?(Array) - self.merchant_insights = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - financial_institution_insights == o.financial_institution_insights && - merchant_insights == o.merchant_insights - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [financial_institution_insights, merchant_insights].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/counterparty_type.rb b/lib/plaid/models/counterparty_type.rb deleted file mode 100644 index 4296eb45d..000000000 --- a/lib/plaid/models/counterparty_type.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CounterpartyType - MERCHANT = "merchant".freeze - FINANCIAL_INSTITUTION = "financial_institution".freeze - PAYMENT_APP = "payment_app".freeze - MARKETPLACE = "marketplace".freeze - PAYMENT_TERMINAL = "payment_terminal".freeze - INCOME_SOURCE = "income_source".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/country_code.rb b/lib/plaid/models/country_code.rb deleted file mode 100644 index 9eae9db86..000000000 --- a/lib/plaid/models/country_code.rb +++ /dev/null @@ -1,55 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CountryCode - US = "US".freeze - GB = "GB".freeze - ES = "ES".freeze - NL = "NL".freeze - FR = "FR".freeze - IE = "IE".freeze - CA = "CA".freeze - DE = "DE".freeze - IT = "IT".freeze - PL = "PL".freeze - DK = "DK".freeze - NO = "NO".freeze - SE = "SE".freeze - EE = "EE".freeze - LT = "LT".freeze - LV = "LV".freeze - PT = "PT".freeze - BE = "BE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/cra_bank_income.rb b/lib/plaid/models/cra_bank_income.rb deleted file mode 100644 index abf669dc2..000000000 --- a/lib/plaid/models/cra_bank_income.rb +++ /dev/null @@ -1,274 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The report of the Bank Income data for an end user. - class CraBankIncome - # The unique identifier associated with the Bank Income Report. - attr_accessor :bank_income_id - - # The time when the Bank Income Report was generated. - attr_accessor :generated_time - - # The number of days requested by the customer for the Bank Income Report. - attr_accessor :days_requested - - # The list of Items in the report along with the associated metadata about the Item. - attr_accessor :items - - attr_accessor :bank_income_summary - - # 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. - attr_accessor :warnings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_income_id' => :'bank_income_id', - :'generated_time' => :'generated_time', - :'days_requested' => :'days_requested', - :'items' => :'items', - :'bank_income_summary' => :'bank_income_summary', - :'warnings' => :'warnings' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_income_id' => :'String', - :'generated_time' => :'Time', - :'days_requested' => :'Integer', - :'items' => :'Array', - :'bank_income_summary' => :'CraBankIncomeSummary', - :'warnings' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraBankIncome` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraBankIncome`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_income_id') - self.bank_income_id = attributes[:'bank_income_id'] - end - - if attributes.key?(:'generated_time') - self.generated_time = attributes[:'generated_time'] - end - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - - if attributes.key?(:'bank_income_summary') - self.bank_income_summary = attributes[:'bank_income_summary'] - end - - if attributes.key?(:'warnings') - if (value = attributes[:'warnings']).is_a?(Array) - self.warnings = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_income_id == o.bank_income_id && - generated_time == o.generated_time && - days_requested == o.days_requested && - items == o.items && - bank_income_summary == o.bank_income_summary && - warnings == o.warnings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_income_id, generated_time, days_requested, items, bank_income_summary, warnings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_bank_income_account.rb b/lib/plaid/models/cra_bank_income_account.rb deleted file mode 100644 index 8a1f5d837..000000000 --- a/lib/plaid/models/cra_bank_income_account.rb +++ /dev/null @@ -1,315 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The Item's bank accounts that have the selected data. - class CraBankIncomeAccount - # 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. - attr_accessor :mask - - # The name of the bank account. - attr_accessor :name - - # The official name of the bank account. - attr_accessor :official_name - - attr_accessor :subtype - - attr_accessor :type - - # Data returned by the financial institution about the account owner or owners. Identity information is optional, so field may return an empty array. - attr_accessor :owners - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'mask' => :'mask', - :'name' => :'name', - :'official_name' => :'official_name', - :'subtype' => :'subtype', - :'type' => :'type', - :'owners' => :'owners' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'mask' => :'String', - :'name' => :'String', - :'official_name' => :'String', - :'subtype' => :'DepositoryAccountSubtype', - :'type' => :'CreditBankIncomeAccountType', - :'owners' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'mask', - :'official_name', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraBankIncomeAccount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraBankIncomeAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'mask') - self.mask = attributes[:'mask'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'official_name') - self.official_name = attributes[:'official_name'] - end - - if attributes.key?(:'subtype') - self.subtype = attributes[:'subtype'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'owners') - if (value = attributes[:'owners']).is_a?(Array) - self.owners = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @subtype.nil? - invalid_properties.push('invalid value for "subtype", subtype cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @owners.nil? - invalid_properties.push('invalid value for "owners", owners cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @subtype.nil? - return false if @type.nil? - return false if @owners.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - mask == o.mask && - name == o.name && - official_name == o.official_name && - subtype == o.subtype && - type == o.type && - owners == o.owners - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [mask, name, official_name, subtype, type, owners].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_bank_income_cause.rb b/lib/plaid/models/cra_bank_income_cause.rb deleted file mode 100644 index ddb88f464..000000000 --- a/lib/plaid/models/cra_bank_income_cause.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class CraBankIncomeCause - attr_accessor :error_type - - # 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. Error fields will be `null` if no error has occurred. - attr_accessor :error_code - - # A developer-friendly representation of the error code. This may change over time and is not safe for programmatic use. - attr_accessor :error_message - - # 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. - attr_accessor :display_message - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'error_type' => :'error_type', - :'error_code' => :'error_code', - :'error_message' => :'error_message', - :'display_message' => :'display_message' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'error_type' => :'CreditBankIncomeErrorType', - :'error_code' => :'String', - :'error_message' => :'String', - :'display_message' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraBankIncomeCause` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraBankIncomeCause`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'error_type') - self.error_type = attributes[:'error_type'] - end - - if attributes.key?(:'error_code') - self.error_code = attributes[:'error_code'] - end - - if attributes.key?(:'error_message') - self.error_message = attributes[:'error_message'] - end - - if attributes.key?(:'display_message') - self.display_message = attributes[:'display_message'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @error_type.nil? - invalid_properties.push('invalid value for "error_type", error_type cannot be nil.') - end - - if @error_code.nil? - invalid_properties.push('invalid value for "error_code", error_code cannot be nil.') - end - - if @error_message.nil? - invalid_properties.push('invalid value for "error_message", error_message cannot be nil.') - end - - if @display_message.nil? - invalid_properties.push('invalid value for "display_message", display_message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @error_type.nil? - return false if @error_code.nil? - return false if @error_message.nil? - return false if @display_message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - error_type == o.error_type && - error_code == o.error_code && - error_message == o.error_message && - display_message == o.display_message - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [error_type, error_code, error_message, display_message].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_bank_income_complete_result.rb b/lib/plaid/models/cra_bank_income_complete_result.rb deleted file mode 100644 index 594b8af3d..000000000 --- a/lib/plaid/models/cra_bank_income_complete_result.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CraBankIncomeCompleteResult - SUCCESS = "SUCCESS".freeze - FAILURE = "FAILURE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/cra_bank_income_complete_webhook.rb b/lib/plaid/models/cra_bank_income_complete_webhook.rb deleted file mode 100644 index 1349636b8..000000000 --- a/lib/plaid/models/cra_bank_income_complete_webhook.rb +++ /dev/null @@ -1,306 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when a bank income report has finished generating or failed to generate, triggered by calling `/cra/bank_income/get`. - class CraBankIncomeCompleteWebhook - # `CRA_INCOME` - attr_accessor :webhook_type - - # `BANK_INCOME_COMPLETE` - attr_accessor :webhook_code - - # The `user_id` corresponding to the user the webhook has fired for. - attr_accessor :user_id - - attr_accessor :result - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'user_id' => :'user_id', - :'result' => :'result', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'user_id' => :'String', - :'result' => :'CraBankIncomeCompleteResult', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraBankIncomeCompleteWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraBankIncomeCompleteWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'result') - self.result = attributes[:'result'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @user_id.nil? - invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') - end - - if @result.nil? - invalid_properties.push('invalid value for "result", result cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @user_id.nil? - return false if @result.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - user_id == o.user_id && - result == o.result && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, user_id, result, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_bank_income_employer.rb b/lib/plaid/models/cra_bank_income_employer.rb deleted file mode 100644 index 8c750b250..000000000 --- a/lib/plaid/models/cra_bank_income_employer.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The object containing employer data. - class CraBankIncomeEmployer - # The name of the employer. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraBankIncomeEmployer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraBankIncomeEmployer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_bank_income_get_request.rb b/lib/plaid/models/cra_bank_income_get_request.rb deleted file mode 100644 index 775e00a52..000000000 --- a/lib/plaid/models/cra_bank_income_get_request.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CraBankIncomeGetRequest defines the request schema for `/cra/bank_income/get`. - class CraBankIncomeGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraBankIncomeGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraBankIncomeGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_bank_income_get_response.rb b/lib/plaid/models/cra_bank_income_get_response.rb deleted file mode 100644 index a83247638..000000000 --- a/lib/plaid/models/cra_bank_income_get_response.rb +++ /dev/null @@ -1,237 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CraBankIncomeGetResponse defines the response schema for `/cra/bank_income/get`. - class CraBankIncomeGetResponse - attr_accessor :bank_income - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_income' => :'bank_income', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_income' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraBankIncomeGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraBankIncomeGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_income') - if (value = attributes[:'bank_income']).is_a?(Array) - self.bank_income = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_income == o.bank_income && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_income, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_bank_income_historical_summary.rb b/lib/plaid/models/cra_bank_income_historical_summary.rb deleted file mode 100644 index 8cea8e7bc..000000000 --- a/lib/plaid/models/cra_bank_income_historical_summary.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The end user's monthly summary for the income source(s). - class CraBankIncomeHistoricalSummary - # Total amount of earnings for the income source(s) of the user for the month in the summary. This can contain multiple amounts, with each amount denominated in one unique currency. - attr_accessor :total_amounts - - # The start date of the period covered in this monthly summary. This date will be the first day of the month, unless the month being covered is a partial month because it is the first month included in the summary and the date range being requested does not begin with the first day of the month. The date will be returned in an ISO 8601 format (YYYY-MM-DD). - attr_accessor :start_date - - # The end date of the period included in this monthly summary. This date will be the last day of the month, unless the month being covered is a partial month because it is the last month included in the summary and the date range being requested does not end with the last day of the month. The date will be returned in an ISO 8601 format (YYYY-MM-DD). - attr_accessor :end_date - - attr_accessor :transactions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_amounts' => :'total_amounts', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'transactions' => :'transactions' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_amounts' => :'Array', - :'start_date' => :'Date', - :'end_date' => :'Date', - :'transactions' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraBankIncomeHistoricalSummary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraBankIncomeHistoricalSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_amounts') - if (value = attributes[:'total_amounts']).is_a?(Array) - self.total_amounts = value - end - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'transactions') - if (value = attributes[:'transactions']).is_a?(Array) - self.transactions = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_amounts == o.total_amounts && - start_date == o.start_date && - end_date == o.end_date && - transactions == o.transactions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_amounts, start_date, end_date, transactions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_bank_income_item.rb b/lib/plaid/models/cra_bank_income_item.rb deleted file mode 100644 index 61e6c2a8f..000000000 --- a/lib/plaid/models/cra_bank_income_item.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The details and metadata for an end user's Item. - class CraBankIncomeItem - # The Item's accounts that have Bank Income data. - attr_accessor :bank_income_accounts - - # The income sources for this Item. Each entry in the array is a single income source. - attr_accessor :bank_income_sources - - # The time when this Item's data was last retrieved from the financial institution. - attr_accessor :last_updated_time - - # The unique identifier of the institution associated with the Item. - attr_accessor :institution_id - - # The name of the institution associated with the Item. - attr_accessor :institution_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_income_accounts' => :'bank_income_accounts', - :'bank_income_sources' => :'bank_income_sources', - :'last_updated_time' => :'last_updated_time', - :'institution_id' => :'institution_id', - :'institution_name' => :'institution_name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_income_accounts' => :'Array', - :'bank_income_sources' => :'Array', - :'last_updated_time' => :'Time', - :'institution_id' => :'String', - :'institution_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraBankIncomeItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraBankIncomeItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_income_accounts') - if (value = attributes[:'bank_income_accounts']).is_a?(Array) - self.bank_income_accounts = value - end - end - - if attributes.key?(:'bank_income_sources') - if (value = attributes[:'bank_income_sources']).is_a?(Array) - self.bank_income_sources = value - end - end - - if attributes.key?(:'last_updated_time') - self.last_updated_time = attributes[:'last_updated_time'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'institution_name') - self.institution_name = attributes[:'institution_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @bank_income_accounts.nil? - invalid_properties.push('invalid value for "bank_income_accounts", bank_income_accounts cannot be nil.') - end - - if @bank_income_sources.nil? - invalid_properties.push('invalid value for "bank_income_sources", bank_income_sources cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @bank_income_accounts.nil? - return false if @bank_income_sources.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_income_accounts == o.bank_income_accounts && - bank_income_sources == o.bank_income_sources && - last_updated_time == o.last_updated_time && - institution_id == o.institution_id && - institution_name == o.institution_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_income_accounts, bank_income_sources, last_updated_time, institution_id, institution_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_bank_income_source.rb b/lib/plaid/models/cra_bank_income_source.rb deleted file mode 100644 index 1986be450..000000000 --- a/lib/plaid/models/cra_bank_income_source.rb +++ /dev/null @@ -1,414 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Detailed information for the income source. - class CraBankIncomeSource - # A unique identifier for an income source. - attr_accessor :income_source_id - - # The most common name or original description for the underlying income transactions. - attr_accessor :income_description - - attr_accessor :income_category - - # 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). - attr_accessor :start_date - - # Maximum 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). - attr_accessor :end_date - - attr_accessor :pay_frequency - - # Total amount of earnings in the user’s bank account for the specific income source for days requested by the client. - attr_accessor :total_amount - - # The ISO 4217 currency code of the amount or balance. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - # Number of transactions for the income source within the start and end date. - attr_accessor :transaction_count - - # The expected date of the end user’s next paycheck for the income source. The date will be returned in an ISO 8601 format (YYYY-MM-DD). - attr_accessor :next_payment_date - - # An estimate of the average gross monthly income based on the historical net amount and income category for the income source(s). - attr_accessor :historical_average_monthly_gross_income - - # The average monthly net income amount estimated based on the historical data for the income source(s). - attr_accessor :historical_average_monthly_income - - # The predicted average monthly net income amount for the income source(s). - attr_accessor :forecasted_average_monthly_income - - # The prediction interval(s) for the forecasted average monthly income. - attr_accessor :forecasted_average_monthly_income_prediction_interval - - attr_accessor :employer - - attr_accessor :historical_summary - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'income_source_id' => :'income_source_id', - :'income_description' => :'income_description', - :'income_category' => :'income_category', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'pay_frequency' => :'pay_frequency', - :'total_amount' => :'total_amount', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'transaction_count' => :'transaction_count', - :'next_payment_date' => :'next_payment_date', - :'historical_average_monthly_gross_income' => :'historical_average_monthly_gross_income', - :'historical_average_monthly_income' => :'historical_average_monthly_income', - :'forecasted_average_monthly_income' => :'forecasted_average_monthly_income', - :'forecasted_average_monthly_income_prediction_interval' => :'forecasted_average_monthly_income_prediction_interval', - :'employer' => :'employer', - :'historical_summary' => :'historical_summary' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'income_source_id' => :'String', - :'income_description' => :'String', - :'income_category' => :'CreditBankIncomeCategory', - :'start_date' => :'Date', - :'end_date' => :'Date', - :'pay_frequency' => :'CreditBankIncomePayFrequency', - :'total_amount' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'transaction_count' => :'Integer', - :'next_payment_date' => :'Date', - :'historical_average_monthly_gross_income' => :'Float', - :'historical_average_monthly_income' => :'Float', - :'forecasted_average_monthly_income' => :'Float', - :'forecasted_average_monthly_income_prediction_interval' => :'Array', - :'employer' => :'CraBankIncomeEmployer', - :'historical_summary' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'iso_currency_code', - :'unofficial_currency_code', - :'next_payment_date', - :'historical_average_monthly_gross_income', - :'historical_average_monthly_income', - :'forecasted_average_monthly_income', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraBankIncomeSource` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraBankIncomeSource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'income_source_id') - self.income_source_id = attributes[:'income_source_id'] - end - - if attributes.key?(:'income_description') - self.income_description = attributes[:'income_description'] - end - - if attributes.key?(:'income_category') - self.income_category = attributes[:'income_category'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'pay_frequency') - self.pay_frequency = attributes[:'pay_frequency'] - end - - if attributes.key?(:'total_amount') - self.total_amount = attributes[:'total_amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'transaction_count') - self.transaction_count = attributes[:'transaction_count'] - end - - if attributes.key?(:'next_payment_date') - self.next_payment_date = attributes[:'next_payment_date'] - end - - if attributes.key?(:'historical_average_monthly_gross_income') - self.historical_average_monthly_gross_income = attributes[:'historical_average_monthly_gross_income'] - end - - if attributes.key?(:'historical_average_monthly_income') - self.historical_average_monthly_income = attributes[:'historical_average_monthly_income'] - end - - if attributes.key?(:'forecasted_average_monthly_income') - self.forecasted_average_monthly_income = attributes[:'forecasted_average_monthly_income'] - end - - if attributes.key?(:'forecasted_average_monthly_income_prediction_interval') - if (value = attributes[:'forecasted_average_monthly_income_prediction_interval']).is_a?(Array) - self.forecasted_average_monthly_income_prediction_interval = value - end - end - - if attributes.key?(:'employer') - self.employer = attributes[:'employer'] - end - - if attributes.key?(:'historical_summary') - if (value = attributes[:'historical_summary']).is_a?(Array) - self.historical_summary = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @forecasted_average_monthly_income_prediction_interval.nil? - invalid_properties.push('invalid value for "forecasted_average_monthly_income_prediction_interval", forecasted_average_monthly_income_prediction_interval cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @forecasted_average_monthly_income_prediction_interval.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - income_source_id == o.income_source_id && - income_description == o.income_description && - income_category == o.income_category && - start_date == o.start_date && - end_date == o.end_date && - pay_frequency == o.pay_frequency && - total_amount == o.total_amount && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - transaction_count == o.transaction_count && - next_payment_date == o.next_payment_date && - historical_average_monthly_gross_income == o.historical_average_monthly_gross_income && - historical_average_monthly_income == o.historical_average_monthly_income && - forecasted_average_monthly_income == o.forecasted_average_monthly_income && - forecasted_average_monthly_income_prediction_interval == o.forecasted_average_monthly_income_prediction_interval && - employer == o.employer && - historical_summary == o.historical_summary - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [income_source_id, income_description, income_category, start_date, end_date, pay_frequency, total_amount, iso_currency_code, unofficial_currency_code, transaction_count, next_payment_date, historical_average_monthly_gross_income, historical_average_monthly_income, forecasted_average_monthly_income, forecasted_average_monthly_income_prediction_interval, employer, historical_summary].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_bank_income_summary.rb b/lib/plaid/models/cra_bank_income_summary.rb deleted file mode 100644 index f4f307888..000000000 --- a/lib/plaid/models/cra_bank_income_summary.rb +++ /dev/null @@ -1,320 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Summary for bank income across all income sources and items (max history of 730 days). - class CraBankIncomeSummary - # Total amount of earnings across all the income sources in the end user's Items for the days requested by the client. This can contain multiple amounts, with each amount denominated in one unique currency. - attr_accessor :total_amounts - - # The earliest date within the days requested in which all income sources identified by Plaid appear in a user's account. The date will be returned in an ISO 8601 format (YYYY-MM-DD). - attr_accessor :start_date - - # 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). - attr_accessor :end_date - - # Number of income sources per end user. - attr_accessor :income_sources_count - - # Number of income categories per end user. - attr_accessor :income_categories_count - - # Number of income transactions per end user. - attr_accessor :income_transactions_count - - # An estimate of the average gross monthly income based on the historical net amount and income category for the income source(s). - attr_accessor :historical_average_monthly_gross_income - - # The average monthly income amount estimated based on the historical data for the income source(s). - attr_accessor :historical_average_monthly_income - - # The predicted average monthly income amount for the income source(s). - attr_accessor :forecasted_average_monthly_income - - attr_accessor :historical_summary - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_amounts' => :'total_amounts', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'income_sources_count' => :'income_sources_count', - :'income_categories_count' => :'income_categories_count', - :'income_transactions_count' => :'income_transactions_count', - :'historical_average_monthly_gross_income' => :'historical_average_monthly_gross_income', - :'historical_average_monthly_income' => :'historical_average_monthly_income', - :'forecasted_average_monthly_income' => :'forecasted_average_monthly_income', - :'historical_summary' => :'historical_summary' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_amounts' => :'Array', - :'start_date' => :'Date', - :'end_date' => :'Date', - :'income_sources_count' => :'Integer', - :'income_categories_count' => :'Integer', - :'income_transactions_count' => :'Integer', - :'historical_average_monthly_gross_income' => :'Array', - :'historical_average_monthly_income' => :'Array', - :'forecasted_average_monthly_income' => :'Array', - :'historical_summary' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraBankIncomeSummary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraBankIncomeSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_amounts') - if (value = attributes[:'total_amounts']).is_a?(Array) - self.total_amounts = value - end - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'income_sources_count') - self.income_sources_count = attributes[:'income_sources_count'] - end - - if attributes.key?(:'income_categories_count') - self.income_categories_count = attributes[:'income_categories_count'] - end - - if attributes.key?(:'income_transactions_count') - self.income_transactions_count = attributes[:'income_transactions_count'] - end - - if attributes.key?(:'historical_average_monthly_gross_income') - if (value = attributes[:'historical_average_monthly_gross_income']).is_a?(Array) - self.historical_average_monthly_gross_income = value - end - end - - if attributes.key?(:'historical_average_monthly_income') - if (value = attributes[:'historical_average_monthly_income']).is_a?(Array) - self.historical_average_monthly_income = value - end - end - - if attributes.key?(:'forecasted_average_monthly_income') - if (value = attributes[:'forecasted_average_monthly_income']).is_a?(Array) - self.forecasted_average_monthly_income = value - end - end - - if attributes.key?(:'historical_summary') - if (value = attributes[:'historical_summary']).is_a?(Array) - self.historical_summary = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_amounts == o.total_amounts && - start_date == o.start_date && - end_date == o.end_date && - income_sources_count == o.income_sources_count && - income_categories_count == o.income_categories_count && - income_transactions_count == o.income_transactions_count && - historical_average_monthly_gross_income == o.historical_average_monthly_gross_income && - historical_average_monthly_income == o.historical_average_monthly_income && - forecasted_average_monthly_income == o.forecasted_average_monthly_income && - historical_summary == o.historical_summary - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_amounts, start_date, end_date, income_sources_count, income_categories_count, income_transactions_count, historical_average_monthly_gross_income, historical_average_monthly_income, forecasted_average_monthly_income, historical_summary].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_bank_income_transaction.rb b/lib/plaid/models/cra_bank_income_transaction.rb deleted file mode 100644 index f5639b570..000000000 --- a/lib/plaid/models/cra_bank_income_transaction.rb +++ /dev/null @@ -1,295 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The transactions data for the end user's income source(s). - class CraBankIncomeTransaction - # 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, credit card purchases are positive; credit card payment, direct deposits, and refunds are negative. - attr_accessor :amount - - # 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). - attr_accessor :date - - # The merchant name or transaction description. - attr_accessor :name - - # The string returned by the financial institution to describe the transaction. - attr_accessor :original_description - - # When true, identifies the transaction as pending or unsettled. Pending transaction details (name, type, amount, category ID) may change before they are settled. - attr_accessor :pending - - # The check number of the transaction. This field is only populated for check transactions. - attr_accessor :check_number - - # The ISO 4217 currency code of the amount or balance. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'date' => :'date', - :'name' => :'name', - :'original_description' => :'original_description', - :'pending' => :'pending', - :'check_number' => :'check_number', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Float', - :'date' => :'Date', - :'name' => :'String', - :'original_description' => :'String', - :'pending' => :'Boolean', - :'check_number' => :'String', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'original_description', - :'check_number', - :'iso_currency_code', - :'unofficial_currency_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraBankIncomeTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraBankIncomeTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'original_description') - self.original_description = attributes[:'original_description'] - end - - if attributes.key?(:'pending') - self.pending = attributes[:'pending'] - end - - if attributes.key?(:'check_number') - self.check_number = attributes[:'check_number'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - date == o.date && - name == o.name && - original_description == o.original_description && - pending == o.pending && - check_number == o.check_number && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, date, name, original_description, pending, check_number, iso_currency_code, unofficial_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_bank_income_warning.rb b/lib/plaid/models/cra_bank_income_warning.rb deleted file mode 100644 index 4f83941c6..000000000 --- a/lib/plaid/models/cra_bank_income_warning.rb +++ /dev/null @@ -1,260 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The warning associated with the data that was unavailable for the Bank Income Report. - class CraBankIncomeWarning - attr_accessor :warning_type - - attr_accessor :warning_code - - attr_accessor :cause - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'warning_type' => :'warning_type', - :'warning_code' => :'warning_code', - :'cause' => :'cause' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'warning_type' => :'CreditBankIncomeWarningType', - :'warning_code' => :'CraBankIncomeWarningCode', - :'cause' => :'CraBankIncomeCause' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraBankIncomeWarning` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraBankIncomeWarning`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'warning_type') - self.warning_type = attributes[:'warning_type'] - end - - if attributes.key?(:'warning_code') - self.warning_code = attributes[:'warning_code'] - end - - if attributes.key?(:'cause') - self.cause = attributes[:'cause'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - warning_type == o.warning_type && - warning_code == o.warning_code && - cause == o.cause - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [warning_type, warning_code, cause].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_bank_income_warning_code.rb b/lib/plaid/models/cra_bank_income_warning_code.rb deleted file mode 100644 index 8ebb4bc00..000000000 --- a/lib/plaid/models/cra_bank_income_warning_code.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CraBankIncomeWarningCode - IDENTITY_UNAVAILABLE = "IDENTITY_UNAVAILABLE".freeze - TRANSACTIONS_UNAVAILABLE = "TRANSACTIONS_UNAVAILABLE".freeze - REPORT_DELETED = "REPORT_DELETED".freeze - DATA_UNAVAILABLE = "DATA_UNAVAILABLE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/cra_partner_insights.rb b/lib/plaid/models/cra_partner_insights.rb deleted file mode 100644 index 2a61c5def..000000000 --- a/lib/plaid/models/cra_partner_insights.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The partner insights report of the bank data for an end user. - class CraPartnerInsights - # A unique identifier associated with the Partner Insights object. - attr_accessor :report_id - - # The time when the partner insights report was generated. - attr_accessor :generated_time - - attr_accessor :prism - - # The list of Items used in the report along with the associated metadata about the Item. - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report_id' => :'report_id', - :'generated_time' => :'generated_time', - :'prism' => :'prism', - :'items' => :'items' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'report_id' => :'String', - :'generated_time' => :'Time', - :'prism' => :'CraPartnerInsightsPrism', - :'items' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraPartnerInsights` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraPartnerInsights`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report_id') - self.report_id = attributes[:'report_id'] - end - - if attributes.key?(:'generated_time') - self.generated_time = attributes[:'generated_time'] - end - - if attributes.key?(:'prism') - self.prism = attributes[:'prism'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report_id == o.report_id && - generated_time == o.generated_time && - prism == o.prism && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report_id, generated_time, prism, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_partner_insights_complete_result.rb b/lib/plaid/models/cra_partner_insights_complete_result.rb deleted file mode 100644 index 1c14d6712..000000000 --- a/lib/plaid/models/cra_partner_insights_complete_result.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CraPartnerInsightsCompleteResult - SUCCESS = "SUCCESS".freeze - FAILURE = "FAILURE".freeze - PARTIAL_SUCCESS = "PARTIAL_SUCCESS".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/cra_partner_insights_complete_webhook.rb b/lib/plaid/models/cra_partner_insights_complete_webhook.rb deleted file mode 100644 index 84414045d..000000000 --- a/lib/plaid/models/cra_partner_insights_complete_webhook.rb +++ /dev/null @@ -1,306 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when a partner insights report has finished generating or failed to generate. - class CraPartnerInsightsCompleteWebhook - # `CRA_INSIGHTS` - attr_accessor :webhook_type - - # `PARTNER_INSIGHTS_COMPLETE` - attr_accessor :webhook_code - - # The `user_id` corresponding to the user the webhook has fired for. - attr_accessor :user_id - - attr_accessor :result - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'user_id' => :'user_id', - :'result' => :'result', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'user_id' => :'String', - :'result' => :'CraPartnerInsightsCompleteResult', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraPartnerInsightsCompleteWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraPartnerInsightsCompleteWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'result') - self.result = attributes[:'result'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @user_id.nil? - invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') - end - - if @result.nil? - invalid_properties.push('invalid value for "result", result cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @user_id.nil? - return false if @result.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - user_id == o.user_id && - result == o.result && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, user_id, result, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_partner_insights_get_request.rb b/lib/plaid/models/cra_partner_insights_get_request.rb deleted file mode 100644 index ba96ae19d..000000000 --- a/lib/plaid/models/cra_partner_insights_get_request.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CraPartnerInsightsGetRequest defines the request schema for `/cra/partner_insights/get`. - class CraPartnerInsightsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraPartnerInsightsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraPartnerInsightsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_partner_insights_get_response.rb b/lib/plaid/models/cra_partner_insights_get_response.rb deleted file mode 100644 index 99ff2b566..000000000 --- a/lib/plaid/models/cra_partner_insights_get_response.rb +++ /dev/null @@ -1,237 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CraPartnerInsightsGetResponse defines the response schema for `/cra/partner_insights/get`. - class CraPartnerInsightsGetResponse - attr_accessor :report - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report' => :'report', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'report' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraPartnerInsightsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraPartnerInsightsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report') - if (value = attributes[:'report']).is_a?(Array) - self.report = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report == o.report && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_partner_insights_item.rb b/lib/plaid/models/cra_partner_insights_item.rb deleted file mode 100644 index 2143125db..000000000 --- a/lib/plaid/models/cra_partner_insights_item.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The details and metadata for an end user's Item. - class CraPartnerInsightsItem - # The ID for the institution that the user linked. - attr_accessor :institution_id - - # The name of the institution the user linked. - attr_accessor :institution_name - - # The identifier for the item. - attr_accessor :item_id - - # A list of accounts in the item - attr_accessor :accounts - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'institution_id' => :'institution_id', - :'institution_name' => :'institution_name', - :'item_id' => :'item_id', - :'accounts' => :'accounts' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'institution_id' => :'String', - :'institution_name' => :'String', - :'item_id' => :'String', - :'accounts' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraPartnerInsightsItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraPartnerInsightsItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'institution_name') - self.institution_name = attributes[:'institution_name'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - institution_id == o.institution_id && - institution_name == o.institution_name && - item_id == o.item_id && - accounts == o.accounts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [institution_id, institution_name, item_id, accounts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_partner_insights_item_account.rb b/lib/plaid/models/cra_partner_insights_item_account.rb deleted file mode 100644 index 0eee4e711..000000000 --- a/lib/plaid/models/cra_partner_insights_item_account.rb +++ /dev/null @@ -1,315 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Account data corresponding to the item from which Partner Insights were generated from - class CraPartnerInsightsItemAccount - # 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. - attr_accessor :mask - - # The name of the account - attr_accessor :name - - # The official name of the bank account. - attr_accessor :official_name - - attr_accessor :subtype - - attr_accessor :type - - # Data returned by the financial institution about the account owner or owners. Identity information is optional, so field may return an empty array. - attr_accessor :owners - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'mask' => :'mask', - :'name' => :'name', - :'official_name' => :'official_name', - :'subtype' => :'subtype', - :'type' => :'type', - :'owners' => :'owners' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'mask' => :'String', - :'name' => :'String', - :'official_name' => :'String', - :'subtype' => :'DepositoryAccountSubtype', - :'type' => :'CreditBankIncomeAccountType', - :'owners' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'mask', - :'official_name', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraPartnerInsightsItemAccount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraPartnerInsightsItemAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'mask') - self.mask = attributes[:'mask'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'official_name') - self.official_name = attributes[:'official_name'] - end - - if attributes.key?(:'subtype') - self.subtype = attributes[:'subtype'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'owners') - if (value = attributes[:'owners']).is_a?(Array) - self.owners = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @subtype.nil? - invalid_properties.push('invalid value for "subtype", subtype cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @owners.nil? - invalid_properties.push('invalid value for "owners", owners cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @subtype.nil? - return false if @type.nil? - return false if @owners.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - mask == o.mask && - name == o.name && - official_name == o.official_name && - subtype == o.subtype && - type == o.type && - owners == o.owners - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [mask, name, official_name, subtype, type, owners].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_partner_insights_prism.rb b/lib/plaid/models/cra_partner_insights_prism.rb deleted file mode 100644 index 160513d34..000000000 --- a/lib/plaid/models/cra_partner_insights_prism.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The Prism insights for the user. - class CraPartnerInsightsPrism - attr_accessor :insights - - attr_accessor :cash_score - - attr_accessor :detect - - # Details on whether the Prism attributes succeeded or failed to be generated. - attr_accessor :status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'insights' => :'insights', - :'cash_score' => :'cash_score', - :'detect' => :'detect', - :'status' => :'status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'insights' => :'PrismInsights', - :'cash_score' => :'PrismCashScore', - :'detect' => :'PrismDetect', - :'status' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'insights', - :'cash_score', - :'detect', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraPartnerInsightsPrism` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraPartnerInsightsPrism`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'insights') - self.insights = attributes[:'insights'] - end - - if attributes.key?(:'cash_score') - self.cash_score = attributes[:'cash_score'] - end - - if attributes.key?(:'detect') - self.detect = attributes[:'detect'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - insights == o.insights && - cash_score == o.cash_score && - detect == o.detect && - status == o.status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [insights, cash_score, detect, status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/cra_prediction_interval.rb b/lib/plaid/models/cra_prediction_interval.rb deleted file mode 100644 index 954e5dd11..000000000 --- a/lib/plaid/models/cra_prediction_interval.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The object containing prediction interval data. - class CraPredictionInterval - # The lower bound of the predicted attribute for the given probability. - attr_accessor :lower_bound - - # The upper bound of the predicted attribute for the given probability. - attr_accessor :upper_bound - - # 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. - attr_accessor :probability - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'lower_bound' => :'lower_bound', - :'upper_bound' => :'upper_bound', - :'probability' => :'probability' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'lower_bound' => :'Float', - :'upper_bound' => :'Float', - :'probability' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'lower_bound', - :'upper_bound', - :'probability' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CraPredictionInterval` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CraPredictionInterval`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'lower_bound') - self.lower_bound = attributes[:'lower_bound'] - end - - if attributes.key?(:'upper_bound') - self.upper_bound = attributes[:'upper_bound'] - end - - if attributes.key?(:'probability') - self.probability = attributes[:'probability'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - lower_bound == o.lower_bound && - upper_bound == o.upper_bound && - probability == o.probability - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [lower_bound, upper_bound, probability].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit1099.rb b/lib/plaid/models/credit1099.rb deleted file mode 100644 index 7d12d0102..000000000 --- a/lib/plaid/models/credit1099.rb +++ /dev/null @@ -1,795 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing an end user's 1099 tax form - class Credit1099 - # An identifier of the document referenced by the document metadata. - attr_accessor :document_id - - attr_accessor :document_metadata - - attr_accessor :form_1099_type - - attr_accessor :recipient - - attr_accessor :payer - - attr_accessor :filer - - # Tax year of the tax form. - attr_accessor :tax_year - - # Amount in rent by payer. - attr_accessor :rents - - # Amount in royalties by payer. - attr_accessor :royalties - - # Amount in other income by payer. - attr_accessor :other_income - - # Amount of federal income tax withheld from payer. - attr_accessor :federal_income_tax_withheld - - # Amount of fishing boat proceeds from payer. - attr_accessor :fishing_boat_proceeds - - # Amount of medical and healthcare payments from payer. - attr_accessor :medical_and_healthcare_payments - - # Amount of nonemployee compensation from payer. - attr_accessor :nonemployee_compensation - - # Amount of substitute payments made by payer. - attr_accessor :substitute_payments_in_lieu_of_dividends_or_interest - - # Whether or not payer made direct sales over $5000 of consumer products. - attr_accessor :payer_made_direct_sales_of_5000_or_more_of_consumer_products_to_buyer - - # Amount of crop insurance proceeds. - attr_accessor :crop_insurance_proceeds - - # Amount of golden parachute payments made by payer. - attr_accessor :excess_golden_parachute_payments - - # Amount of gross proceeds paid to an attorney by payer. - attr_accessor :gross_proceeds_paid_to_an_attorney - - # Amount of 409A deferrals earned by payer. - attr_accessor :section_409a_deferrals - - # Amount of 409A income earned by payer. - attr_accessor :section_409a_income - - # Amount of state tax withheld of payer for primary state. - attr_accessor :state_tax_withheld - - # Amount of state tax withheld of payer for secondary state. - attr_accessor :state_tax_withheld_lower - - # Primary state ID. - attr_accessor :payer_state_number - - # Secondary state ID. - attr_accessor :payer_state_number_lower - - # State income reported for primary state. - attr_accessor :state_income - - # State income reported for secondary state. - attr_accessor :state_income_lower - - # One of the values will be provided Payment card Third party network - attr_accessor :transactions_reported - - # Name of the PSE (Payment Settlement Entity). - attr_accessor :pse_name - - # Formatted (XXX) XXX-XXXX. Phone number of the PSE (Payment Settlement Entity). - attr_accessor :pse_telephone_number - - # Gross amount reported. - attr_accessor :gross_amount - - # Amount in card not present transactions. - attr_accessor :card_not_present_transaction - - # Merchant category of filer. - attr_accessor :merchant_category_code - - # Number of payment transactions made. - attr_accessor :number_of_payment_transactions - - # Amount reported for January. - attr_accessor :january_amount - - # Amount reported for February. - attr_accessor :february_amount - - # Amount reported for March. - attr_accessor :march_amount - - # Amount reported for April. - attr_accessor :april_amount - - # Amount reported for May. - attr_accessor :may_amount - - # Amount reported for June. - attr_accessor :june_amount - - # Amount reported for July. - attr_accessor :july_amount - - # Amount reported for August. - attr_accessor :august_amount - - # Amount reported for September. - attr_accessor :september_amount - - # Amount reported for October. - attr_accessor :october_amount - - # Amount reported for November. - attr_accessor :november_amount - - # Amount reported for December. - attr_accessor :december_amount - - # Primary state of business. - attr_accessor :primary_state - - # Secondary state of business. - attr_accessor :secondary_state - - # Primary state ID. - attr_accessor :primary_state_id - - # Secondary state ID. - attr_accessor :secondary_state_id - - # State income tax reported for primary state. - attr_accessor :primary_state_income_tax - - # State income tax reported for secondary state. - attr_accessor :secondary_state_income_tax - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'document_id' => :'document_id', - :'document_metadata' => :'document_metadata', - :'form_1099_type' => :'form_1099_type', - :'recipient' => :'recipient', - :'payer' => :'payer', - :'filer' => :'filer', - :'tax_year' => :'tax_year', - :'rents' => :'rents', - :'royalties' => :'royalties', - :'other_income' => :'other_income', - :'federal_income_tax_withheld' => :'federal_income_tax_withheld', - :'fishing_boat_proceeds' => :'fishing_boat_proceeds', - :'medical_and_healthcare_payments' => :'medical_and_healthcare_payments', - :'nonemployee_compensation' => :'nonemployee_compensation', - :'substitute_payments_in_lieu_of_dividends_or_interest' => :'substitute_payments_in_lieu_of_dividends_or_interest', - :'payer_made_direct_sales_of_5000_or_more_of_consumer_products_to_buyer' => :'payer_made_direct_sales_of_5000_or_more_of_consumer_products_to_buyer', - :'crop_insurance_proceeds' => :'crop_insurance_proceeds', - :'excess_golden_parachute_payments' => :'excess_golden_parachute_payments', - :'gross_proceeds_paid_to_an_attorney' => :'gross_proceeds_paid_to_an_attorney', - :'section_409a_deferrals' => :'section_409a_deferrals', - :'section_409a_income' => :'section_409a_income', - :'state_tax_withheld' => :'state_tax_withheld', - :'state_tax_withheld_lower' => :'state_tax_withheld_lower', - :'payer_state_number' => :'payer_state_number', - :'payer_state_number_lower' => :'payer_state_number_lower', - :'state_income' => :'state_income', - :'state_income_lower' => :'state_income_lower', - :'transactions_reported' => :'transactions_reported', - :'pse_name' => :'pse_name', - :'pse_telephone_number' => :'pse_telephone_number', - :'gross_amount' => :'gross_amount', - :'card_not_present_transaction' => :'card_not_present_transaction', - :'merchant_category_code' => :'merchant_category_code', - :'number_of_payment_transactions' => :'number_of_payment_transactions', - :'january_amount' => :'january_amount', - :'february_amount' => :'february_amount', - :'march_amount' => :'march_amount', - :'april_amount' => :'april_amount', - :'may_amount' => :'may_amount', - :'june_amount' => :'june_amount', - :'july_amount' => :'july_amount', - :'august_amount' => :'august_amount', - :'september_amount' => :'september_amount', - :'october_amount' => :'october_amount', - :'november_amount' => :'november_amount', - :'december_amount' => :'december_amount', - :'primary_state' => :'primary_state', - :'secondary_state' => :'secondary_state', - :'primary_state_id' => :'primary_state_id', - :'secondary_state_id' => :'secondary_state_id', - :'primary_state_income_tax' => :'primary_state_income_tax', - :'secondary_state_income_tax' => :'secondary_state_income_tax' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'document_id' => :'String', - :'document_metadata' => :'CreditDocumentMetadata', - :'form_1099_type' => :'Form1099Type', - :'recipient' => :'Credit1099Recipient', - :'payer' => :'Credit1099Payer', - :'filer' => :'Credit1099Filer', - :'tax_year' => :'String', - :'rents' => :'Float', - :'royalties' => :'Float', - :'other_income' => :'Float', - :'federal_income_tax_withheld' => :'Float', - :'fishing_boat_proceeds' => :'Float', - :'medical_and_healthcare_payments' => :'Float', - :'nonemployee_compensation' => :'Float', - :'substitute_payments_in_lieu_of_dividends_or_interest' => :'Float', - :'payer_made_direct_sales_of_5000_or_more_of_consumer_products_to_buyer' => :'String', - :'crop_insurance_proceeds' => :'Float', - :'excess_golden_parachute_payments' => :'Float', - :'gross_proceeds_paid_to_an_attorney' => :'Float', - :'section_409a_deferrals' => :'Float', - :'section_409a_income' => :'Float', - :'state_tax_withheld' => :'Float', - :'state_tax_withheld_lower' => :'Float', - :'payer_state_number' => :'String', - :'payer_state_number_lower' => :'String', - :'state_income' => :'Float', - :'state_income_lower' => :'Float', - :'transactions_reported' => :'String', - :'pse_name' => :'String', - :'pse_telephone_number' => :'String', - :'gross_amount' => :'Float', - :'card_not_present_transaction' => :'Float', - :'merchant_category_code' => :'String', - :'number_of_payment_transactions' => :'String', - :'january_amount' => :'Float', - :'february_amount' => :'Float', - :'march_amount' => :'Float', - :'april_amount' => :'Float', - :'may_amount' => :'Float', - :'june_amount' => :'Float', - :'july_amount' => :'Float', - :'august_amount' => :'Float', - :'september_amount' => :'Float', - :'october_amount' => :'Float', - :'november_amount' => :'Float', - :'december_amount' => :'Float', - :'primary_state' => :'String', - :'secondary_state' => :'String', - :'primary_state_id' => :'String', - :'secondary_state_id' => :'String', - :'primary_state_income_tax' => :'Float', - :'secondary_state_income_tax' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'document_id', - :'tax_year', - :'rents', - :'royalties', - :'other_income', - :'federal_income_tax_withheld', - :'fishing_boat_proceeds', - :'medical_and_healthcare_payments', - :'nonemployee_compensation', - :'substitute_payments_in_lieu_of_dividends_or_interest', - :'payer_made_direct_sales_of_5000_or_more_of_consumer_products_to_buyer', - :'crop_insurance_proceeds', - :'excess_golden_parachute_payments', - :'gross_proceeds_paid_to_an_attorney', - :'section_409a_deferrals', - :'section_409a_income', - :'state_tax_withheld', - :'state_tax_withheld_lower', - :'payer_state_number', - :'payer_state_number_lower', - :'state_income', - :'state_income_lower', - :'transactions_reported', - :'pse_name', - :'pse_telephone_number', - :'gross_amount', - :'card_not_present_transaction', - :'merchant_category_code', - :'number_of_payment_transactions', - :'january_amount', - :'february_amount', - :'march_amount', - :'april_amount', - :'may_amount', - :'june_amount', - :'july_amount', - :'august_amount', - :'september_amount', - :'october_amount', - :'november_amount', - :'december_amount', - :'primary_state', - :'secondary_state', - :'primary_state_id', - :'secondary_state_id', - :'primary_state_income_tax', - :'secondary_state_income_tax' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Credit1099` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Credit1099`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'document_id') - self.document_id = attributes[:'document_id'] - end - - if attributes.key?(:'document_metadata') - self.document_metadata = attributes[:'document_metadata'] - end - - if attributes.key?(:'form_1099_type') - self.form_1099_type = attributes[:'form_1099_type'] - end - - if attributes.key?(:'recipient') - self.recipient = attributes[:'recipient'] - end - - if attributes.key?(:'payer') - self.payer = attributes[:'payer'] - end - - if attributes.key?(:'filer') - self.filer = attributes[:'filer'] - end - - if attributes.key?(:'tax_year') - self.tax_year = attributes[:'tax_year'] - end - - if attributes.key?(:'rents') - self.rents = attributes[:'rents'] - end - - if attributes.key?(:'royalties') - self.royalties = attributes[:'royalties'] - end - - if attributes.key?(:'other_income') - self.other_income = attributes[:'other_income'] - end - - if attributes.key?(:'federal_income_tax_withheld') - self.federal_income_tax_withheld = attributes[:'federal_income_tax_withheld'] - end - - if attributes.key?(:'fishing_boat_proceeds') - self.fishing_boat_proceeds = attributes[:'fishing_boat_proceeds'] - end - - if attributes.key?(:'medical_and_healthcare_payments') - self.medical_and_healthcare_payments = attributes[:'medical_and_healthcare_payments'] - end - - if attributes.key?(:'nonemployee_compensation') - self.nonemployee_compensation = attributes[:'nonemployee_compensation'] - end - - if attributes.key?(:'substitute_payments_in_lieu_of_dividends_or_interest') - self.substitute_payments_in_lieu_of_dividends_or_interest = attributes[:'substitute_payments_in_lieu_of_dividends_or_interest'] - end - - if attributes.key?(:'payer_made_direct_sales_of_5000_or_more_of_consumer_products_to_buyer') - self.payer_made_direct_sales_of_5000_or_more_of_consumer_products_to_buyer = attributes[:'payer_made_direct_sales_of_5000_or_more_of_consumer_products_to_buyer'] - end - - if attributes.key?(:'crop_insurance_proceeds') - self.crop_insurance_proceeds = attributes[:'crop_insurance_proceeds'] - end - - if attributes.key?(:'excess_golden_parachute_payments') - self.excess_golden_parachute_payments = attributes[:'excess_golden_parachute_payments'] - end - - if attributes.key?(:'gross_proceeds_paid_to_an_attorney') - self.gross_proceeds_paid_to_an_attorney = attributes[:'gross_proceeds_paid_to_an_attorney'] - end - - if attributes.key?(:'section_409a_deferrals') - self.section_409a_deferrals = attributes[:'section_409a_deferrals'] - end - - if attributes.key?(:'section_409a_income') - self.section_409a_income = attributes[:'section_409a_income'] - end - - if attributes.key?(:'state_tax_withheld') - self.state_tax_withheld = attributes[:'state_tax_withheld'] - end - - if attributes.key?(:'state_tax_withheld_lower') - self.state_tax_withheld_lower = attributes[:'state_tax_withheld_lower'] - end - - if attributes.key?(:'payer_state_number') - self.payer_state_number = attributes[:'payer_state_number'] - end - - if attributes.key?(:'payer_state_number_lower') - self.payer_state_number_lower = attributes[:'payer_state_number_lower'] - end - - if attributes.key?(:'state_income') - self.state_income = attributes[:'state_income'] - end - - if attributes.key?(:'state_income_lower') - self.state_income_lower = attributes[:'state_income_lower'] - end - - if attributes.key?(:'transactions_reported') - self.transactions_reported = attributes[:'transactions_reported'] - end - - if attributes.key?(:'pse_name') - self.pse_name = attributes[:'pse_name'] - end - - if attributes.key?(:'pse_telephone_number') - self.pse_telephone_number = attributes[:'pse_telephone_number'] - end - - if attributes.key?(:'gross_amount') - self.gross_amount = attributes[:'gross_amount'] - end - - if attributes.key?(:'card_not_present_transaction') - self.card_not_present_transaction = attributes[:'card_not_present_transaction'] - end - - if attributes.key?(:'merchant_category_code') - self.merchant_category_code = attributes[:'merchant_category_code'] - end - - if attributes.key?(:'number_of_payment_transactions') - self.number_of_payment_transactions = attributes[:'number_of_payment_transactions'] - end - - if attributes.key?(:'january_amount') - self.january_amount = attributes[:'january_amount'] - end - - if attributes.key?(:'february_amount') - self.february_amount = attributes[:'february_amount'] - end - - if attributes.key?(:'march_amount') - self.march_amount = attributes[:'march_amount'] - end - - if attributes.key?(:'april_amount') - self.april_amount = attributes[:'april_amount'] - end - - if attributes.key?(:'may_amount') - self.may_amount = attributes[:'may_amount'] - end - - if attributes.key?(:'june_amount') - self.june_amount = attributes[:'june_amount'] - end - - if attributes.key?(:'july_amount') - self.july_amount = attributes[:'july_amount'] - end - - if attributes.key?(:'august_amount') - self.august_amount = attributes[:'august_amount'] - end - - if attributes.key?(:'september_amount') - self.september_amount = attributes[:'september_amount'] - end - - if attributes.key?(:'october_amount') - self.october_amount = attributes[:'october_amount'] - end - - if attributes.key?(:'november_amount') - self.november_amount = attributes[:'november_amount'] - end - - if attributes.key?(:'december_amount') - self.december_amount = attributes[:'december_amount'] - end - - if attributes.key?(:'primary_state') - self.primary_state = attributes[:'primary_state'] - end - - if attributes.key?(:'secondary_state') - self.secondary_state = attributes[:'secondary_state'] - end - - if attributes.key?(:'primary_state_id') - self.primary_state_id = attributes[:'primary_state_id'] - end - - if attributes.key?(:'secondary_state_id') - self.secondary_state_id = attributes[:'secondary_state_id'] - end - - if attributes.key?(:'primary_state_income_tax') - self.primary_state_income_tax = attributes[:'primary_state_income_tax'] - end - - if attributes.key?(:'secondary_state_income_tax') - self.secondary_state_income_tax = attributes[:'secondary_state_income_tax'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - document_id == o.document_id && - document_metadata == o.document_metadata && - form_1099_type == o.form_1099_type && - recipient == o.recipient && - payer == o.payer && - filer == o.filer && - tax_year == o.tax_year && - rents == o.rents && - royalties == o.royalties && - other_income == o.other_income && - federal_income_tax_withheld == o.federal_income_tax_withheld && - fishing_boat_proceeds == o.fishing_boat_proceeds && - medical_and_healthcare_payments == o.medical_and_healthcare_payments && - nonemployee_compensation == o.nonemployee_compensation && - substitute_payments_in_lieu_of_dividends_or_interest == o.substitute_payments_in_lieu_of_dividends_or_interest && - payer_made_direct_sales_of_5000_or_more_of_consumer_products_to_buyer == o.payer_made_direct_sales_of_5000_or_more_of_consumer_products_to_buyer && - crop_insurance_proceeds == o.crop_insurance_proceeds && - excess_golden_parachute_payments == o.excess_golden_parachute_payments && - gross_proceeds_paid_to_an_attorney == o.gross_proceeds_paid_to_an_attorney && - section_409a_deferrals == o.section_409a_deferrals && - section_409a_income == o.section_409a_income && - state_tax_withheld == o.state_tax_withheld && - state_tax_withheld_lower == o.state_tax_withheld_lower && - payer_state_number == o.payer_state_number && - payer_state_number_lower == o.payer_state_number_lower && - state_income == o.state_income && - state_income_lower == o.state_income_lower && - transactions_reported == o.transactions_reported && - pse_name == o.pse_name && - pse_telephone_number == o.pse_telephone_number && - gross_amount == o.gross_amount && - card_not_present_transaction == o.card_not_present_transaction && - merchant_category_code == o.merchant_category_code && - number_of_payment_transactions == o.number_of_payment_transactions && - january_amount == o.january_amount && - february_amount == o.february_amount && - march_amount == o.march_amount && - april_amount == o.april_amount && - may_amount == o.may_amount && - june_amount == o.june_amount && - july_amount == o.july_amount && - august_amount == o.august_amount && - september_amount == o.september_amount && - october_amount == o.october_amount && - november_amount == o.november_amount && - december_amount == o.december_amount && - primary_state == o.primary_state && - secondary_state == o.secondary_state && - primary_state_id == o.primary_state_id && - secondary_state_id == o.secondary_state_id && - primary_state_income_tax == o.primary_state_income_tax && - secondary_state_income_tax == o.secondary_state_income_tax - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [document_id, document_metadata, form_1099_type, recipient, payer, filer, tax_year, rents, royalties, other_income, federal_income_tax_withheld, fishing_boat_proceeds, medical_and_healthcare_payments, nonemployee_compensation, substitute_payments_in_lieu_of_dividends_or_interest, payer_made_direct_sales_of_5000_or_more_of_consumer_products_to_buyer, crop_insurance_proceeds, excess_golden_parachute_payments, gross_proceeds_paid_to_an_attorney, section_409a_deferrals, section_409a_income, state_tax_withheld, state_tax_withheld_lower, payer_state_number, payer_state_number_lower, state_income, state_income_lower, transactions_reported, pse_name, pse_telephone_number, gross_amount, card_not_present_transaction, merchant_category_code, number_of_payment_transactions, january_amount, february_amount, march_amount, april_amount, may_amount, june_amount, july_amount, august_amount, september_amount, october_amount, november_amount, december_amount, primary_state, secondary_state, primary_state_id, secondary_state_id, primary_state_income_tax, secondary_state_income_tax].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit1099_filer.rb b/lib/plaid/models/credit1099_filer.rb deleted file mode 100644 index 79e25c6c5..000000000 --- a/lib/plaid/models/credit1099_filer.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing a filer used by 1099-K tax documents. - class Credit1099Filer - attr_accessor :address - - # Name of filer. - attr_accessor :name - - # Tax identification number of filer. - attr_accessor :tin - - # One of the following values will be provided: Payment Settlement Entity (PSE), Electronic Payment Facilitator (EPF), Other Third Party - attr_accessor :type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'address' => :'address', - :'name' => :'name', - :'tin' => :'tin', - :'type' => :'type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'address' => :'CreditPayStubAddress', - :'name' => :'String', - :'tin' => :'String', - :'type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'tin', - :'type' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Credit1099Filer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Credit1099Filer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'tin') - self.tin = attributes[:'tin'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - address == o.address && - name == o.name && - tin == o.tin && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [address, name, tin, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit1099_payer.rb b/lib/plaid/models/credit1099_payer.rb deleted file mode 100644 index 9e359309c..000000000 --- a/lib/plaid/models/credit1099_payer.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing a payer used by 1099-MISC tax documents. - class Credit1099Payer - attr_accessor :address - - # Name of payer. - attr_accessor :name - - # Tax identification number of payer. - attr_accessor :tin - - # Telephone number of payer. - attr_accessor :telephone_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'address' => :'address', - :'name' => :'name', - :'tin' => :'tin', - :'telephone_number' => :'telephone_number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'address' => :'CreditPayStubAddress', - :'name' => :'String', - :'tin' => :'String', - :'telephone_number' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'tin', - :'telephone_number' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Credit1099Payer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Credit1099Payer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'tin') - self.tin = attributes[:'tin'] - end - - if attributes.key?(:'telephone_number') - self.telephone_number = attributes[:'telephone_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - address == o.address && - name == o.name && - tin == o.tin && - telephone_number == o.telephone_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [address, name, tin, telephone_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit1099_recipient.rb b/lib/plaid/models/credit1099_recipient.rb deleted file mode 100644 index da6745c5a..000000000 --- a/lib/plaid/models/credit1099_recipient.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing a recipient used in both 1099-K and 1099-MISC tax documents. - class Credit1099Recipient - attr_accessor :address - - # Name of recipient. - attr_accessor :name - - # Tax identification number of recipient. - attr_accessor :tin - - # Account number number of recipient. - attr_accessor :account_number - - # Checked if FACTA is a filing requirement. - attr_accessor :facta_filing_requirement - - # Checked if 2nd TIN exists. - attr_accessor :second_tin_exists - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'address' => :'address', - :'name' => :'name', - :'tin' => :'tin', - :'account_number' => :'account_number', - :'facta_filing_requirement' => :'facta_filing_requirement', - :'second_tin_exists' => :'second_tin_exists' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'address' => :'CreditPayStubAddress', - :'name' => :'String', - :'tin' => :'String', - :'account_number' => :'String', - :'facta_filing_requirement' => :'String', - :'second_tin_exists' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'tin', - :'account_number', - :'facta_filing_requirement', - :'second_tin_exists' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Credit1099Recipient` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Credit1099Recipient`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'tin') - self.tin = attributes[:'tin'] - end - - if attributes.key?(:'account_number') - self.account_number = attributes[:'account_number'] - end - - if attributes.key?(:'facta_filing_requirement') - self.facta_filing_requirement = attributes[:'facta_filing_requirement'] - end - - if attributes.key?(:'second_tin_exists') - self.second_tin_exists = attributes[:'second_tin_exists'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - address == o.address && - name == o.name && - tin == o.tin && - account_number == o.account_number && - facta_filing_requirement == o.facta_filing_requirement && - second_tin_exists == o.second_tin_exists - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [address, name, tin, account_number, facta_filing_requirement, second_tin_exists].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_account_subtype.rb b/lib/plaid/models/credit_account_subtype.rb deleted file mode 100644 index 5d0923401..000000000 --- a/lib/plaid/models/credit_account_subtype.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CreditAccountSubtype - CREDIT_CARD = "credit card".freeze - PAYPAL = "paypal".freeze - ALL = "all".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/credit_ach_class.rb b/lib/plaid/models/credit_ach_class.rb deleted file mode 100644 index 966f96428..000000000 --- a/lib/plaid/models/credit_ach_class.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CreditACHClass - CCD = "ccd".freeze - PPD = "ppd".freeze - WEB = "web".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/credit_amount_with_currency.rb b/lib/plaid/models/credit_amount_with_currency.rb deleted file mode 100644 index e0d6ccc0f..000000000 --- a/lib/plaid/models/credit_amount_with_currency.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # This contains an amount, denominated in the currency specified by either `iso_currency_code` or `unofficial_currency_code` - class CreditAmountWithCurrency - # Value of amount with up to 2 decimal places. - attr_accessor :amount - - # The ISO 4217 currency code of the amount or balance. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'iso_currency_code', - :'unofficial_currency_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditAmountWithCurrency` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditAmountWithCurrency`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, iso_currency_code, unofficial_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_audit_copy_token_create_request.rb b/lib/plaid/models/credit_audit_copy_token_create_request.rb deleted file mode 100644 index 930210a6b..000000000 --- a/lib/plaid/models/credit_audit_copy_token_create_request.rb +++ /dev/null @@ -1,248 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditAuditCopyTokenCreateRequest defines the request schema for `/credit/audit_copy_token/create` - class CreditAuditCopyTokenCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # List of report tokens; can include at most one VOA/standard Asset Report tokens and one VOE Asset Report Token. - attr_accessor :report_tokens - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'report_tokens' => :'report_tokens' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'report_tokens' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditAuditCopyTokenCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditAuditCopyTokenCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'report_tokens') - if (value = attributes[:'report_tokens']).is_a?(Array) - self.report_tokens = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @report_tokens.nil? - invalid_properties.push('invalid value for "report_tokens", report_tokens cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @report_tokens.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - report_tokens == o.report_tokens - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, report_tokens].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_audit_copy_token_create_response.rb b/lib/plaid/models/credit_audit_copy_token_create_response.rb deleted file mode 100644 index f70188ee9..000000000 --- a/lib/plaid/models/credit_audit_copy_token_create_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditAuditCopyTokenCreateResponse defines the response schema for `/credit/audit_copy_token/get` - class CreditAuditCopyTokenCreateResponse - # A token that can be shared with a third party auditor, which allows them to fetch the Asset Reports attached to the token. This token should be stored securely. - attr_accessor :audit_copy_token - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'audit_copy_token' => :'audit_copy_token', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'audit_copy_token' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditAuditCopyTokenCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditAuditCopyTokenCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'audit_copy_token') - self.audit_copy_token = attributes[:'audit_copy_token'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @audit_copy_token.nil? - invalid_properties.push('invalid value for "audit_copy_token", audit_copy_token cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @audit_copy_token.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - audit_copy_token == o.audit_copy_token && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [audit_copy_token, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_audit_copy_token_remove_request.rb b/lib/plaid/models/credit_audit_copy_token_remove_request.rb deleted file mode 100644 index fb2bdaf42..000000000 --- a/lib/plaid/models/credit_audit_copy_token_remove_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditAuditCopyTokenRemoveRequest defines the request schema for `/credit/audit_copy_token/remove` - class CreditAuditCopyTokenRemoveRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The `audit_copy_token` granting access to the Audit Copy you would like to revoke. - attr_accessor :audit_copy_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'audit_copy_token' => :'audit_copy_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'audit_copy_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditAuditCopyTokenRemoveRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditAuditCopyTokenRemoveRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'audit_copy_token') - self.audit_copy_token = attributes[:'audit_copy_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @audit_copy_token.nil? - invalid_properties.push('invalid value for "audit_copy_token", audit_copy_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @audit_copy_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - audit_copy_token == o.audit_copy_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, audit_copy_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_audit_copy_token_remove_response.rb b/lib/plaid/models/credit_audit_copy_token_remove_response.rb deleted file mode 100644 index d05587509..000000000 --- a/lib/plaid/models/credit_audit_copy_token_remove_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditAuditCopyTokenRemoveResponse defines the response schema for `/credit/audit_copy_token/remove` - class CreditAuditCopyTokenRemoveResponse - # `true` if the Audit Copy was successfully removed. - attr_accessor :removed - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'removed' => :'removed', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'removed' => :'Boolean', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditAuditCopyTokenRemoveResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditAuditCopyTokenRemoveResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'removed') - self.removed = attributes[:'removed'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @removed.nil? - invalid_properties.push('invalid value for "removed", removed cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @removed.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - removed == o.removed && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [removed, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_audit_copy_token_update_request.rb b/lib/plaid/models/credit_audit_copy_token_update_request.rb deleted file mode 100644 index 27677fe02..000000000 --- a/lib/plaid/models/credit_audit_copy_token_update_request.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditAuditCopyTokenUpdateRequest defines the request schema for `/credit/audit_copy_token/update` - class CreditAuditCopyTokenUpdateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The `audit_copy_token` you would like to update. - attr_accessor :audit_copy_token - - # Array of tokens which the specified Audit Copy Token will be updated with. The types of token supported are asset report token and employment report token. There can be at most 1 of each token type in the array. - attr_accessor :report_tokens - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'audit_copy_token' => :'audit_copy_token', - :'report_tokens' => :'report_tokens' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'audit_copy_token' => :'String', - :'report_tokens' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditAuditCopyTokenUpdateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditAuditCopyTokenUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'audit_copy_token') - self.audit_copy_token = attributes[:'audit_copy_token'] - end - - if attributes.key?(:'report_tokens') - if (value = attributes[:'report_tokens']).is_a?(Array) - self.report_tokens = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @audit_copy_token.nil? - invalid_properties.push('invalid value for "audit_copy_token", audit_copy_token cannot be nil.') - end - - if @report_tokens.nil? - invalid_properties.push('invalid value for "report_tokens", report_tokens cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @audit_copy_token.nil? - return false if @report_tokens.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - audit_copy_token == o.audit_copy_token && - report_tokens == o.report_tokens - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, audit_copy_token, report_tokens].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_audit_copy_token_update_response.rb b/lib/plaid/models/credit_audit_copy_token_update_response.rb deleted file mode 100644 index 9889abf37..000000000 --- a/lib/plaid/models/credit_audit_copy_token_update_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditAuditCopyTokenUpdateResponse defines the response schema for `/credit/audit_copy_token/update` - class CreditAuditCopyTokenUpdateResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # `true` if the Audit Copy Token was successfully updated. - attr_accessor :updated - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id', - :'updated' => :'updated' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String', - :'updated' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditAuditCopyTokenUpdateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditAuditCopyTokenUpdateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'updated') - self.updated = attributes[:'updated'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - if @updated.nil? - invalid_properties.push('invalid value for "updated", updated cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - return false if @updated.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id && - updated == o.updated - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id, updated].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_employer.rb b/lib/plaid/models/credit_bank_employer.rb deleted file mode 100644 index 4bf6111eb..000000000 --- a/lib/plaid/models/credit_bank_employer.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Object containing employer data. - class CreditBankEmployer - # Name of the employer. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankEmployer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankEmployer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_employment.rb b/lib/plaid/models/credit_bank_employment.rb deleted file mode 100644 index e3907b2b3..000000000 --- a/lib/plaid/models/credit_bank_employment.rb +++ /dev/null @@ -1,285 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Detailed information for the bank employment. - class CreditBankEmployment - # A unique identifier for the bank employment. - attr_accessor :bank_employment_id - - # Plaid's unique identifier for the account. - attr_accessor :account_id - - attr_accessor :employer - - # The date of the most recent deposit from this employer. - attr_accessor :latest_deposit_date - - # The date of the earliest deposit from this employer from within the period of the days requested. - attr_accessor :earliest_deposit_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_employment_id' => :'bank_employment_id', - :'account_id' => :'account_id', - :'employer' => :'employer', - :'latest_deposit_date' => :'latest_deposit_date', - :'earliest_deposit_date' => :'earliest_deposit_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_employment_id' => :'String', - :'account_id' => :'String', - :'employer' => :'CreditBankEmployer', - :'latest_deposit_date' => :'Date', - :'earliest_deposit_date' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankEmployment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankEmployment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_employment_id') - self.bank_employment_id = attributes[:'bank_employment_id'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'employer') - self.employer = attributes[:'employer'] - end - - if attributes.key?(:'latest_deposit_date') - self.latest_deposit_date = attributes[:'latest_deposit_date'] - end - - if attributes.key?(:'earliest_deposit_date') - self.earliest_deposit_date = attributes[:'earliest_deposit_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @bank_employment_id.nil? - invalid_properties.push('invalid value for "bank_employment_id", bank_employment_id cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @employer.nil? - invalid_properties.push('invalid value for "employer", employer cannot be nil.') - end - - if @latest_deposit_date.nil? - invalid_properties.push('invalid value for "latest_deposit_date", latest_deposit_date cannot be nil.') - end - - if @earliest_deposit_date.nil? - invalid_properties.push('invalid value for "earliest_deposit_date", earliest_deposit_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @bank_employment_id.nil? - return false if @account_id.nil? - return false if @employer.nil? - return false if @latest_deposit_date.nil? - return false if @earliest_deposit_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_employment_id == o.bank_employment_id && - account_id == o.account_id && - employer == o.employer && - latest_deposit_date == o.latest_deposit_date && - earliest_deposit_date == o.earliest_deposit_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_employment_id, account_id, employer, latest_deposit_date, earliest_deposit_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_employment_get_request.rb b/lib/plaid/models/credit_bank_employment_get_request.rb deleted file mode 100644 index 16434ec9c..000000000 --- a/lib/plaid/models/credit_bank_employment_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditBankEmploymentGetRequest defines the request schema for `/beta/credit/v1/bank_employment/get`. - class CreditBankEmploymentGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankEmploymentGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankEmploymentGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_token.nil? - invalid_properties.push('invalid value for "user_token", user_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_employment_get_response.rb b/lib/plaid/models/credit_bank_employment_get_response.rb deleted file mode 100644 index 9c78f1d38..000000000 --- a/lib/plaid/models/credit_bank_employment_get_response.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditBankEmploymentGetResponse defines the response schema for `/beta/credit/v1/bank_employment/get`. - class CreditBankEmploymentGetResponse - # Bank Employment data. Each entry in the array will be a distinct bank employment report. - attr_accessor :bank_employment_reports - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_employment_reports' => :'bank_employment_reports', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_employment_reports' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankEmploymentGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankEmploymentGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_employment_reports') - if (value = attributes[:'bank_employment_reports']).is_a?(Array) - self.bank_employment_reports = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @bank_employment_reports.nil? - invalid_properties.push('invalid value for "bank_employment_reports", bank_employment_reports cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @bank_employment_reports.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_employment_reports == o.bank_employment_reports && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_employment_reports, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_employment_item.rb b/lib/plaid/models/credit_bank_employment_item.rb deleted file mode 100644 index 55fa28881..000000000 --- a/lib/plaid/models/credit_bank_employment_item.rb +++ /dev/null @@ -1,305 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The details and metadata for an end user's Item. - class CreditBankEmploymentItem - # The unique identifier for the Item. - attr_accessor :item_id - - # The time when this Item's data was last retrieved from the financial institution, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (e.g. \"2018-04-12T03:32:11Z\"). - attr_accessor :last_updated_time - - # The unique identifier of the institution associated with the Item. - attr_accessor :institution_id - - # The name of the institution associated with the Item. - attr_accessor :institution_name - - # The bank employment information for this Item. Each entry in the array is a different employer found. - attr_accessor :bank_employments - - # The Item's accounts that have Bank Employment data. - attr_accessor :bank_employment_accounts - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_id' => :'item_id', - :'last_updated_time' => :'last_updated_time', - :'institution_id' => :'institution_id', - :'institution_name' => :'institution_name', - :'bank_employments' => :'bank_employments', - :'bank_employment_accounts' => :'bank_employment_accounts' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_id' => :'String', - :'last_updated_time' => :'Time', - :'institution_id' => :'String', - :'institution_name' => :'String', - :'bank_employments' => :'Array', - :'bank_employment_accounts' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankEmploymentItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankEmploymentItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'last_updated_time') - self.last_updated_time = attributes[:'last_updated_time'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'institution_name') - self.institution_name = attributes[:'institution_name'] - end - - if attributes.key?(:'bank_employments') - if (value = attributes[:'bank_employments']).is_a?(Array) - self.bank_employments = value - end - end - - if attributes.key?(:'bank_employment_accounts') - if (value = attributes[:'bank_employment_accounts']).is_a?(Array) - self.bank_employment_accounts = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @last_updated_time.nil? - invalid_properties.push('invalid value for "last_updated_time", last_updated_time cannot be nil.') - end - - if @institution_id.nil? - invalid_properties.push('invalid value for "institution_id", institution_id cannot be nil.') - end - - if @institution_name.nil? - invalid_properties.push('invalid value for "institution_name", institution_name cannot be nil.') - end - - if @bank_employments.nil? - invalid_properties.push('invalid value for "bank_employments", bank_employments cannot be nil.') - end - - if @bank_employment_accounts.nil? - invalid_properties.push('invalid value for "bank_employment_accounts", bank_employment_accounts cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_id.nil? - return false if @last_updated_time.nil? - return false if @institution_id.nil? - return false if @institution_name.nil? - return false if @bank_employments.nil? - return false if @bank_employment_accounts.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_id == o.item_id && - last_updated_time == o.last_updated_time && - institution_id == o.institution_id && - institution_name == o.institution_name && - bank_employments == o.bank_employments && - bank_employment_accounts == o.bank_employment_accounts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_id, last_updated_time, institution_id, institution_name, bank_employments, bank_employment_accounts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_employment_report.rb b/lib/plaid/models/credit_bank_employment_report.rb deleted file mode 100644 index 5f1885b2c..000000000 --- a/lib/plaid/models/credit_bank_employment_report.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The report of the Bank Employment data for an end user. - class CreditBankEmploymentReport - # The unique identifier associated with the Bank Employment Report. - attr_accessor :bank_employment_report_id - - # The time when the Bank Employment Report was generated, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (e.g. \"2018-04-12T03:32:11Z\"). - attr_accessor :generated_time - - # The number of days requested by the customer for the Bank Employment Report. - attr_accessor :days_requested - - # The list of Items in the report along with the associated metadata about the Item. - attr_accessor :items - - # If data from the Bank Employment report was unable to be retrieved, the warnings will contain information about the error that caused the data to be incomplete. - attr_accessor :warnings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_employment_report_id' => :'bank_employment_report_id', - :'generated_time' => :'generated_time', - :'days_requested' => :'days_requested', - :'items' => :'items', - :'warnings' => :'warnings' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_employment_report_id' => :'String', - :'generated_time' => :'Time', - :'days_requested' => :'Integer', - :'items' => :'Array', - :'warnings' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankEmploymentReport` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankEmploymentReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_employment_report_id') - self.bank_employment_report_id = attributes[:'bank_employment_report_id'] - end - - if attributes.key?(:'generated_time') - self.generated_time = attributes[:'generated_time'] - end - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - - if attributes.key?(:'warnings') - if (value = attributes[:'warnings']).is_a?(Array) - self.warnings = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @bank_employment_report_id.nil? - invalid_properties.push('invalid value for "bank_employment_report_id", bank_employment_report_id cannot be nil.') - end - - if @generated_time.nil? - invalid_properties.push('invalid value for "generated_time", generated_time cannot be nil.') - end - - if @days_requested.nil? - invalid_properties.push('invalid value for "days_requested", days_requested cannot be nil.') - end - - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - if @warnings.nil? - invalid_properties.push('invalid value for "warnings", warnings cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @bank_employment_report_id.nil? - return false if @generated_time.nil? - return false if @days_requested.nil? - return false if @items.nil? - return false if @warnings.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_employment_report_id == o.bank_employment_report_id && - generated_time == o.generated_time && - days_requested == o.days_requested && - items == o.items && - warnings == o.warnings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_employment_report_id, generated_time, days_requested, items, warnings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_employment_warning.rb b/lib/plaid/models/credit_bank_employment_warning.rb deleted file mode 100644 index 62b741dc2..000000000 --- a/lib/plaid/models/credit_bank_employment_warning.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The warning associated with the data that was unavailable for the Bank Employment Report. - class CreditBankEmploymentWarning - attr_accessor :warning_type - - attr_accessor :warning_code - - attr_accessor :cause - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'warning_type' => :'warning_type', - :'warning_code' => :'warning_code', - :'cause' => :'cause' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'warning_type' => :'CreditBankEmploymentWarningType', - :'warning_code' => :'CreditBankIncomeWarningCode', - :'cause' => :'CreditBankIncomeCause' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankEmploymentWarning` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankEmploymentWarning`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'warning_type') - self.warning_type = attributes[:'warning_type'] - end - - if attributes.key?(:'warning_code') - self.warning_code = attributes[:'warning_code'] - end - - if attributes.key?(:'cause') - self.cause = attributes[:'cause'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @warning_type.nil? - invalid_properties.push('invalid value for "warning_type", warning_type cannot be nil.') - end - - if @warning_code.nil? - invalid_properties.push('invalid value for "warning_code", warning_code cannot be nil.') - end - - if @cause.nil? - invalid_properties.push('invalid value for "cause", cause cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @warning_type.nil? - return false if @warning_code.nil? - return false if @cause.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - warning_type == o.warning_type && - warning_code == o.warning_code && - cause == o.cause - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [warning_type, warning_code, cause].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_employment_warning_type.rb b/lib/plaid/models/credit_bank_employment_warning_type.rb deleted file mode 100644 index fba9ad738..000000000 --- a/lib/plaid/models/credit_bank_employment_warning_type.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CreditBankEmploymentWarningType - BANK_EMPLOYMENT_WARNING = "BANK_EMPLOYMENT_WARNING".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/credit_bank_income.rb b/lib/plaid/models/credit_bank_income.rb deleted file mode 100644 index e1dfd9172..000000000 --- a/lib/plaid/models/credit_bank_income.rb +++ /dev/null @@ -1,274 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The report of the Bank Income data for an end user. - class CreditBankIncome - # The unique identifier associated with the Bank Income Report. - attr_accessor :bank_income_id - - # The time when the Bank Income Report was generated. - attr_accessor :generated_time - - # The number of days requested by the customer for the Bank Income Report. - attr_accessor :days_requested - - # The list of Items in the report along with the associated metadata about the Item. - attr_accessor :items - - attr_accessor :bank_income_summary - - # 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. - attr_accessor :warnings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_income_id' => :'bank_income_id', - :'generated_time' => :'generated_time', - :'days_requested' => :'days_requested', - :'items' => :'items', - :'bank_income_summary' => :'bank_income_summary', - :'warnings' => :'warnings' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_income_id' => :'String', - :'generated_time' => :'Time', - :'days_requested' => :'Integer', - :'items' => :'Array', - :'bank_income_summary' => :'CreditBankIncomeSummary', - :'warnings' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncome` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncome`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_income_id') - self.bank_income_id = attributes[:'bank_income_id'] - end - - if attributes.key?(:'generated_time') - self.generated_time = attributes[:'generated_time'] - end - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - - if attributes.key?(:'bank_income_summary') - self.bank_income_summary = attributes[:'bank_income_summary'] - end - - if attributes.key?(:'warnings') - if (value = attributes[:'warnings']).is_a?(Array) - self.warnings = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_income_id == o.bank_income_id && - generated_time == o.generated_time && - days_requested == o.days_requested && - items == o.items && - bank_income_summary == o.bank_income_summary && - warnings == o.warnings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_income_id, generated_time, days_requested, items, bank_income_summary, warnings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_account.rb b/lib/plaid/models/credit_bank_income_account.rb deleted file mode 100644 index f9506546d..000000000 --- a/lib/plaid/models/credit_bank_income_account.rb +++ /dev/null @@ -1,330 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The Item's bank accounts that have the selected data. - class CreditBankIncomeAccount - # Plaid's unique identifier for the account. - attr_accessor :account_id - - # 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. - attr_accessor :mask - - # The name of the bank account. - attr_accessor :name - - # The official name of the bank account. - attr_accessor :official_name - - attr_accessor :subtype - - attr_accessor :type - - # Data returned by the financial institution about the account owner or owners. Identity information is optional, so field may return an empty array. - attr_accessor :owners - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'mask' => :'mask', - :'name' => :'name', - :'official_name' => :'official_name', - :'subtype' => :'subtype', - :'type' => :'type', - :'owners' => :'owners' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'mask' => :'String', - :'name' => :'String', - :'official_name' => :'String', - :'subtype' => :'DepositoryAccountSubtype', - :'type' => :'CreditBankIncomeAccountType', - :'owners' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'mask', - :'official_name', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeAccount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'mask') - self.mask = attributes[:'mask'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'official_name') - self.official_name = attributes[:'official_name'] - end - - if attributes.key?(:'subtype') - self.subtype = attributes[:'subtype'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'owners') - if (value = attributes[:'owners']).is_a?(Array) - self.owners = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @subtype.nil? - invalid_properties.push('invalid value for "subtype", subtype cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @owners.nil? - invalid_properties.push('invalid value for "owners", owners cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @name.nil? - return false if @subtype.nil? - return false if @type.nil? - return false if @owners.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - mask == o.mask && - name == o.name && - official_name == o.official_name && - subtype == o.subtype && - type == o.type && - owners == o.owners - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, mask, name, official_name, subtype, type, owners].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_account_type.rb b/lib/plaid/models/credit_bank_income_account_type.rb deleted file mode 100644 index 1dfb3bb4b..000000000 --- a/lib/plaid/models/credit_bank_income_account_type.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CreditBankIncomeAccountType - DEPOSITORY = "depository".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/credit_bank_income_category.rb b/lib/plaid/models/credit_bank_income_category.rb deleted file mode 100644 index db7e9c292..000000000 --- a/lib/plaid/models/credit_bank_income_category.rb +++ /dev/null @@ -1,52 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CreditBankIncomeCategory - SALARY = "SALARY".freeze - UNEMPLOYMENT = "UNEMPLOYMENT".freeze - CASH = "CASH".freeze - GIG_ECONOMY = "GIG_ECONOMY".freeze - RENTAL = "RENTAL".freeze - CHILD_SUPPORT = "CHILD_SUPPORT".freeze - MILITARY = "MILITARY".freeze - RETIREMENT = "RETIREMENT".freeze - LONG_TERM_DISABILITY = "LONG_TERM_DISABILITY".freeze - BANK_INTEREST = "BANK_INTEREST".freeze - CASH_DEPOSIT = "CASH_DEPOSIT".freeze - TRANSFER_FROM_APPLICATION = "TRANSFER_FROM_APPLICATION".freeze - TAX_REFUND = "TAX_REFUND".freeze - BENEFIT_OTHER = "BENEFIT_OTHER".freeze - OTHER = "OTHER".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/credit_bank_income_cause.rb b/lib/plaid/models/credit_bank_income_cause.rb deleted file mode 100644 index e1ad86427..000000000 --- a/lib/plaid/models/credit_bank_income_cause.rb +++ /dev/null @@ -1,307 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class CreditBankIncomeCause - attr_accessor :error_type - - # 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. Error fields will be `null` if no error has occurred. - attr_accessor :error_code - - # A developer-friendly representation of the error code. This may change over time and is not safe for programmatic use. - attr_accessor :error_message - - # 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. - attr_accessor :display_message - - # The `item_id` of the Item associated with this warning. - attr_accessor :item_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'error_type' => :'error_type', - :'error_code' => :'error_code', - :'error_message' => :'error_message', - :'display_message' => :'display_message', - :'item_id' => :'item_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'error_type' => :'CreditBankIncomeErrorType', - :'error_code' => :'String', - :'error_message' => :'String', - :'display_message' => :'String', - :'item_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeCause` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeCause`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'error_type') - self.error_type = attributes[:'error_type'] - end - - if attributes.key?(:'error_code') - self.error_code = attributes[:'error_code'] - end - - if attributes.key?(:'error_message') - self.error_message = attributes[:'error_message'] - end - - if attributes.key?(:'display_message') - self.display_message = attributes[:'display_message'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @error_type.nil? - invalid_properties.push('invalid value for "error_type", error_type cannot be nil.') - end - - if @error_code.nil? - invalid_properties.push('invalid value for "error_code", error_code cannot be nil.') - end - - if @error_message.nil? - invalid_properties.push('invalid value for "error_message", error_message cannot be nil.') - end - - if @display_message.nil? - invalid_properties.push('invalid value for "display_message", display_message cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @error_type.nil? - return false if @error_code.nil? - return false if @error_message.nil? - return false if @display_message.nil? - return false if @item_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - error_type == o.error_type && - error_code == o.error_code && - error_message == o.error_message && - display_message == o.display_message && - item_id == o.item_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [error_type, error_code, error_message, display_message, item_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_error_type.rb b/lib/plaid/models/credit_bank_income_error_type.rb deleted file mode 100644 index 92602314e..000000000 --- a/lib/plaid/models/credit_bank_income_error_type.rb +++ /dev/null @@ -1,53 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CreditBankIncomeErrorType - INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR".freeze - INSUFFICIENT_CREDENTIALS = "INSUFFICIENT_CREDENTIALS".freeze - ITEM_LOCKED = "ITEM_LOCKED".freeze - USER_SETUP_REQUIRED = "USER_SETUP_REQUIRED".freeze - COUNTRY_NOT_SUPPORTED = "COUNTRY_NOT_SUPPORTED".freeze - INSTITUTION_DOWN = "INSTITUTION_DOWN".freeze - INSTITUTION_NO_LONGER_SUPPORTED = "INSTITUTION_NO_LONGER_SUPPORTED".freeze - INSTITUTION_NOT_RESPONDING = "INSTITUTION_NOT_RESPONDING".freeze - INVALID_CREDENTIALS = "INVALID_CREDENTIALS".freeze - INVALID_MFA = "INVALID_MFA".freeze - INVALID_SEND_METHOD = "INVALID_SEND_METHOD".freeze - ITEM_LOGIN_REQUIRED = "ITEM_LOGIN_REQUIRED".freeze - MFA_NOT_SUPPORTED = "MFA_NOT_SUPPORTED".freeze - NO_ACCOUNTS = "NO_ACCOUNTS".freeze - ITEM_NOT_SUPPORTED = "ITEM_NOT_SUPPORTED".freeze - ACCESS_NOT_GRANTED = "ACCESS_NOT_GRANTED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/credit_bank_income_get_request.rb b/lib/plaid/models/credit_bank_income_get_request.rb deleted file mode 100644 index 56b06f923..000000000 --- a/lib/plaid/models/credit_bank_income_get_request.rb +++ /dev/null @@ -1,250 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditBankIncomeGetRequest defines the request schema for `/credit/bank_income/get`. - class CreditBankIncomeGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String', - :'options' => :'CreditBankIncomeGetRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_get_request_options.rb b/lib/plaid/models/credit_bank_income_get_request_options.rb deleted file mode 100644 index 178634f2d..000000000 --- a/lib/plaid/models/credit_bank_income_get_request_options.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object for `/credit/bank_income/get` request options. - class CreditBankIncomeGetRequestOptions - # How many Bank Income Reports should be fetched. Multiple reports may be available if the report has been re-created or refreshed. If more than one report is available, the most recent reports will be returned first. - attr_accessor :count - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'count' => :'count' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'count' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 1 - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - count == o.count - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [count].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_get_response.rb b/lib/plaid/models/credit_bank_income_get_response.rb deleted file mode 100644 index ab3fc6e66..000000000 --- a/lib/plaid/models/credit_bank_income_get_response.rb +++ /dev/null @@ -1,237 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditBankIncomeGetResponse defines the response schema for `/credit/bank_income/get` - class CreditBankIncomeGetResponse - attr_accessor :bank_income - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_income' => :'bank_income', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_income' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_income') - if (value = attributes[:'bank_income']).is_a?(Array) - self.bank_income = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_income == o.bank_income && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_income, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_historical_summary.rb b/lib/plaid/models/credit_bank_income_historical_summary.rb deleted file mode 100644 index 41819671d..000000000 --- a/lib/plaid/models/credit_bank_income_historical_summary.rb +++ /dev/null @@ -1,286 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The end user's monthly summary for the income source(s). - class CreditBankIncomeHistoricalSummary - # Total amount of earnings for the income source(s) of the user for the month in the summary. This may return an incorrect value if the summary includes income sources in multiple currencies. Please use [`total_amounts`](https://plaid.com/docs/api/products/income/#credit-bank_income-get-response-bank-income-items-bank-income-sources-historical-summary-total-amounts) instead. - attr_accessor :total_amount - - # The ISO 4217 currency code of the amount or balance. Please use [`total_amounts`](https://plaid.com/docs/api/products/income/#credit-bank_income-get-response-bank-income-items-bank-income-sources-historical-summary-total-amounts) instead. - attr_accessor :iso_currency_code - - # 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. Please use [`total_amounts`](https://plaid.com/docs/api/products/income/#credit-bank_income-get-response-bank-income-items-bank-income-sources-historical-summary-total-amounts) instead. - attr_accessor :unofficial_currency_code - - # Total amount of earnings for the income source(s) of the user for the month in the summary. This can contain multiple amounts, with each amount denominated in one unique currency. - attr_accessor :total_amounts - - # The start date of the period covered in this monthly summary. This date will be the first day of the month, unless the month being covered is a partial month because it is the first month included in the summary and the date range being requested does not begin with the first day of the month. The date will be returned in an ISO 8601 format (YYYY-MM-DD). - attr_accessor :start_date - - # The end date of the period included in this monthly summary. This date will be the last day of the month, unless the month being covered is a partial month because it is the last month included in the summary and the date range being requested does not end with the last day of the month. The date will be returned in an ISO 8601 format (YYYY-MM-DD). - attr_accessor :end_date - - attr_accessor :transactions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_amount' => :'total_amount', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'total_amounts' => :'total_amounts', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'transactions' => :'transactions' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_amount' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'total_amounts' => :'Array', - :'start_date' => :'Date', - :'end_date' => :'Date', - :'transactions' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'iso_currency_code', - :'unofficial_currency_code', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeHistoricalSummary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeHistoricalSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_amount') - self.total_amount = attributes[:'total_amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'total_amounts') - if (value = attributes[:'total_amounts']).is_a?(Array) - self.total_amounts = value - end - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'transactions') - if (value = attributes[:'transactions']).is_a?(Array) - self.transactions = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_amount == o.total_amount && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - total_amounts == o.total_amounts && - start_date == o.start_date && - end_date == o.end_date && - transactions == o.transactions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_amount, iso_currency_code, unofficial_currency_code, total_amounts, start_date, end_date, transactions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_item.rb b/lib/plaid/models/credit_bank_income_item.rb deleted file mode 100644 index 4bf31803e..000000000 --- a/lib/plaid/models/credit_bank_income_item.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The details and metadata for an end user's Item. - class CreditBankIncomeItem - # The Item's accounts that have Bank Income data. - attr_accessor :bank_income_accounts - - # The income sources for this Item. Each entry in the array is a single income source. - attr_accessor :bank_income_sources - - # The time when this Item's data was last retrieved from the financial institution. - attr_accessor :last_updated_time - - # The unique identifier of the institution associated with the Item. - attr_accessor :institution_id - - # The name of the institution associated with the Item. - attr_accessor :institution_name - - # The unique identifier for the Item. - attr_accessor :item_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_income_accounts' => :'bank_income_accounts', - :'bank_income_sources' => :'bank_income_sources', - :'last_updated_time' => :'last_updated_time', - :'institution_id' => :'institution_id', - :'institution_name' => :'institution_name', - :'item_id' => :'item_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_income_accounts' => :'Array', - :'bank_income_sources' => :'Array', - :'last_updated_time' => :'Time', - :'institution_id' => :'String', - :'institution_name' => :'String', - :'item_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_income_accounts') - if (value = attributes[:'bank_income_accounts']).is_a?(Array) - self.bank_income_accounts = value - end - end - - if attributes.key?(:'bank_income_sources') - if (value = attributes[:'bank_income_sources']).is_a?(Array) - self.bank_income_sources = value - end - end - - if attributes.key?(:'last_updated_time') - self.last_updated_time = attributes[:'last_updated_time'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'institution_name') - self.institution_name = attributes[:'institution_name'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_income_accounts == o.bank_income_accounts && - bank_income_sources == o.bank_income_sources && - last_updated_time == o.last_updated_time && - institution_id == o.institution_id && - institution_name == o.institution_name && - item_id == o.item_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_income_accounts, bank_income_sources, last_updated_time, institution_id, institution_name, item_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_pay_frequency.rb b/lib/plaid/models/credit_bank_income_pay_frequency.rb deleted file mode 100644 index 7f0e02309..000000000 --- a/lib/plaid/models/credit_bank_income_pay_frequency.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CreditBankIncomePayFrequency - WEEKLY = "WEEKLY".freeze - BIWEEKLY = "BIWEEKLY".freeze - SEMI_MONTHLY = "SEMI_MONTHLY".freeze - MONTHLY = "MONTHLY".freeze - DAILY = "DAILY".freeze - UNKNOWN = "UNKNOWN".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/credit_bank_income_pdf_get_request.rb b/lib/plaid/models/credit_bank_income_pdf_get_request.rb deleted file mode 100644 index 9d1eecca6..000000000 --- a/lib/plaid/models/credit_bank_income_pdf_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditBankIncomePDFGetRequest defines the request schema for `/credit/bank_income/pdf/get` - class CreditBankIncomePDFGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomePDFGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomePDFGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_token.nil? - invalid_properties.push('invalid value for "user_token", user_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_refresh_request.rb b/lib/plaid/models/credit_bank_income_refresh_request.rb deleted file mode 100644 index d319b29bc..000000000 --- a/lib/plaid/models/credit_bank_income_refresh_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditBankIncomeRefreshRequest defines the request schema for `/credit/bank_income/refresh`. - class CreditBankIncomeRefreshRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String', - :'options' => :'CreditBankIncomeRefreshRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeRefreshRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeRefreshRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_token.nil? - invalid_properties.push('invalid value for "user_token", user_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_refresh_request_options.rb b/lib/plaid/models/credit_bank_income_refresh_request_options.rb deleted file mode 100644 index 703a35dd4..000000000 --- a/lib/plaid/models/credit_bank_income_refresh_request_options.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object for `/credit/bank_income/refresh` request options. - class CreditBankIncomeRefreshRequestOptions - # How many days of data to include in the refresh. If not specified, this will default to the days requested in the most recently generated bank income report for the user. - attr_accessor :days_requested - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'days_requested' => :'days_requested' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'days_requested' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeRefreshRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeRefreshRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - days_requested == o.days_requested - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [days_requested].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_refresh_response.rb b/lib/plaid/models/credit_bank_income_refresh_response.rb deleted file mode 100644 index 98231d388..000000000 --- a/lib/plaid/models/credit_bank_income_refresh_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditBankIncomeRefreshResponse defines the response schema for `/credit/bank_income/refresh`. - class CreditBankIncomeRefreshResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeRefreshResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeRefreshResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_source.rb b/lib/plaid/models/credit_bank_income_source.rb deleted file mode 100644 index 20c8c8bfc..000000000 --- a/lib/plaid/models/credit_bank_income_source.rb +++ /dev/null @@ -1,332 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Detailed information for the income source. - class CreditBankIncomeSource - # A unique identifier for an income source. - attr_accessor :income_source_id - - # The most common name or original description for the underlying income transactions. - attr_accessor :income_description - - attr_accessor :income_category - - # Plaid's unique identifier for the account. - attr_accessor :account_id - - # 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). - attr_accessor :start_date - - # Maximum 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). - attr_accessor :end_date - - attr_accessor :pay_frequency - - # Total amount of earnings in the user’s bank account for the specific income source for days requested by the client. - attr_accessor :total_amount - - # Number of transactions for the income source within the start and end date. - attr_accessor :transaction_count - - attr_accessor :historical_summary - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'income_source_id' => :'income_source_id', - :'income_description' => :'income_description', - :'income_category' => :'income_category', - :'account_id' => :'account_id', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'pay_frequency' => :'pay_frequency', - :'total_amount' => :'total_amount', - :'transaction_count' => :'transaction_count', - :'historical_summary' => :'historical_summary' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'income_source_id' => :'String', - :'income_description' => :'String', - :'income_category' => :'CreditBankIncomeCategory', - :'account_id' => :'String', - :'start_date' => :'Date', - :'end_date' => :'Date', - :'pay_frequency' => :'CreditBankIncomePayFrequency', - :'total_amount' => :'Float', - :'transaction_count' => :'Integer', - :'historical_summary' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeSource` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeSource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'income_source_id') - self.income_source_id = attributes[:'income_source_id'] - end - - if attributes.key?(:'income_description') - self.income_description = attributes[:'income_description'] - end - - if attributes.key?(:'income_category') - self.income_category = attributes[:'income_category'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'pay_frequency') - self.pay_frequency = attributes[:'pay_frequency'] - end - - if attributes.key?(:'total_amount') - self.total_amount = attributes[:'total_amount'] - end - - if attributes.key?(:'transaction_count') - self.transaction_count = attributes[:'transaction_count'] - end - - if attributes.key?(:'historical_summary') - if (value = attributes[:'historical_summary']).is_a?(Array) - self.historical_summary = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - income_source_id == o.income_source_id && - income_description == o.income_description && - income_category == o.income_category && - account_id == o.account_id && - start_date == o.start_date && - end_date == o.end_date && - pay_frequency == o.pay_frequency && - total_amount == o.total_amount && - transaction_count == o.transaction_count && - historical_summary == o.historical_summary - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [income_source_id, income_description, income_category, account_id, start_date, end_date, pay_frequency, total_amount, transaction_count, historical_summary].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_summary.rb b/lib/plaid/models/credit_bank_income_summary.rb deleted file mode 100644 index 756223eda..000000000 --- a/lib/plaid/models/credit_bank_income_summary.rb +++ /dev/null @@ -1,316 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Summary for bank income across all income sources and items (max history of 730 days). - class CreditBankIncomeSummary - # Total amount of earnings across all the income sources in the end user's Items for the days requested by the client. This may return an incorrect value if the summary includes income sources in multiple currencies. Please use [`total_amounts`](https://plaid.com/docs/api/products/income/#credit-bank_income-get-response-bank-income-bank-income-summary-total-amounts) instead. - attr_accessor :total_amount - - # The ISO 4217 currency code of the amount or balance. Please use [`total_amounts`](https://plaid.com/docs/api/products/income/#credit-bank_income-get-response-bank-income-bank-income-summary-total-amounts) instead. - attr_accessor :iso_currency_code - - # 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. Please use [`total_amounts`](https://plaid.com/docs/api/products/income/#credit-bank_income-get-response-bank-income-bank-income-summary-total-amounts) instead. - attr_accessor :unofficial_currency_code - - # Total amount of earnings across all the income sources in the end user's Items for the days requested by the client. This can contain multiple amounts, with each amount denominated in one unique currency. - attr_accessor :total_amounts - - # The earliest date within the days requested in which all income sources identified by Plaid appear in a user's account. The date will be returned in an ISO 8601 format (YYYY-MM-DD). - attr_accessor :start_date - - # 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). - attr_accessor :end_date - - # Number of income sources per end user. - attr_accessor :income_sources_count - - # Number of income categories per end user. - attr_accessor :income_categories_count - - # Number of income transactions per end user. - attr_accessor :income_transactions_count - - attr_accessor :historical_summary - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'total_amount' => :'total_amount', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'total_amounts' => :'total_amounts', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'income_sources_count' => :'income_sources_count', - :'income_categories_count' => :'income_categories_count', - :'income_transactions_count' => :'income_transactions_count', - :'historical_summary' => :'historical_summary' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'total_amount' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'total_amounts' => :'Array', - :'start_date' => :'Date', - :'end_date' => :'Date', - :'income_sources_count' => :'Integer', - :'income_categories_count' => :'Integer', - :'income_transactions_count' => :'Integer', - :'historical_summary' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'iso_currency_code', - :'unofficial_currency_code', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeSummary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'total_amount') - self.total_amount = attributes[:'total_amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'total_amounts') - if (value = attributes[:'total_amounts']).is_a?(Array) - self.total_amounts = value - end - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'income_sources_count') - self.income_sources_count = attributes[:'income_sources_count'] - end - - if attributes.key?(:'income_categories_count') - self.income_categories_count = attributes[:'income_categories_count'] - end - - if attributes.key?(:'income_transactions_count') - self.income_transactions_count = attributes[:'income_transactions_count'] - end - - if attributes.key?(:'historical_summary') - if (value = attributes[:'historical_summary']).is_a?(Array) - self.historical_summary = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - total_amount == o.total_amount && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - total_amounts == o.total_amounts && - start_date == o.start_date && - end_date == o.end_date && - income_sources_count == o.income_sources_count && - income_categories_count == o.income_categories_count && - income_transactions_count == o.income_transactions_count && - historical_summary == o.historical_summary - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [total_amount, iso_currency_code, unofficial_currency_code, total_amounts, start_date, end_date, income_sources_count, income_categories_count, income_transactions_count, historical_summary].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_transaction.rb b/lib/plaid/models/credit_bank_income_transaction.rb deleted file mode 100644 index 2a6c11f85..000000000 --- a/lib/plaid/models/credit_bank_income_transaction.rb +++ /dev/null @@ -1,305 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The transactions data for the end user's income source(s). - class CreditBankIncomeTransaction - # 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, credit card purchases are positive; credit card payment, direct deposits, and refunds are negative. - attr_accessor :amount - - # 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). - attr_accessor :date - - # The merchant name or transaction description. - attr_accessor :name - - # The string returned by the financial institution to describe the transaction. - attr_accessor :original_description - - # When true, identifies the transaction as pending or unsettled. Pending transaction details (name, type, amount, category ID) may change before they are settled. - attr_accessor :pending - - # The unique ID of the transaction. Like all Plaid identifiers, the `transaction_id` is case sensitive. - attr_accessor :transaction_id - - # The check number of the transaction. This field is only populated for check transactions. - attr_accessor :check_number - - # The ISO 4217 currency code of the amount or balance. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'date' => :'date', - :'name' => :'name', - :'original_description' => :'original_description', - :'pending' => :'pending', - :'transaction_id' => :'transaction_id', - :'check_number' => :'check_number', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Float', - :'date' => :'Date', - :'name' => :'String', - :'original_description' => :'String', - :'pending' => :'Boolean', - :'transaction_id' => :'String', - :'check_number' => :'String', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'original_description', - :'check_number', - :'iso_currency_code', - :'unofficial_currency_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'original_description') - self.original_description = attributes[:'original_description'] - end - - if attributes.key?(:'pending') - self.pending = attributes[:'pending'] - end - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - - if attributes.key?(:'check_number') - self.check_number = attributes[:'check_number'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - date == o.date && - name == o.name && - original_description == o.original_description && - pending == o.pending && - transaction_id == o.transaction_id && - check_number == o.check_number && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, date, name, original_description, pending, transaction_id, check_number, iso_currency_code, unofficial_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_warning.rb b/lib/plaid/models/credit_bank_income_warning.rb deleted file mode 100644 index 6b2e95743..000000000 --- a/lib/plaid/models/credit_bank_income_warning.rb +++ /dev/null @@ -1,260 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The warning associated with the data that was unavailable for the Bank Income Report. - class CreditBankIncomeWarning - attr_accessor :warning_type - - attr_accessor :warning_code - - attr_accessor :cause - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'warning_type' => :'warning_type', - :'warning_code' => :'warning_code', - :'cause' => :'cause' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'warning_type' => :'CreditBankIncomeWarningType', - :'warning_code' => :'CreditBankIncomeWarningCode', - :'cause' => :'CreditBankIncomeCause' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeWarning` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeWarning`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'warning_type') - self.warning_type = attributes[:'warning_type'] - end - - if attributes.key?(:'warning_code') - self.warning_code = attributes[:'warning_code'] - end - - if attributes.key?(:'cause') - self.cause = attributes[:'cause'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - warning_type == o.warning_type && - warning_code == o.warning_code && - cause == o.cause - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [warning_type, warning_code, cause].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_warning_code.rb b/lib/plaid/models/credit_bank_income_warning_code.rb deleted file mode 100644 index d6dfe6c61..000000000 --- a/lib/plaid/models/credit_bank_income_warning_code.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CreditBankIncomeWarningCode - IDENTITY_UNAVAILABLE = "IDENTITY_UNAVAILABLE".freeze - TRANSACTIONS_UNAVAILABLE = "TRANSACTIONS_UNAVAILABLE".freeze - ITEM_UNAPPROVED = "ITEM_UNAPPROVED".freeze - REPORT_DELETED = "REPORT_DELETED".freeze - DATA_UNAVAILABLE = "DATA_UNAVAILABLE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/credit_bank_income_warning_type.rb b/lib/plaid/models/credit_bank_income_warning_type.rb deleted file mode 100644 index 9e1d0c788..000000000 --- a/lib/plaid/models/credit_bank_income_warning_type.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CreditBankIncomeWarningType - BANK_INCOME_WARNING = "BANK_INCOME_WARNING".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/credit_bank_income_webhook_update_request.rb b/lib/plaid/models/credit_bank_income_webhook_update_request.rb deleted file mode 100644 index 596c9151c..000000000 --- a/lib/plaid/models/credit_bank_income_webhook_update_request.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditBankIncomeWebhookUpdateRequest defines the request schema for `/credit/bank_income/webhook/update`. - class CreditBankIncomeWebhookUpdateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - # Whether the user should be enabled for proactive webhook notifications when their income changes - attr_accessor :enable_webhooks - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token', - :'enable_webhooks' => :'enable_webhooks' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String', - :'enable_webhooks' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeWebhookUpdateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeWebhookUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - - if attributes.key?(:'enable_webhooks') - self.enable_webhooks = attributes[:'enable_webhooks'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_token.nil? - invalid_properties.push('invalid value for "user_token", user_token cannot be nil.') - end - - if @enable_webhooks.nil? - invalid_properties.push('invalid value for "enable_webhooks", enable_webhooks cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_token.nil? - return false if @enable_webhooks.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token && - enable_webhooks == o.enable_webhooks - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token, enable_webhooks].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_income_webhook_update_response.rb b/lib/plaid/models/credit_bank_income_webhook_update_response.rb deleted file mode 100644 index c2dfce89f..000000000 --- a/lib/plaid/models/credit_bank_income_webhook_update_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditBankIncomeWebhookUpdateResponse defines the response schema for `/credit/bank_income/webhook/update`. - class CreditBankIncomeWebhookUpdateResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankIncomeWebhookUpdateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankIncomeWebhookUpdateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_statement_upload_account_owner.rb b/lib/plaid/models/credit_bank_statement_upload_account_owner.rb deleted file mode 100644 index bfd7c7965..000000000 --- a/lib/plaid/models/credit_bank_statement_upload_account_owner.rb +++ /dev/null @@ -1,236 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing data about the owner of the bank account for the uploaded bank statement. - class CreditBankStatementUploadAccountOwner - # The name of the account owner - attr_accessor :name - - attr_accessor :address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'address' => :'address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'address' => :'CreditBankStatementUploadAccountOwnerAddress' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankStatementUploadAccountOwner` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankStatementUploadAccountOwner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @address.nil? - invalid_properties.push('invalid value for "address", address cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @address.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address == o.address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_statement_upload_account_owner_address.rb b/lib/plaid/models/credit_bank_statement_upload_account_owner_address.rb deleted file mode 100644 index df7c334e4..000000000 --- a/lib/plaid/models/credit_bank_statement_upload_account_owner_address.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Address on the uploaded bank statement - class CreditBankStatementUploadAccountOwnerAddress - # The full city name. - attr_accessor :city - - # The ISO 3166-1 alpha-2 country code. - attr_accessor :country - - # The postal code of the address. - attr_accessor :postal_code - - # The region or state. Example: `\"NC\"` - attr_accessor :region - - # The full street address. - attr_accessor :street - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'country' => :'country', - :'postal_code' => :'postal_code', - :'region' => :'region', - :'street' => :'street' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'country' => :'String', - :'postal_code' => :'String', - :'region' => :'String', - :'street' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'city', - :'country', - :'postal_code', - :'region', - :'street' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankStatementUploadAccountOwnerAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankStatementUploadAccountOwnerAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - country == o.country && - postal_code == o.postal_code && - region == o.region && - street == o.street - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, country, postal_code, region, street].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_statement_upload_bank_account.rb b/lib/plaid/models/credit_bank_statement_upload_bank_account.rb deleted file mode 100644 index 41bfb498f..000000000 --- a/lib/plaid/models/credit_bank_statement_upload_bank_account.rb +++ /dev/null @@ -1,297 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing data about a user's bank account related to an uploaded bank statement. - class CreditBankStatementUploadBankAccount - # The name of the bank account - attr_accessor :name - - # The name of the bank institution. - attr_accessor :bank_name - - # The type of the bank account. - attr_accessor :account_type - - # The bank account number. - attr_accessor :account_number - - attr_accessor :owner - - # An array of period objects, containing more data on the overall period of the statement. - attr_accessor :periods - - # The unique id of the bank account - attr_accessor :account_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'bank_name' => :'bank_name', - :'account_type' => :'account_type', - :'account_number' => :'account_number', - :'owner' => :'owner', - :'periods' => :'periods', - :'account_id' => :'account_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'bank_name' => :'String', - :'account_type' => :'String', - :'account_number' => :'String', - :'owner' => :'CreditBankStatementUploadAccountOwner', - :'periods' => :'Array', - :'account_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'bank_name', - :'account_type', - :'account_number', - :'account_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankStatementUploadBankAccount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankStatementUploadBankAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'bank_name') - self.bank_name = attributes[:'bank_name'] - end - - if attributes.key?(:'account_type') - self.account_type = attributes[:'account_type'] - end - - if attributes.key?(:'account_number') - self.account_number = attributes[:'account_number'] - end - - if attributes.key?(:'owner') - self.owner = attributes[:'owner'] - end - - if attributes.key?(:'periods') - if (value = attributes[:'periods']).is_a?(Array) - self.periods = value - end - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @owner.nil? - invalid_properties.push('invalid value for "owner", owner cannot be nil.') - end - - if @periods.nil? - invalid_properties.push('invalid value for "periods", periods cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @owner.nil? - return false if @periods.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - bank_name == o.bank_name && - account_type == o.account_type && - account_number == o.account_number && - owner == o.owner && - periods == o.periods && - account_id == o.account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, bank_name, account_type, account_number, owner, periods, account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_statement_upload_bank_account_period.rb b/lib/plaid/models/credit_bank_statement_upload_bank_account_period.rb deleted file mode 100644 index dddfcdd0a..000000000 --- a/lib/plaid/models/credit_bank_statement_upload_bank_account_period.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing data on the overall period of the statement. - class CreditBankStatementUploadBankAccountPeriod - # The start date of the statement period in ISO 8601 format (YYYY-MM-DD). - attr_accessor :start_date - - # The end date of the statement period in ISO 8601 format (YYYY-MM-DD). - attr_accessor :end_date - - # The starting balance of the bank account for the period. - attr_accessor :starting_balance - - # The ending balance of the bank account for the period. - attr_accessor :ending_balance - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'starting_balance' => :'starting_balance', - :'ending_balance' => :'ending_balance' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_date' => :'Date', - :'end_date' => :'Date', - :'starting_balance' => :'Float', - :'ending_balance' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'start_date', - :'end_date', - :'starting_balance', - :'ending_balance' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankStatementUploadBankAccountPeriod` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankStatementUploadBankAccountPeriod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'starting_balance') - self.starting_balance = attributes[:'starting_balance'] - end - - if attributes.key?(:'ending_balance') - self.ending_balance = attributes[:'ending_balance'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_date == o.start_date && - end_date == o.end_date && - starting_balance == o.starting_balance && - ending_balance == o.ending_balance - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_date, end_date, starting_balance, ending_balance].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_statement_upload_item.rb b/lib/plaid/models/credit_bank_statement_upload_item.rb deleted file mode 100644 index 1bd310a7a..000000000 --- a/lib/plaid/models/credit_bank_statement_upload_item.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing information about the bank statement upload Item. - class CreditBankStatementUploadItem - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :bank_statements - - attr_accessor :status - - # Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DDTHH:mm:ssZ) indicating the last time that the Item was updated. - attr_accessor :updated_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_id' => :'item_id', - :'bank_statements' => :'bank_statements', - :'status' => :'status', - :'updated_at' => :'updated_at' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_id' => :'String', - :'bank_statements' => :'Array', - :'status' => :'PayrollItemStatus', - :'updated_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'status', - :'updated_at' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankStatementUploadItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankStatementUploadItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'bank_statements') - if (value = attributes[:'bank_statements']).is_a?(Array) - self.bank_statements = value - end - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'updated_at') - self.updated_at = attributes[:'updated_at'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @bank_statements.nil? - invalid_properties.push('invalid value for "bank_statements", bank_statements cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_id.nil? - return false if @bank_statements.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_id == o.item_id && - bank_statements == o.bank_statements && - status == o.status && - updated_at == o.updated_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_id, bank_statements, status, updated_at].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_statement_upload_object.rb b/lib/plaid/models/credit_bank_statement_upload_object.rb deleted file mode 100644 index 9cd82a98e..000000000 --- a/lib/plaid/models/credit_bank_statement_upload_object.rb +++ /dev/null @@ -1,270 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing data that has been parsed from a user-uploaded bank statement. - class CreditBankStatementUploadObject - # An array of transactions appearing on the bank statement. - attr_accessor :transactions - - attr_accessor :document_metadata - - # An identifier of the document referenced by the document metadata. - attr_accessor :document_id - - # An array of bank accounts associated with the uploaded bank statement. - attr_accessor :bank_accounts - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transactions' => :'transactions', - :'document_metadata' => :'document_metadata', - :'document_id' => :'document_id', - :'bank_accounts' => :'bank_accounts' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transactions' => :'Array', - :'document_metadata' => :'CreditDocumentMetadata', - :'document_id' => :'String', - :'bank_accounts' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'document_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankStatementUploadObject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankStatementUploadObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transactions') - if (value = attributes[:'transactions']).is_a?(Array) - self.transactions = value - end - end - - if attributes.key?(:'document_metadata') - self.document_metadata = attributes[:'document_metadata'] - end - - if attributes.key?(:'document_id') - self.document_id = attributes[:'document_id'] - end - - if attributes.key?(:'bank_accounts') - if (value = attributes[:'bank_accounts']).is_a?(Array) - self.bank_accounts = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transactions.nil? - invalid_properties.push('invalid value for "transactions", transactions cannot be nil.') - end - - if @document_metadata.nil? - invalid_properties.push('invalid value for "document_metadata", document_metadata cannot be nil.') - end - - if @bank_accounts.nil? - invalid_properties.push('invalid value for "bank_accounts", bank_accounts cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transactions.nil? - return false if @document_metadata.nil? - return false if @bank_accounts.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transactions == o.transactions && - document_metadata == o.document_metadata && - document_id == o.document_id && - bank_accounts == o.bank_accounts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transactions, document_metadata, document_id, bank_accounts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_statement_upload_transaction.rb b/lib/plaid/models/credit_bank_statement_upload_transaction.rb deleted file mode 100644 index 526df2b46..000000000 --- a/lib/plaid/models/credit_bank_statement_upload_transaction.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing data about a transaction appearing on a user-uploaded bank statement. - class CreditBankStatementUploadTransaction - # The value of the transaction. A negative amount indicates that money moved into the account (such as a paycheck being deposited). - attr_accessor :amount - - # The date of when the transaction was made, in ISO 8601 format (YYYY-MM-DD). - attr_accessor :date - - # The raw description of the transaction as it appears on the bank statement. - attr_accessor :original_description - - # The unique id of the bank account that this transaction occurs in - attr_accessor :account_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'date' => :'date', - :'original_description' => :'original_description', - :'account_id' => :'account_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Float', - :'date' => :'Date', - :'original_description' => :'String', - :'account_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'amount', - :'date', - :'original_description', - :'account_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankStatementUploadTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankStatementUploadTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'original_description') - self.original_description = attributes[:'original_description'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - date == o.date && - original_description == o.original_description && - account_id == o.account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, date, original_description, account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_statements_uploads_get_request.rb b/lib/plaid/models/credit_bank_statements_uploads_get_request.rb deleted file mode 100644 index 24de41a00..000000000 --- a/lib/plaid/models/credit_bank_statements_uploads_get_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditBankStatementsUploadsGetRequest defines the request schema for `/credit/bank_statements/uploads/get` - class CreditBankStatementsUploadsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String', - :'options' => :'CreditBankStatementsUploadsGetRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankStatementsUploadsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankStatementsUploadsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_token.nil? - invalid_properties.push('invalid value for "user_token", user_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_statements_uploads_get_request_options.rb b/lib/plaid/models/credit_bank_statements_uploads_get_request_options.rb deleted file mode 100644 index 8186db989..000000000 --- a/lib/plaid/models/credit_bank_statements_uploads_get_request_options.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object for `/credit/bank_statements/uploads/get` request options. - class 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. - attr_accessor :item_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_ids' => :'item_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankStatementsUploadsGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankStatementsUploadsGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_ids') - if (value = attributes[:'item_ids']).is_a?(Array) - self.item_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_ids == o.item_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_bank_statements_uploads_get_response.rb b/lib/plaid/models/credit_bank_statements_uploads_get_response.rb deleted file mode 100644 index 875567efd..000000000 --- a/lib/plaid/models/credit_bank_statements_uploads_get_response.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditBankStatementsUploadsGetResponse defines the response schema for `/credit/bank_statements/uploads/get` - class CreditBankStatementsUploadsGetResponse - # Array of bank statement upload items. - attr_accessor :items - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'items' => :'items', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'items' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditBankStatementsUploadsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditBankStatementsUploadsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @items.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - items == o.items && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [items, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_card_liability.rb b/lib/plaid/models/credit_card_liability.rb deleted file mode 100644 index d98fb1e6b..000000000 --- a/lib/plaid/models/credit_card_liability.rb +++ /dev/null @@ -1,316 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing a credit card account. - class CreditCardLiability - # The ID of the account that this liability belongs to. - attr_accessor :account_id - - # The various interest rates that apply to the account. APR information is not provided by all card issuers; if APR data is not available, this array will be empty. - attr_accessor :aprs - - # true if a payment is currently overdue. Availability for this field is limited. - attr_accessor :is_overdue - - # The amount of the last payment. - attr_accessor :last_payment_amount - - # The date of the last payment. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). Availability for this field is limited. - attr_accessor :last_payment_date - - # The date of the last statement. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). - attr_accessor :last_statement_issue_date - - # The total amount owed as of the last statement issued - attr_accessor :last_statement_balance - - # The minimum payment due for the next billing cycle. - attr_accessor :minimum_payment_amount - - # The due date for the next payment. The due date is `null` if a payment is not expected. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). - attr_accessor :next_payment_due_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'aprs' => :'aprs', - :'is_overdue' => :'is_overdue', - :'last_payment_amount' => :'last_payment_amount', - :'last_payment_date' => :'last_payment_date', - :'last_statement_issue_date' => :'last_statement_issue_date', - :'last_statement_balance' => :'last_statement_balance', - :'minimum_payment_amount' => :'minimum_payment_amount', - :'next_payment_due_date' => :'next_payment_due_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'aprs' => :'Array', - :'is_overdue' => :'Boolean', - :'last_payment_amount' => :'Float', - :'last_payment_date' => :'Date', - :'last_statement_issue_date' => :'Date', - :'last_statement_balance' => :'Float', - :'minimum_payment_amount' => :'Float', - :'next_payment_due_date' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_id', - :'is_overdue', - :'last_payment_amount', - :'last_payment_date', - :'last_statement_issue_date', - :'last_statement_balance', - :'minimum_payment_amount', - :'next_payment_due_date' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditCardLiability` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditCardLiability`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'aprs') - if (value = attributes[:'aprs']).is_a?(Array) - self.aprs = value - end - end - - if attributes.key?(:'is_overdue') - self.is_overdue = attributes[:'is_overdue'] - end - - if attributes.key?(:'last_payment_amount') - self.last_payment_amount = attributes[:'last_payment_amount'] - end - - if attributes.key?(:'last_payment_date') - self.last_payment_date = attributes[:'last_payment_date'] - end - - if attributes.key?(:'last_statement_issue_date') - self.last_statement_issue_date = attributes[:'last_statement_issue_date'] - end - - if attributes.key?(:'last_statement_balance') - self.last_statement_balance = attributes[:'last_statement_balance'] - end - - if attributes.key?(:'minimum_payment_amount') - self.minimum_payment_amount = attributes[:'minimum_payment_amount'] - end - - if attributes.key?(:'next_payment_due_date') - self.next_payment_due_date = attributes[:'next_payment_due_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @aprs.nil? - invalid_properties.push('invalid value for "aprs", aprs cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @aprs.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - aprs == o.aprs && - is_overdue == o.is_overdue && - last_payment_amount == o.last_payment_amount && - last_payment_date == o.last_payment_date && - last_statement_issue_date == o.last_statement_issue_date && - last_statement_balance == o.last_statement_balance && - minimum_payment_amount == o.minimum_payment_amount && - next_payment_due_date == o.next_payment_due_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, aprs, is_overdue, last_payment_amount, last_payment_date, last_statement_issue_date, last_statement_balance, minimum_payment_amount, next_payment_due_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_category.rb b/lib/plaid/models/credit_category.rb deleted file mode 100644 index d121796b1..000000000 --- a/lib/plaid/models/credit_category.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information describing the intent of the transaction. Most relevant for credit use cases, but not limited to such use cases. See the [`taxonomy csv file`](https://plaid.com/documents/credit-category-taxonomy.csv) for a full list of credit categories. - class CreditCategory - # A high level category that communicates the broad category of the transaction. - attr_accessor :primary - - # A granular category conveying the transaction's intent. This field can also be used as a unique identifier for the category. - attr_accessor :detailed - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'primary' => :'primary', - :'detailed' => :'detailed' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'primary' => :'String', - :'detailed' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditCategory` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditCategory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'primary') - self.primary = attributes[:'primary'] - end - - if attributes.key?(:'detailed') - self.detailed = attributes[:'detailed'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @primary.nil? - invalid_properties.push('invalid value for "primary", primary cannot be nil.') - end - - if @detailed.nil? - invalid_properties.push('invalid value for "detailed", detailed cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @primary.nil? - return false if @detailed.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - primary == o.primary && - detailed == o.detailed - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [primary, detailed].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_document_metadata.rb b/lib/plaid/models/credit_document_metadata.rb deleted file mode 100644 index 309f4aa57..000000000 --- a/lib/plaid/models/credit_document_metadata.rb +++ /dev/null @@ -1,270 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Object representing metadata pertaining to the document. - class CreditDocumentMetadata - # The name of the document. - attr_accessor :name - - # The type of document. `PAYSTUB`: A paystub. `BANK_STATEMENT`: A bank statement. `US_TAX_W2`: A W-2 wage and tax statement provided by a US employer reflecting wages earned by the employee. `US_MILITARY_ERAS`: An electronic Retirement Account Statement (eRAS) issued by the US military. `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. `GIG`: Used to indicate that the income is related to gig work. Does not necessarily correspond to a specific document type. `PLAID_GENERATED_PAYSTUB_PDF`: Used to indicate that the PDF for the paystub was generated by Plaid. `NONE`: Used to indicate that there is no underlying document for the data. `UNKNOWN`: Document type could not be determined. - attr_accessor :document_type - - # 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. 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. - attr_accessor :download_url - - # 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. - attr_accessor :status - - # The number of pages of the uploaded document (if available). - attr_accessor :page_count - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'document_type' => :'document_type', - :'download_url' => :'download_url', - :'status' => :'status', - :'page_count' => :'page_count' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'document_type' => :'String', - :'download_url' => :'String', - :'status' => :'String', - :'page_count' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'document_type', - :'download_url', - :'status', - :'page_count' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditDocumentMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditDocumentMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'document_type') - self.document_type = attributes[:'document_type'] - end - - if attributes.key?(:'download_url') - self.download_url = attributes[:'download_url'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'page_count') - self.page_count = attributes[:'page_count'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - document_type == o.document_type && - download_url == o.download_url && - status == o.status && - page_count == o.page_count - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, document_type, download_url, status, page_count].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_employer_verification.rb b/lib/plaid/models/credit_employer_verification.rb deleted file mode 100644 index 07a4579b1..000000000 --- a/lib/plaid/models/credit_employer_verification.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing employer data. - class CreditEmployerVerification - # Name of employer. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditEmployerVerification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditEmployerVerification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_employment_get_request.rb b/lib/plaid/models/credit_employment_get_request.rb deleted file mode 100644 index 4f21d25e3..000000000 --- a/lib/plaid/models/credit_employment_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditEmploymentGetRequest defines the request schema for `/credit/employment/get`. - class CreditEmploymentGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditEmploymentGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditEmploymentGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_token.nil? - invalid_properties.push('invalid value for "user_token", user_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_employment_get_response.rb b/lib/plaid/models/credit_employment_get_response.rb deleted file mode 100644 index 87b74dc5e..000000000 --- a/lib/plaid/models/credit_employment_get_response.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditEmploymentGetResponse defines the response schema for `/credit/employment/get`. - class CreditEmploymentGetResponse - # Array of employment items. - attr_accessor :items - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'items' => :'items', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'items' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditEmploymentGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditEmploymentGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @items.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - items == o.items && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [items, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_employment_item.rb b/lib/plaid/models/credit_employment_item.rb deleted file mode 100644 index 3f1b0dc5a..000000000 --- a/lib/plaid/models/credit_employment_item.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The object containing employment items. - class CreditEmploymentItem - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :employments - - # Token to represent the underlying Employment data - attr_accessor :employment_report_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_id' => :'item_id', - :'employments' => :'employments', - :'employment_report_token' => :'employment_report_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_id' => :'String', - :'employments' => :'Array', - :'employment_report_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditEmploymentItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditEmploymentItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'employments') - if (value = attributes[:'employments']).is_a?(Array) - self.employments = value - end - end - - if attributes.key?(:'employment_report_token') - self.employment_report_token = attributes[:'employment_report_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @employments.nil? - invalid_properties.push('invalid value for "employments", employments cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_id.nil? - return false if @employments.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_id == o.item_id && - employments == o.employments && - employment_report_token == o.employment_report_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_id, employments, employment_report_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_employment_verification.rb b/lib/plaid/models/credit_employment_verification.rb deleted file mode 100644 index 357e41643..000000000 --- a/lib/plaid/models/credit_employment_verification.rb +++ /dev/null @@ -1,316 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The object containing proof of employment data for an individual. - class CreditEmploymentVerification - # ID of the payroll provider account. - attr_accessor :account_id - - # Current employment status. - attr_accessor :status - - # Start of employment in ISO 8601 format (YYYY-MM-DD). - attr_accessor :start_date - - # End of employment, if applicable. Provided in ISO 8601 format (YYY-MM-DD). - attr_accessor :end_date - - attr_accessor :employer - - # Current title of employee. - attr_accessor :title - - attr_accessor :platform_ids - - # The type of employment for the individual. `\"FULL_TIME\"`: A full-time employee. `\"PART_TIME\"`: A part-time employee. `\"CONTRACTOR\"`: An employee typically hired externally through a contracting group. `\"TEMPORARY\"`: A temporary employee. `\"OTHER\"`: The employee type is not one of the above defined types. - attr_accessor :employee_type - - # The date of the employee's most recent paystub in ISO 8601 format (YYYY-MM-DD). - attr_accessor :last_paystub_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'status' => :'status', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'employer' => :'employer', - :'title' => :'title', - :'platform_ids' => :'platform_ids', - :'employee_type' => :'employee_type', - :'last_paystub_date' => :'last_paystub_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'status' => :'String', - :'start_date' => :'Date', - :'end_date' => :'Date', - :'employer' => :'CreditEmployerVerification', - :'title' => :'String', - :'platform_ids' => :'CreditPlatformIds', - :'employee_type' => :'String', - :'last_paystub_date' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_id', - :'status', - :'start_date', - :'end_date', - :'title', - :'employee_type', - :'last_paystub_date' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditEmploymentVerification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditEmploymentVerification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'employer') - self.employer = attributes[:'employer'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'platform_ids') - self.platform_ids = attributes[:'platform_ids'] - end - - if attributes.key?(:'employee_type') - self.employee_type = attributes[:'employee_type'] - end - - if attributes.key?(:'last_paystub_date') - self.last_paystub_date = attributes[:'last_paystub_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @employer.nil? - invalid_properties.push('invalid value for "employer", employer cannot be nil.') - end - - if @platform_ids.nil? - invalid_properties.push('invalid value for "platform_ids", platform_ids cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @employer.nil? - return false if @platform_ids.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - status == o.status && - start_date == o.start_date && - end_date == o.end_date && - employer == o.employer && - title == o.title && - platform_ids == o.platform_ids && - employee_type == o.employee_type && - last_paystub_date == o.last_paystub_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, status, start_date, end_date, employer, title, platform_ids, employee_type, last_paystub_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_filter.rb b/lib/plaid/models/credit_filter.rb deleted file mode 100644 index e64ef3c1f..000000000 --- a/lib/plaid/models/credit_filter.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A filter to apply to `credit`-type accounts - class 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). - attr_accessor :account_subtypes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_subtypes' => :'account_subtypes' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_subtypes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_subtypes') - if (value = attributes[:'account_subtypes']).is_a?(Array) - self.account_subtypes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_subtypes.nil? - invalid_properties.push('invalid value for "account_subtypes", account_subtypes cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_subtypes.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_subtypes == o.account_subtypes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_subtypes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_asset.rb b/lib/plaid/models/credit_freddie_mac_asset.rb deleted file mode 100644 index 9482e3e9a..000000000 --- a/lib/plaid/models/credit_freddie_mac_asset.rb +++ /dev/null @@ -1,281 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class CreditFreddieMacAsset - attr_accessor :asset_detail - - attr_accessor :asset_owners - - attr_accessor :asset_holder - - attr_accessor :asset_transactions - - attr_accessor :validation_sources - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_detail' => :'ASSET_DETAIL', - :'asset_owners' => :'ASSET_OWNERS', - :'asset_holder' => :'ASSET_HOLDER', - :'asset_transactions' => :'ASSET_TRANSACTIONS', - :'validation_sources' => :'VALIDATION_SOURCES' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_detail' => :'AssetDetail', - :'asset_owners' => :'AssetOwners', - :'asset_holder' => :'AssetHolder', - :'asset_transactions' => :'CreditFreddieMacAssetTransactions', - :'validation_sources' => :'ValidationSources' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacAsset` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacAsset`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_detail') - self.asset_detail = attributes[:'asset_detail'] - end - - if attributes.key?(:'asset_owners') - self.asset_owners = attributes[:'asset_owners'] - end - - if attributes.key?(:'asset_holder') - self.asset_holder = attributes[:'asset_holder'] - end - - if attributes.key?(:'asset_transactions') - self.asset_transactions = attributes[:'asset_transactions'] - end - - if attributes.key?(:'validation_sources') - self.validation_sources = attributes[:'validation_sources'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_detail.nil? - invalid_properties.push('invalid value for "asset_detail", asset_detail cannot be nil.') - end - - if @asset_owners.nil? - invalid_properties.push('invalid value for "asset_owners", asset_owners cannot be nil.') - end - - if @asset_holder.nil? - invalid_properties.push('invalid value for "asset_holder", asset_holder cannot be nil.') - end - - if @asset_transactions.nil? - invalid_properties.push('invalid value for "asset_transactions", asset_transactions cannot be nil.') - end - - if @validation_sources.nil? - invalid_properties.push('invalid value for "validation_sources", validation_sources cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_detail.nil? - return false if @asset_owners.nil? - return false if @asset_holder.nil? - return false if @asset_transactions.nil? - return false if @validation_sources.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_detail == o.asset_detail && - asset_owners == o.asset_owners && - asset_holder == o.asset_holder && - asset_transactions == o.asset_transactions && - validation_sources == o.validation_sources - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_detail, asset_owners, asset_holder, asset_transactions, validation_sources].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_asset_transaction.rb b/lib/plaid/models/credit_freddie_mac_asset_transaction.rb deleted file mode 100644 index 0f3474fc6..000000000 --- a/lib/plaid/models/credit_freddie_mac_asset_transaction.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing... - class CreditFreddieMacAssetTransaction - attr_accessor :asset_transaction_detail - - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - attr_accessor :asset_transaction_description - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_transaction_detail' => :'ASSET_TRANSACTION_DETAIL', - :'asset_transaction_description' => :'ASSET_TRANSACTION_DESCRIPTION' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_transaction_detail' => :'AssetTransactionDetail', - :'asset_transaction_description' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacAssetTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacAssetTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_transaction_detail') - self.asset_transaction_detail = attributes[:'asset_transaction_detail'] - end - - if attributes.key?(:'asset_transaction_description') - if (value = attributes[:'asset_transaction_description']).is_a?(Array) - self.asset_transaction_description = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_transaction_detail.nil? - invalid_properties.push('invalid value for "asset_transaction_detail", asset_transaction_detail cannot be nil.') - end - - if @asset_transaction_description.nil? - invalid_properties.push('invalid value for "asset_transaction_description", asset_transaction_description cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_transaction_detail.nil? - return false if @asset_transaction_description.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_transaction_detail == o.asset_transaction_detail && - asset_transaction_description == o.asset_transaction_description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_transaction_detail, asset_transaction_description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_asset_transactions.rb b/lib/plaid/models/credit_freddie_mac_asset_transactions.rb deleted file mode 100644 index d1d90bb6d..000000000 --- a/lib/plaid/models/credit_freddie_mac_asset_transactions.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class CreditFreddieMacAssetTransactions - attr_accessor :asset_transaction - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_transaction' => :'ASSET_TRANSACTION' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_transaction' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacAssetTransactions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacAssetTransactions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_transaction') - if (value = attributes[:'asset_transaction']).is_a?(Array) - self.asset_transaction = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_transaction.nil? - invalid_properties.push('invalid value for "asset_transaction", asset_transaction cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_transaction.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_transaction == o.asset_transaction - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_transaction].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_assets.rb b/lib/plaid/models/credit_freddie_mac_assets.rb deleted file mode 100644 index 62b535663..000000000 --- a/lib/plaid/models/credit_freddie_mac_assets.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class CreditFreddieMacAssets - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - attr_accessor :asset - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset' => :'ASSET' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacAssets` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacAssets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset') - if (value = attributes[:'asset']).is_a?(Array) - self.asset = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset.nil? - invalid_properties.push('invalid value for "asset", asset cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset == o.asset - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_individual_name.rb b/lib/plaid/models/credit_freddie_mac_individual_name.rb deleted file mode 100644 index bc1b2ee52..000000000 --- a/lib/plaid/models/credit_freddie_mac_individual_name.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class CreditFreddieMacIndividualName - # The first name of the individual represented by the parent object. - attr_accessor :first_name - - # The last name of the individual represented by the parent object. - attr_accessor :last_name - - # The middle name of the individual represented by the parent object. - attr_accessor :middle_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'first_name' => :'FirstName', - :'last_name' => :'LastName', - :'middle_name' => :'MiddleName' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'first_name' => :'String', - :'last_name' => :'String', - :'middle_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacIndividualName` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacIndividualName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - end - - if attributes.key?(:'last_name') - self.last_name = attributes[:'last_name'] - end - - if attributes.key?(:'middle_name') - self.middle_name = attributes[:'middle_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @first_name.nil? - invalid_properties.push('invalid value for "first_name", first_name cannot be nil.') - end - - if @last_name.nil? - invalid_properties.push('invalid value for "last_name", last_name cannot be nil.') - end - - if @middle_name.nil? - invalid_properties.push('invalid value for "middle_name", middle_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @first_name.nil? - return false if @last_name.nil? - return false if @middle_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - first_name == o.first_name && - last_name == o.last_name && - middle_name == o.middle_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [first_name, last_name, middle_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_loan.rb b/lib/plaid/models/credit_freddie_mac_loan.rb deleted file mode 100644 index d7d503f12..000000000 --- a/lib/plaid/models/credit_freddie_mac_loan.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information specific to a mortgage loan agreement between one or more borrowers and a mortgage lender. - class CreditFreddieMacLoan - attr_accessor :loan_identifiers - - # Type of loan. The value can only be \"SubjectLoan\" - attr_accessor :loan_role_type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'loan_identifiers' => :'LOAN_IDENTIFIERS', - :'loan_role_type' => :'LoanRoleType' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'loan_identifiers' => :'CreditFreddieMacLoanIdentifiers', - :'loan_role_type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacLoan` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacLoan`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'loan_identifiers') - self.loan_identifiers = attributes[:'loan_identifiers'] - end - - if attributes.key?(:'loan_role_type') - self.loan_role_type = attributes[:'loan_role_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @loan_identifiers.nil? - invalid_properties.push('invalid value for "loan_identifiers", loan_identifiers cannot be nil.') - end - - if @loan_role_type.nil? - invalid_properties.push('invalid value for "loan_role_type", loan_role_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @loan_identifiers.nil? - return false if @loan_role_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - loan_identifiers == o.loan_identifiers && - loan_role_type == o.loan_role_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [loan_identifiers, loan_role_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_loan_identifiers.rb b/lib/plaid/models/credit_freddie_mac_loan_identifiers.rb deleted file mode 100644 index 72858d545..000000000 --- a/lib/plaid/models/credit_freddie_mac_loan_identifiers.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Collection of current and previous identifiers for this loan. - class CreditFreddieMacLoanIdentifiers - attr_accessor :loan_identifier - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'loan_identifier' => :'LOAN_IDENTIFIER' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'loan_identifier' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacLoanIdentifiers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacLoanIdentifiers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'loan_identifier') - if (value = attributes[:'loan_identifier']).is_a?(Array) - self.loan_identifier = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @loan_identifier.nil? - invalid_properties.push('invalid value for "loan_identifier", loan_identifier cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @loan_identifier.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - loan_identifier == o.loan_identifier - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [loan_identifier].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_loans.rb b/lib/plaid/models/credit_freddie_mac_loans.rb deleted file mode 100644 index cc1c3fbff..000000000 --- a/lib/plaid/models/credit_freddie_mac_loans.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A collection of loans that are part of a single deal. - class CreditFreddieMacLoans - attr_accessor :loan - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'loan' => :'LOAN' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'loan' => :'CreditFreddieMacLoan' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacLoans` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacLoans`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'loan') - self.loan = attributes[:'loan'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @loan.nil? - invalid_properties.push('invalid value for "loan", loan cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @loan.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - loan == o.loan - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [loan].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_parties.rb b/lib/plaid/models/credit_freddie_mac_parties.rb deleted file mode 100644 index 3164ffacc..000000000 --- a/lib/plaid/models/credit_freddie_mac_parties.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A collection of objects that define specific parties to a deal. This includes the direct participating parties, such as borrower and seller and the indirect parties such as the credit report provider. - class CreditFreddieMacParties - attr_accessor :party - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'party' => :'PARTY' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'party' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacParties` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacParties`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'party') - if (value = attributes[:'party']).is_a?(Array) - self.party = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @party.nil? - invalid_properties.push('invalid value for "party", party cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @party.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - party == o.party - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [party].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_party.rb b/lib/plaid/models/credit_freddie_mac_party.rb deleted file mode 100644 index 17c5a26f9..000000000 --- a/lib/plaid/models/credit_freddie_mac_party.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class CreditFreddieMacParty - attr_accessor :individual - - attr_accessor :roles - - attr_accessor :taxpayer_identifiers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'individual' => :'INDIVIDUAL', - :'roles' => :'ROLES', - :'taxpayer_identifiers' => :'TAXPAYER_IDENTIFIERS' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'individual' => :'CreditFreddieMacPartyIndividual', - :'roles' => :'Roles', - :'taxpayer_identifiers' => :'TaxpayerIdentifiers' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacParty` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacParty`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'individual') - self.individual = attributes[:'individual'] - end - - if attributes.key?(:'roles') - self.roles = attributes[:'roles'] - end - - if attributes.key?(:'taxpayer_identifiers') - self.taxpayer_identifiers = attributes[:'taxpayer_identifiers'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @individual.nil? - invalid_properties.push('invalid value for "individual", individual cannot be nil.') - end - - if @roles.nil? - invalid_properties.push('invalid value for "roles", roles cannot be nil.') - end - - if @taxpayer_identifiers.nil? - invalid_properties.push('invalid value for "taxpayer_identifiers", taxpayer_identifiers cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @individual.nil? - return false if @roles.nil? - return false if @taxpayer_identifiers.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - individual == o.individual && - roles == o.roles && - taxpayer_identifiers == o.taxpayer_identifiers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [individual, roles, taxpayer_identifiers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_party_individual.rb b/lib/plaid/models/credit_freddie_mac_party_individual.rb deleted file mode 100644 index ad7a57096..000000000 --- a/lib/plaid/models/credit_freddie_mac_party_individual.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class CreditFreddieMacPartyIndividual - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'NAME' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'CreditFreddieMacIndividualName' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacPartyIndividual` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacPartyIndividual`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_reporting_information.rb b/lib/plaid/models/credit_freddie_mac_reporting_information.rb deleted file mode 100644 index 72d3ff1b4..000000000 --- a/lib/plaid/models/credit_freddie_mac_reporting_information.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about an report identifier and a report name. - class CreditFreddieMacReportingInformation - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - attr_accessor :report_date_time - - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. The value can only be \"ReportID\" - attr_accessor :report_identifier_type - - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - attr_accessor :reporting_information_parent_identifier - - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - attr_accessor :reporting_information_identifier - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report_date_time' => :'ReportDateTime', - :'report_identifier_type' => :'ReportIdentifierType', - :'reporting_information_parent_identifier' => :'ReportingInformationParentIdentifier', - :'reporting_information_identifier' => :'ReportingInformationIdentifier' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'report_date_time' => :'String', - :'report_identifier_type' => :'String', - :'reporting_information_parent_identifier' => :'String', - :'reporting_information_identifier' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacReportingInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacReportingInformation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report_date_time') - self.report_date_time = attributes[:'report_date_time'] - end - - if attributes.key?(:'report_identifier_type') - self.report_identifier_type = attributes[:'report_identifier_type'] - end - - if attributes.key?(:'reporting_information_parent_identifier') - self.reporting_information_parent_identifier = attributes[:'reporting_information_parent_identifier'] - end - - if attributes.key?(:'reporting_information_identifier') - self.reporting_information_identifier = attributes[:'reporting_information_identifier'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @reporting_information_identifier.nil? - invalid_properties.push('invalid value for "reporting_information_identifier", reporting_information_identifier cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @reporting_information_identifier.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report_date_time == o.report_date_time && - report_identifier_type == o.report_identifier_type && - reporting_information_parent_identifier == o.reporting_information_parent_identifier && - reporting_information_identifier == o.reporting_information_identifier - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report_date_time, report_identifier_type, reporting_information_parent_identifier, reporting_information_identifier].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_reports_get_request.rb b/lib/plaid/models/credit_freddie_mac_reports_get_request.rb deleted file mode 100644 index b1b74d719..000000000 --- a/lib/plaid/models/credit_freddie_mac_reports_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditFreddieMacReportsGetRequest defines the request schema for `credit/asset_report/freddie_mac/get` - class CreditFreddieMacReportsGetRequest - # A token that can be shared with a third party auditor to allow them to obtain access to the Asset Report. This token should be stored securely. - attr_accessor :audit_copy_token - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'audit_copy_token' => :'audit_copy_token', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'audit_copy_token' => :'String', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacReportsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacReportsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'audit_copy_token') - self.audit_copy_token = attributes[:'audit_copy_token'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @audit_copy_token.nil? - invalid_properties.push('invalid value for "audit_copy_token", audit_copy_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @audit_copy_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - audit_copy_token == o.audit_copy_token && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [audit_copy_token, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_reports_get_response.rb b/lib/plaid/models/credit_freddie_mac_reports_get_response.rb deleted file mode 100644 index b8896e7b4..000000000 --- a/lib/plaid/models/credit_freddie_mac_reports_get_response.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditFreddieMacReportsGetResponse defines the response schema for `/credit/freddie_mac/reports/get` - class CreditFreddieMacReportsGetResponse - attr_accessor :deal - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # The Verification Of Assets (VOA) schema version. - attr_accessor :schema_version - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deal' => :'DEAL', - :'request_id' => :'request_id', - :'schema_version' => :'SchemaVersion' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deal' => :'CreditFreddieMacVerificationOfAssetsDeal', - :'request_id' => :'String', - :'schema_version' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacReportsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacReportsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deal') - self.deal = attributes[:'deal'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'schema_version') - self.schema_version = attributes[:'schema_version'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @deal.nil? - invalid_properties.push('invalid value for "deal", deal cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - if @schema_version.nil? - invalid_properties.push('invalid value for "schema_version", schema_version cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @deal.nil? - return false if @request_id.nil? - return false if @schema_version.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deal == o.deal && - request_id == o.request_id && - schema_version == o.schema_version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deal, request_id, schema_version].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_service.rb b/lib/plaid/models/credit_freddie_mac_service.rb deleted file mode 100644 index 83a750415..000000000 --- a/lib/plaid/models/credit_freddie_mac_service.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A collection of details related to a fulfillment service or product in terms of request, process and result. - class CreditFreddieMacService - attr_accessor :verification_of_asset - - attr_accessor :statuses - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verification_of_asset' => :'VERIFICATION_OF_ASSET', - :'statuses' => :'STATUSES' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verification_of_asset' => :'Array', - :'statuses' => :'Statuses' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacService` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacService`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verification_of_asset') - if (value = attributes[:'verification_of_asset']).is_a?(Array) - self.verification_of_asset = value - end - end - - if attributes.key?(:'statuses') - self.statuses = attributes[:'statuses'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @verification_of_asset.nil? - invalid_properties.push('invalid value for "verification_of_asset", verification_of_asset cannot be nil.') - end - - if @statuses.nil? - invalid_properties.push('invalid value for "statuses", statuses cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @verification_of_asset.nil? - return false if @statuses.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verification_of_asset == o.verification_of_asset && - statuses == o.statuses - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verification_of_asset, statuses].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_services.rb b/lib/plaid/models/credit_freddie_mac_services.rb deleted file mode 100644 index 1c11bc941..000000000 --- a/lib/plaid/models/credit_freddie_mac_services.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A collection of objects that describe requests and responses for services. - class CreditFreddieMacServices - attr_accessor :service - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'service' => :'SERVICE' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'service' => :'CreditFreddieMacService' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacServices` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacServices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'service') - self.service = attributes[:'service'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @service.nil? - invalid_properties.push('invalid value for "service", service cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @service.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - service == o.service - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [service].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_verification_of_asset.rb b/lib/plaid/models/credit_freddie_mac_verification_of_asset.rb deleted file mode 100644 index 396d1e0b0..000000000 --- a/lib/plaid/models/credit_freddie_mac_verification_of_asset.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class CreditFreddieMacVerificationOfAsset - attr_accessor :reporting_information - - attr_accessor :service_product_fulfillment - - attr_accessor :verification_of_asset_response - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reporting_information' => :'REPORTING_INFORMATION', - :'service_product_fulfillment' => :'SERVICE_PRODUCT_FULFILLMENT', - :'verification_of_asset_response' => :'VERIFICATION_OF_ASSET_RESPONSE' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'reporting_information' => :'CreditFreddieMacReportingInformation', - :'service_product_fulfillment' => :'ServiceProductFulfillment', - :'verification_of_asset_response' => :'CreditFreddieMacVerificationOfAssetResponse' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacVerificationOfAsset` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacVerificationOfAsset`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reporting_information') - self.reporting_information = attributes[:'reporting_information'] - end - - if attributes.key?(:'service_product_fulfillment') - self.service_product_fulfillment = attributes[:'service_product_fulfillment'] - end - - if attributes.key?(:'verification_of_asset_response') - self.verification_of_asset_response = attributes[:'verification_of_asset_response'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @reporting_information.nil? - invalid_properties.push('invalid value for "reporting_information", reporting_information cannot be nil.') - end - - if @service_product_fulfillment.nil? - invalid_properties.push('invalid value for "service_product_fulfillment", service_product_fulfillment cannot be nil.') - end - - if @verification_of_asset_response.nil? - invalid_properties.push('invalid value for "verification_of_asset_response", verification_of_asset_response cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @reporting_information.nil? - return false if @service_product_fulfillment.nil? - return false if @verification_of_asset_response.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reporting_information == o.reporting_information && - service_product_fulfillment == o.service_product_fulfillment && - verification_of_asset_response == o.verification_of_asset_response - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reporting_information, service_product_fulfillment, verification_of_asset_response].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_verification_of_asset_response.rb b/lib/plaid/models/credit_freddie_mac_verification_of_asset_response.rb deleted file mode 100644 index 68595e4d8..000000000 --- a/lib/plaid/models/credit_freddie_mac_verification_of_asset_response.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class CreditFreddieMacVerificationOfAssetResponse - attr_accessor :assets - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'assets' => :'ASSETS' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'assets' => :'CreditFreddieMacAssets' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacVerificationOfAssetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacVerificationOfAssetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'assets') - self.assets = attributes[:'assets'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @assets.nil? - invalid_properties.push('invalid value for "assets", assets cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @assets.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - assets == o.assets - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [assets].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_freddie_mac_verification_of_assets_deal.rb b/lib/plaid/models/credit_freddie_mac_verification_of_assets_deal.rb deleted file mode 100644 index 908b22fee..000000000 --- a/lib/plaid/models/credit_freddie_mac_verification_of_assets_deal.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing an Asset Report with Freddie Mac schema. - class CreditFreddieMacVerificationOfAssetsDeal - attr_accessor :loans - - attr_accessor :parties - - attr_accessor :services - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'loans' => :'LOANS', - :'parties' => :'PARTIES', - :'services' => :'SERVICES' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'loans' => :'CreditFreddieMacLoans', - :'parties' => :'CreditFreddieMacParties', - :'services' => :'CreditFreddieMacServices' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditFreddieMacVerificationOfAssetsDeal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditFreddieMacVerificationOfAssetsDeal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'loans') - self.loans = attributes[:'loans'] - end - - if attributes.key?(:'parties') - self.parties = attributes[:'parties'] - end - - if attributes.key?(:'services') - self.services = attributes[:'services'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @loans.nil? - invalid_properties.push('invalid value for "loans", loans cannot be nil.') - end - - if @parties.nil? - invalid_properties.push('invalid value for "parties", parties cannot be nil.') - end - - if @services.nil? - invalid_properties.push('invalid value for "services", services cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @loans.nil? - return false if @parties.nil? - return false if @services.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - loans == o.loans && - parties == o.parties && - services == o.services - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [loans, parties, services].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_pay_stub.rb b/lib/plaid/models/credit_pay_stub.rb deleted file mode 100644 index a8a79a172..000000000 --- a/lib/plaid/models/credit_pay_stub.rb +++ /dev/null @@ -1,320 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing an end user's pay stub. - class CreditPayStub - attr_accessor :deductions - - # An identifier of the document referenced by the document metadata. - attr_accessor :document_id - - attr_accessor :document_metadata - - attr_accessor :earnings - - attr_accessor :employee - - attr_accessor :employer - - attr_accessor :net_pay - - attr_accessor :pay_period_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deductions' => :'deductions', - :'document_id' => :'document_id', - :'document_metadata' => :'document_metadata', - :'earnings' => :'earnings', - :'employee' => :'employee', - :'employer' => :'employer', - :'net_pay' => :'net_pay', - :'pay_period_details' => :'pay_period_details' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deductions' => :'CreditPayStubDeductions', - :'document_id' => :'String', - :'document_metadata' => :'CreditDocumentMetadata', - :'earnings' => :'CreditPayStubEarnings', - :'employee' => :'CreditPayStubEmployee', - :'employer' => :'CreditPayStubEmployer', - :'net_pay' => :'CreditPayStubNetPay', - :'pay_period_details' => :'PayStubPayPeriodDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'document_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayStub` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayStub`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deductions') - self.deductions = attributes[:'deductions'] - end - - if attributes.key?(:'document_id') - self.document_id = attributes[:'document_id'] - end - - if attributes.key?(:'document_metadata') - self.document_metadata = attributes[:'document_metadata'] - end - - if attributes.key?(:'earnings') - self.earnings = attributes[:'earnings'] - end - - if attributes.key?(:'employee') - self.employee = attributes[:'employee'] - end - - if attributes.key?(:'employer') - self.employer = attributes[:'employer'] - end - - if attributes.key?(:'net_pay') - self.net_pay = attributes[:'net_pay'] - end - - if attributes.key?(:'pay_period_details') - self.pay_period_details = attributes[:'pay_period_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @deductions.nil? - invalid_properties.push('invalid value for "deductions", deductions cannot be nil.') - end - - if @document_metadata.nil? - invalid_properties.push('invalid value for "document_metadata", document_metadata cannot be nil.') - end - - if @earnings.nil? - invalid_properties.push('invalid value for "earnings", earnings cannot be nil.') - end - - if @employee.nil? - invalid_properties.push('invalid value for "employee", employee cannot be nil.') - end - - if @employer.nil? - invalid_properties.push('invalid value for "employer", employer cannot be nil.') - end - - if @net_pay.nil? - invalid_properties.push('invalid value for "net_pay", net_pay cannot be nil.') - end - - if @pay_period_details.nil? - invalid_properties.push('invalid value for "pay_period_details", pay_period_details cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @deductions.nil? - return false if @document_metadata.nil? - return false if @earnings.nil? - return false if @employee.nil? - return false if @employer.nil? - return false if @net_pay.nil? - return false if @pay_period_details.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deductions == o.deductions && - document_id == o.document_id && - document_metadata == o.document_metadata && - earnings == o.earnings && - employee == o.employee && - employer == o.employer && - net_pay == o.net_pay && - pay_period_details == o.pay_period_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deductions, document_id, document_metadata, earnings, employee, employer, net_pay, pay_period_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_pay_stub_address.rb b/lib/plaid/models/credit_pay_stub_address.rb deleted file mode 100644 index ec99a5171..000000000 --- a/lib/plaid/models/credit_pay_stub_address.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Address on the pay stub. - class CreditPayStubAddress - # The full city name. - attr_accessor :city - - # The ISO 3166-1 alpha-2 country code. - attr_accessor :country - - # The postal code of the address. - attr_accessor :postal_code - - # The region or state. Example: `\"NC\"` - attr_accessor :region - - # The full street address. - attr_accessor :street - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'country' => :'country', - :'postal_code' => :'postal_code', - :'region' => :'region', - :'street' => :'street' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'country' => :'String', - :'postal_code' => :'String', - :'region' => :'String', - :'street' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'city', - :'country', - :'postal_code', - :'region', - :'street' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayStubAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayStubAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - country == o.country && - postal_code == o.postal_code && - region == o.region && - street == o.street - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, country, postal_code, region, street].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_pay_stub_deductions.rb b/lib/plaid/models/credit_pay_stub_deductions.rb deleted file mode 100644 index 9cdf4aa72..000000000 --- a/lib/plaid/models/credit_pay_stub_deductions.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object with the deduction information found on a pay stub. - class CreditPayStubDeductions - attr_accessor :breakdown - - attr_accessor :total - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'breakdown' => :'breakdown', - :'total' => :'total' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'breakdown' => :'Array', - :'total' => :'PayStubDeductionsTotal' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayStubDeductions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayStubDeductions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'breakdown') - if (value = attributes[:'breakdown']).is_a?(Array) - self.breakdown = value - end - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @breakdown.nil? - invalid_properties.push('invalid value for "breakdown", breakdown cannot be nil.') - end - - if @total.nil? - invalid_properties.push('invalid value for "total", total cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @breakdown.nil? - return false if @total.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - breakdown == o.breakdown && - total == o.total - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [breakdown, total].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_pay_stub_earnings.rb b/lib/plaid/models/credit_pay_stub_earnings.rb deleted file mode 100644 index 4605e093a..000000000 --- a/lib/plaid/models/credit_pay_stub_earnings.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing both a breakdown of earnings on a pay stub and the total earnings. - class CreditPayStubEarnings - attr_accessor :breakdown - - attr_accessor :total - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'breakdown' => :'breakdown', - :'total' => :'total' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'breakdown' => :'Array', - :'total' => :'PayStubEarningsTotal' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayStubEarnings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayStubEarnings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'breakdown') - if (value = attributes[:'breakdown']).is_a?(Array) - self.breakdown = value - end - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @breakdown.nil? - invalid_properties.push('invalid value for "breakdown", breakdown cannot be nil.') - end - - if @total.nil? - invalid_properties.push('invalid value for "total", total cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @breakdown.nil? - return false if @total.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - breakdown == o.breakdown && - total == o.total - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [breakdown, total].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_pay_stub_employee.rb b/lib/plaid/models/credit_pay_stub_employee.rb deleted file mode 100644 index 6b97e73f1..000000000 --- a/lib/plaid/models/credit_pay_stub_employee.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data about the employee. - class CreditPayStubEmployee - attr_accessor :address - - # The name of the employee. - attr_accessor :name - - # Marital status of the employee - either `SINGLE` or `MARRIED` or `NOT LISTED`. - attr_accessor :marital_status - - attr_accessor :taxpayer_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'address' => :'address', - :'name' => :'name', - :'marital_status' => :'marital_status', - :'taxpayer_id' => :'taxpayer_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'address' => :'CreditPayStubAddress', - :'name' => :'String', - :'marital_status' => :'String', - :'taxpayer_id' => :'PayStubTaxpayerID' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'marital_status', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayStubEmployee` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayStubEmployee`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'marital_status') - self.marital_status = attributes[:'marital_status'] - end - - if attributes.key?(:'taxpayer_id') - self.taxpayer_id = attributes[:'taxpayer_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @address.nil? - invalid_properties.push('invalid value for "address", address cannot be nil.') - end - - if @taxpayer_id.nil? - invalid_properties.push('invalid value for "taxpayer_id", taxpayer_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @address.nil? - return false if @taxpayer_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - address == o.address && - name == o.name && - marital_status == o.marital_status && - taxpayer_id == o.taxpayer_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [address, name, marital_status, taxpayer_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_pay_stub_employer.rb b/lib/plaid/models/credit_pay_stub_employer.rb deleted file mode 100644 index e7d20353c..000000000 --- a/lib/plaid/models/credit_pay_stub_employer.rb +++ /dev/null @@ -1,236 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the employer on the pay stub. - class CreditPayStubEmployer - attr_accessor :address - - # The name of the employer on the pay stub. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'address' => :'address', - :'name' => :'name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'address' => :'CreditPayStubAddress', - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayStubEmployer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayStubEmployer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @address.nil? - invalid_properties.push('invalid value for "address", address cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @address.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - address == o.address && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [address, name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_pay_stub_net_pay.rb b/lib/plaid/models/credit_pay_stub_net_pay.rb deleted file mode 100644 index ae2ed5714..000000000 --- a/lib/plaid/models/credit_pay_stub_net_pay.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing information about the net pay amount on the pay stub. - class CreditPayStubNetPay - # Raw amount of the net pay for the pay period. - attr_accessor :current_amount - - # Description of the net pay. - attr_accessor :description - - # The ISO-4217 currency code of the net pay. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - # The year-to-date amount of the net pay. - attr_accessor :ytd_amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'current_amount' => :'current_amount', - :'description' => :'description', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'ytd_amount' => :'ytd_amount' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'current_amount' => :'Float', - :'description' => :'String', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'ytd_amount' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'current_amount', - :'description', - :'iso_currency_code', - :'unofficial_currency_code', - :'ytd_amount' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayStubNetPay` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayStubNetPay`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'current_amount') - self.current_amount = attributes[:'current_amount'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'ytd_amount') - self.ytd_amount = attributes[:'ytd_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - current_amount == o.current_amount && - description == o.description && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - ytd_amount == o.ytd_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [current_amount, description, iso_currency_code, unofficial_currency_code, ytd_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_pay_stub_pay_basis_type.rb b/lib/plaid/models/credit_pay_stub_pay_basis_type.rb deleted file mode 100644 index 7b856c3f0..000000000 --- a/lib/plaid/models/credit_pay_stub_pay_basis_type.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CreditPayStubPayBasisType - SALARY = "SALARY".freeze - HOURLY = "HOURLY".freeze - COMMISSION = "COMMISSION".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/credit_payroll_income_get_request.rb b/lib/plaid/models/credit_payroll_income_get_request.rb deleted file mode 100644 index c52b1437c..000000000 --- a/lib/plaid/models/credit_payroll_income_get_request.rb +++ /dev/null @@ -1,250 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditPayrollIncomeGetRequest defines the request schema for `/credit/payroll_income/get`. - class CreditPayrollIncomeGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String', - :'options' => :'CreditPayrollIncomeGetRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayrollIncomeGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayrollIncomeGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_payroll_income_get_request_options.rb b/lib/plaid/models/credit_payroll_income_get_request_options.rb deleted file mode 100644 index 49467ff40..000000000 --- a/lib/plaid/models/credit_payroll_income_get_request_options.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object for `/credit/payroll_income/get` request options. - class 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. - attr_accessor :item_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_ids' => :'item_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayrollIncomeGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayrollIncomeGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_ids') - if (value = attributes[:'item_ids']).is_a?(Array) - self.item_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_ids == o.item_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_payroll_income_get_response.rb b/lib/plaid/models/credit_payroll_income_get_response.rb deleted file mode 100644 index bbf2c9562..000000000 --- a/lib/plaid/models/credit_payroll_income_get_response.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response body for `/credit/payroll_income/get`. - class CreditPayrollIncomeGetResponse - # Array of payroll items. - attr_accessor :items - - attr_accessor :error - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'items' => :'items', - :'error' => :'error', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'items' => :'Array', - :'error' => :'PlaidError', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayrollIncomeGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayrollIncomeGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @items.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - items == o.items && - error == o.error && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [items, error, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_payroll_income_parsing_config_update_request.rb b/lib/plaid/models/credit_payroll_income_parsing_config_update_request.rb deleted file mode 100644 index 261702b76..000000000 --- a/lib/plaid/models/credit_payroll_income_parsing_config_update_request.rb +++ /dev/null @@ -1,273 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditPayrollIncomeParsingConfigUpdateRequest defines the request schema for `/credit/payroll_income/documents/update`. - class CreditPayrollIncomeParsingConfigUpdateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - # The types of analysis to enable for the document income verification session - attr_accessor :parsing_config - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token', - :'item_id' => :'item_id', - :'parsing_config' => :'parsing_config' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String', - :'item_id' => :'String', - :'parsing_config' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayrollIncomeParsingConfigUpdateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayrollIncomeParsingConfigUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'parsing_config') - if (value = attributes[:'parsing_config']).is_a?(Array) - self.parsing_config = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_token.nil? - invalid_properties.push('invalid value for "user_token", user_token cannot be nil.') - end - - if @parsing_config.nil? - invalid_properties.push('invalid value for "parsing_config", parsing_config cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_token.nil? - return false if @parsing_config.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token && - item_id == o.item_id && - parsing_config == o.parsing_config - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token, item_id, parsing_config].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_payroll_income_parsing_config_update_response.rb b/lib/plaid/models/credit_payroll_income_parsing_config_update_response.rb deleted file mode 100644 index 27c9344e6..000000000 --- a/lib/plaid/models/credit_payroll_income_parsing_config_update_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditPayrollIncomeParsingConfigUpdateResponse defines the response schema for `/credit/payroll_income/documents/update`. - class CreditPayrollIncomeParsingConfigUpdateResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayrollIncomeParsingConfigUpdateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayrollIncomeParsingConfigUpdateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_payroll_income_precheck_request.rb b/lib/plaid/models/credit_payroll_income_precheck_request.rb deleted file mode 100644 index aa6f36cf4..000000000 --- a/lib/plaid/models/credit_payroll_income_precheck_request.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/credit/payroll_income/precheck`. - class CreditPayrollIncomePrecheckRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - # An array of access tokens corresponding to Items belonging to the user whose eligibility is being checked. Note that if the Items specified here are not already initialized with `transactions`, providing them in this field will cause these Items to be initialized with (and billed for) the Transactions product. - attr_accessor :access_tokens - - attr_accessor :employer - - attr_accessor :us_military_info - - attr_accessor :payroll_institution - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token', - :'access_tokens' => :'access_tokens', - :'employer' => :'employer', - :'us_military_info' => :'us_military_info', - :'payroll_institution' => :'payroll_institution' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String', - :'access_tokens' => :'Array', - :'employer' => :'IncomeVerificationPrecheckEmployer', - :'us_military_info' => :'IncomeVerificationPrecheckMilitaryInfo', - :'payroll_institution' => :'IncomeVerificationPrecheckPayrollInstitution' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'employer', - :'us_military_info', - :'payroll_institution' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayrollIncomePrecheckRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayrollIncomePrecheckRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - - if attributes.key?(:'access_tokens') - if (value = attributes[:'access_tokens']).is_a?(Array) - self.access_tokens = value - end - end - - if attributes.key?(:'employer') - self.employer = attributes[:'employer'] - end - - if attributes.key?(:'us_military_info') - self.us_military_info = attributes[:'us_military_info'] - end - - if attributes.key?(:'payroll_institution') - self.payroll_institution = attributes[:'payroll_institution'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token && - access_tokens == o.access_tokens && - employer == o.employer && - us_military_info == o.us_military_info && - payroll_institution == o.payroll_institution - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token, access_tokens, employer, us_military_info, payroll_institution].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_payroll_income_precheck_response.rb b/lib/plaid/models/credit_payroll_income_precheck_response.rb deleted file mode 100644 index 4f1e6b0ff..000000000 --- a/lib/plaid/models/credit_payroll_income_precheck_response.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/credit/payroll_income/precheck`. - class CreditPayrollIncomePrecheckResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - attr_accessor :confidence - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id', - :'confidence' => :'confidence' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String', - :'confidence' => :'IncomeVerificationPrecheckConfidence' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayrollIncomePrecheckResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayrollIncomePrecheckResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'confidence') - self.confidence = attributes[:'confidence'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - if @confidence.nil? - invalid_properties.push('invalid value for "confidence", confidence cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - return false if @confidence.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id && - confidence == o.confidence - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id, confidence].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_payroll_income_refresh_request.rb b/lib/plaid/models/credit_payroll_income_refresh_request.rb deleted file mode 100644 index 8d8884a27..000000000 --- a/lib/plaid/models/credit_payroll_income_refresh_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditPayrollIncomeRefreshRequest defines the request schema for `/credit/payroll_income/refresh` - class CreditPayrollIncomeRefreshRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String', - :'options' => :'CreditPayrollIncomeRefreshRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayrollIncomeRefreshRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayrollIncomeRefreshRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_token.nil? - invalid_properties.push('invalid value for "user_token", user_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_payroll_income_refresh_request_options.rb b/lib/plaid/models/credit_payroll_income_refresh_request_options.rb deleted file mode 100644 index ffb51d123..000000000 --- a/lib/plaid/models/credit_payroll_income_refresh_request_options.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object for `/credit/payroll_income/refresh` request options. - class CreditPayrollIncomeRefreshRequestOptions - # An array of `item_id`s to be refreshed. 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 be refreshed. - attr_accessor :item_ids - - # The URL where Plaid will send the payroll income refresh webhook. - attr_accessor :webhook - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_ids' => :'item_ids', - :'webhook' => :'webhook' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_ids' => :'Array', - :'webhook' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayrollIncomeRefreshRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayrollIncomeRefreshRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_ids') - if (value = attributes[:'item_ids']).is_a?(Array) - self.item_ids = value - end - end - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_ids == o.item_ids && - webhook == o.webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_ids, webhook].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_payroll_income_refresh_response.rb b/lib/plaid/models/credit_payroll_income_refresh_response.rb deleted file mode 100644 index d1e2ed861..000000000 --- a/lib/plaid/models/credit_payroll_income_refresh_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditPayrollIncomeRefreshResponse defines the response schema for `/credit/payroll_income/refresh` - class CreditPayrollIncomeRefreshResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # The verification refresh status. One of the following: `\"USER_PRESENCE_REQUIRED\"` User presence is required to refresh an income verification. `\"SUCCESSFUL\"` The income verification refresh was successful. `\"NOT_FOUND\"` No new data was found after the income verification refresh. - attr_accessor :verification_refresh_status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id', - :'verification_refresh_status' => :'verification_refresh_status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String', - :'verification_refresh_status' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayrollIncomeRefreshResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayrollIncomeRefreshResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'verification_refresh_status') - self.verification_refresh_status = attributes[:'verification_refresh_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - if @verification_refresh_status.nil? - invalid_properties.push('invalid value for "verification_refresh_status", verification_refresh_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - return false if @verification_refresh_status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id && - verification_refresh_status == o.verification_refresh_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id, verification_refresh_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_payroll_income_risk_signals_get_request.rb b/lib/plaid/models/credit_payroll_income_risk_signals_get_request.rb deleted file mode 100644 index 4eaa57d33..000000000 --- a/lib/plaid/models/credit_payroll_income_risk_signals_get_request.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditPayrollIncomeRiskSignalsGetRequest defines the request schema for `/credit/payroll_income/risk_signals/get` - class CreditPayrollIncomeRiskSignalsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayrollIncomeRiskSignalsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayrollIncomeRiskSignalsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_payroll_income_risk_signals_get_response.rb b/lib/plaid/models/credit_payroll_income_risk_signals_get_response.rb deleted file mode 100644 index 7059d11e2..000000000 --- a/lib/plaid/models/credit_payroll_income_risk_signals_get_response.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditPayrollIncomeRiskSignalsGetRequest defines the response schema for `/credit/payroll_income/risk_signals/get` - class CreditPayrollIncomeRiskSignalsGetResponse - # Array of payroll items. - attr_accessor :items - - attr_accessor :error - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'items' => :'items', - :'error' => :'error', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'items' => :'Array', - :'error' => :'PlaidError', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPayrollIncomeRiskSignalsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPayrollIncomeRiskSignalsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @items.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - items == o.items && - error == o.error && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [items, error, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_platform_ids.rb b/lib/plaid/models/credit_platform_ids.rb deleted file mode 100644 index 1a7156faf..000000000 --- a/lib/plaid/models/credit_platform_ids.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The object containing a set of ids related to an employee. - class CreditPlatformIds - # The ID of an employee as given by their employer. - attr_accessor :employee_id - - # The ID of an employee as given by their payroll. - attr_accessor :payroll_id - - # The ID of the position of the employee. - attr_accessor :position_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'employee_id' => :'employee_id', - :'payroll_id' => :'payroll_id', - :'position_id' => :'position_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'employee_id' => :'String', - :'payroll_id' => :'String', - :'position_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'employee_id', - :'payroll_id', - :'position_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditPlatformIds` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditPlatformIds`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'employee_id') - self.employee_id = attributes[:'employee_id'] - end - - if attributes.key?(:'payroll_id') - self.payroll_id = attributes[:'payroll_id'] - end - - if attributes.key?(:'position_id') - self.position_id = attributes[:'position_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - employee_id == o.employee_id && - payroll_id == o.payroll_id && - position_id == o.position_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [employee_id, payroll_id, position_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_relay_create_request.rb b/lib/plaid/models/credit_relay_create_request.rb deleted file mode 100644 index be493abfb..000000000 --- a/lib/plaid/models/credit_relay_create_request.rb +++ /dev/null @@ -1,274 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditRelayCreateRequest defines the request schema for `/credit/relay/create` - class CreditRelayCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # List of report token strings, with at most one token of each report type. Currently only Asset Report token is supported. - attr_accessor :report_tokens - - # The `secondary_client_id` is the client id of the third party with whom you would like to share the relay token. - attr_accessor :secondary_client_id - - # URL to which Plaid will send webhooks when the Secondary Client successfully retrieves an Asset Report by calling `/credit/relay/get`. - attr_accessor :webhook - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'report_tokens' => :'report_tokens', - :'secondary_client_id' => :'secondary_client_id', - :'webhook' => :'webhook' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'report_tokens' => :'Array', - :'secondary_client_id' => :'String', - :'webhook' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'webhook' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditRelayCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditRelayCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'report_tokens') - if (value = attributes[:'report_tokens']).is_a?(Array) - self.report_tokens = value - end - end - - if attributes.key?(:'secondary_client_id') - self.secondary_client_id = attributes[:'secondary_client_id'] - end - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @report_tokens.nil? - invalid_properties.push('invalid value for "report_tokens", report_tokens cannot be nil.') - end - - if @secondary_client_id.nil? - invalid_properties.push('invalid value for "secondary_client_id", secondary_client_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @report_tokens.nil? - return false if @secondary_client_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - report_tokens == o.report_tokens && - secondary_client_id == o.secondary_client_id && - webhook == o.webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, report_tokens, secondary_client_id, webhook].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_relay_create_response.rb b/lib/plaid/models/credit_relay_create_response.rb deleted file mode 100644 index d4832c406..000000000 --- a/lib/plaid/models/credit_relay_create_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditRelayCreateResponse defines the response schema for `/credit/relay/create` - class CreditRelayCreateResponse - # A token that can be shared with a third party to allow them to access the Asset Report. This token should be stored securely. - attr_accessor :relay_token - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'relay_token' => :'relay_token', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'relay_token' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditRelayCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditRelayCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'relay_token') - self.relay_token = attributes[:'relay_token'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @relay_token.nil? - invalid_properties.push('invalid value for "relay_token", relay_token cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @relay_token.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - relay_token == o.relay_token && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [relay_token, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_relay_get_request.rb b/lib/plaid/models/credit_relay_get_request.rb deleted file mode 100644 index ae51cf1ac..000000000 --- a/lib/plaid/models/credit_relay_get_request.rb +++ /dev/null @@ -1,282 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditRelayGetRequest defines the request schema for `/credit/relay/get` - class CreditRelayGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The `relay_token` granting access to the report you would like to get. - attr_accessor :relay_token - - attr_accessor :report_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'relay_token' => :'relay_token', - :'report_type' => :'report_type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'relay_token' => :'String', - :'report_type' => :'ReportType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditRelayGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditRelayGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'relay_token') - self.relay_token = attributes[:'relay_token'] - end - - if attributes.key?(:'report_type') - self.report_type = attributes[:'report_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @relay_token.nil? - invalid_properties.push('invalid value for "relay_token", relay_token cannot be nil.') - end - - if @report_type.nil? - invalid_properties.push('invalid value for "report_type", report_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @relay_token.nil? - return false if @report_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - relay_token == o.relay_token && - report_type == o.report_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, relay_token, report_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_relay_pdf_get_request.rb b/lib/plaid/models/credit_relay_pdf_get_request.rb deleted file mode 100644 index e6c2605af..000000000 --- a/lib/plaid/models/credit_relay_pdf_get_request.rb +++ /dev/null @@ -1,282 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditRelayPDFGetRequest defines the request schema for `/credit/relay/pdf/get` - class CreditRelayPDFGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The `relay_token` granting access to the report you would like to get. - attr_accessor :relay_token - - attr_accessor :report_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'relay_token' => :'relay_token', - :'report_type' => :'report_type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'relay_token' => :'String', - :'report_type' => :'ReportType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditRelayPDFGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditRelayPDFGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'relay_token') - self.relay_token = attributes[:'relay_token'] - end - - if attributes.key?(:'report_type') - self.report_type = attributes[:'report_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @relay_token.nil? - invalid_properties.push('invalid value for "relay_token", relay_token cannot be nil.') - end - - if @report_type.nil? - invalid_properties.push('invalid value for "report_type", report_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @relay_token.nil? - return false if @report_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - relay_token == o.relay_token && - report_type == o.report_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, relay_token, report_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_relay_refresh_request.rb b/lib/plaid/models/credit_relay_refresh_request.rb deleted file mode 100644 index 2f40d376d..000000000 --- a/lib/plaid/models/credit_relay_refresh_request.rb +++ /dev/null @@ -1,293 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditRelayRefreshRequest defines the request schema for `/credit/relay/refresh` - class CreditRelayRefreshRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The `relay_token` granting access to the report you would like to refresh. - attr_accessor :relay_token - - attr_accessor :report_type - - # The URL registered to receive webhooks when the report of a relay token has been refreshed. - attr_accessor :webhook - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'relay_token' => :'relay_token', - :'report_type' => :'report_type', - :'webhook' => :'webhook' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'relay_token' => :'String', - :'report_type' => :'ReportType', - :'webhook' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'webhook' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditRelayRefreshRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditRelayRefreshRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'relay_token') - self.relay_token = attributes[:'relay_token'] - end - - if attributes.key?(:'report_type') - self.report_type = attributes[:'report_type'] - end - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @relay_token.nil? - invalid_properties.push('invalid value for "relay_token", relay_token cannot be nil.') - end - - if @report_type.nil? - invalid_properties.push('invalid value for "report_type", report_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @relay_token.nil? - return false if @report_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - relay_token == o.relay_token && - report_type == o.report_type && - webhook == o.webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, relay_token, report_type, webhook].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_relay_refresh_response.rb b/lib/plaid/models/credit_relay_refresh_response.rb deleted file mode 100644 index c8e31fc2b..000000000 --- a/lib/plaid/models/credit_relay_refresh_response.rb +++ /dev/null @@ -1,250 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditRelayRefreshResponse defines the response schema for `/credit/relay/refresh` - class CreditRelayRefreshResponse - attr_accessor :relay_token - - # A unique ID identifying an Asset Report. Like all Plaid identifiers, this ID is case sensitive. - attr_accessor :asset_report_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'relay_token' => :'relay_token', - :'asset_report_id' => :'asset_report_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'relay_token' => :'String', - :'asset_report_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditRelayRefreshResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditRelayRefreshResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'relay_token') - self.relay_token = attributes[:'relay_token'] - end - - if attributes.key?(:'asset_report_id') - self.asset_report_id = attributes[:'asset_report_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @relay_token.nil? - invalid_properties.push('invalid value for "relay_token", relay_token cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @relay_token.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - relay_token == o.relay_token && - asset_report_id == o.asset_report_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [relay_token, asset_report_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_relay_remove_request.rb b/lib/plaid/models/credit_relay_remove_request.rb deleted file mode 100644 index 61c1c3bb1..000000000 --- a/lib/plaid/models/credit_relay_remove_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditRelayRemoveRequest defines the request schema for `/credit/relay/remove` - class CreditRelayRemoveRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The `relay_token` you would like to revoke. - attr_accessor :relay_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'relay_token' => :'relay_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'relay_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditRelayRemoveRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditRelayRemoveRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'relay_token') - self.relay_token = attributes[:'relay_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @relay_token.nil? - invalid_properties.push('invalid value for "relay_token", relay_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @relay_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - relay_token == o.relay_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, relay_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_relay_remove_response.rb b/lib/plaid/models/credit_relay_remove_response.rb deleted file mode 100644 index 84ecd8a19..000000000 --- a/lib/plaid/models/credit_relay_remove_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditRelayRemoveResponse defines the response schema for `/credit/relay/remove` - class CreditRelayRemoveResponse - # `true` if the relay token was successfully removed. - attr_accessor :removed - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'removed' => :'removed', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'removed' => :'Boolean', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditRelayRemoveResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditRelayRemoveResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'removed') - self.removed = attributes[:'removed'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @removed.nil? - invalid_properties.push('invalid value for "removed", removed cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @removed.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - removed == o.removed && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [removed, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_session.rb b/lib/plaid/models/credit_session.rb deleted file mode 100644 index dfd822fbd..000000000 --- a/lib/plaid/models/credit_session.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Metadata and results for a Link session - class CreditSession - # The unique identifier associated with the Link session. This identifier matches the `link_session_id` returned in the onSuccess/onExit callbacks. - attr_accessor :link_session_id - - # The time when the Link session started - attr_accessor :session_start_time - - attr_accessor :results - - # The set of errors that occurred during the Link session. - attr_accessor :errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'link_session_id' => :'link_session_id', - :'session_start_time' => :'session_start_time', - :'results' => :'results', - :'errors' => :'errors' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'link_session_id' => :'String', - :'session_start_time' => :'Time', - :'results' => :'CreditSessionResults', - :'errors' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditSession` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditSession`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'link_session_id') - self.link_session_id = attributes[:'link_session_id'] - end - - if attributes.key?(:'session_start_time') - self.session_start_time = attributes[:'session_start_time'] - end - - if attributes.key?(:'results') - self.results = attributes[:'results'] - end - - if attributes.key?(:'errors') - if (value = attributes[:'errors']).is_a?(Array) - self.errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - link_session_id == o.link_session_id && - session_start_time == o.session_start_time && - results == o.results && - errors == o.errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [link_session_id, session_start_time, results, errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_session_bank_employment_result.rb b/lib/plaid/models/credit_session_bank_employment_result.rb deleted file mode 100644 index d37ba366c..000000000 --- a/lib/plaid/models/credit_session_bank_employment_result.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The details of a bank employment verification in Link. - class CreditSessionBankEmploymentResult - attr_accessor :status - - # 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. - attr_accessor :item_id - - # The Plaid Institution ID associated with the Item. - attr_accessor :institution_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'item_id' => :'item_id', - :'institution_id' => :'institution_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'CreditSessionBankEmploymentStatus', - :'item_id' => :'String', - :'institution_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditSessionBankEmploymentResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditSessionBankEmploymentResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - item_id == o.item_id && - institution_id == o.institution_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, item_id, institution_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_session_bank_employment_status.rb b/lib/plaid/models/credit_session_bank_employment_status.rb deleted file mode 100644 index 1604e8621..000000000 --- a/lib/plaid/models/credit_session_bank_employment_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CreditSessionBankEmploymentStatus - APPROVED = "APPROVED".freeze - NO_EMPLOYERS_FOUND = "NO_EMPLOYERS_FOUND".freeze - EMPLOYER_NOT_LISTED = "EMPLOYER_NOT_LISTED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/credit_session_bank_income_result.rb b/lib/plaid/models/credit_session_bank_income_result.rb deleted file mode 100644 index aa58ca0f6..000000000 --- a/lib/plaid/models/credit_session_bank_income_result.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The details of a bank income verification in Link - class CreditSessionBankIncomeResult - attr_accessor :status - - # 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. - attr_accessor :item_id - - # The Plaid Institution ID associated with the Item. - attr_accessor :institution_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'item_id' => :'item_id', - :'institution_id' => :'institution_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'CreditSessionBankIncomeStatus', - :'item_id' => :'String', - :'institution_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditSessionBankIncomeResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditSessionBankIncomeResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - item_id == o.item_id && - institution_id == o.institution_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, item_id, institution_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_session_bank_income_status.rb b/lib/plaid/models/credit_session_bank_income_status.rb deleted file mode 100644 index e3dc1aef9..000000000 --- a/lib/plaid/models/credit_session_bank_income_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class CreditSessionBankIncomeStatus - APPROVED = "APPROVED".freeze - NO_DEPOSITS_FOUND = "NO_DEPOSITS_FOUND".freeze - USER_REPORTED_NO_INCOME = "USER_REPORTED_NO_INCOME".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/credit_session_document_income_result.rb b/lib/plaid/models/credit_session_document_income_result.rb deleted file mode 100644 index 493d07a99..000000000 --- a/lib/plaid/models/credit_session_document_income_result.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The details of a document income verification in Link - class CreditSessionDocumentIncomeResult - # The number of paystubs uploaded by the user. - attr_accessor :num_paystubs_uploaded - - # The number of w2s uploaded by the user. - attr_accessor :num_w2s_uploaded - - # The number of bank statements uploaded by the user. - attr_accessor :num_bank_statements_uploaded - - # The number of 1099s uploaded by the user - attr_accessor :num_1099s_uploaded - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'num_paystubs_uploaded' => :'num_paystubs_uploaded', - :'num_w2s_uploaded' => :'num_w2s_uploaded', - :'num_bank_statements_uploaded' => :'num_bank_statements_uploaded', - :'num_1099s_uploaded' => :'num_1099s_uploaded' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'num_paystubs_uploaded' => :'Integer', - :'num_w2s_uploaded' => :'Integer', - :'num_bank_statements_uploaded' => :'Integer', - :'num_1099s_uploaded' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditSessionDocumentIncomeResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditSessionDocumentIncomeResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'num_paystubs_uploaded') - self.num_paystubs_uploaded = attributes[:'num_paystubs_uploaded'] - end - - if attributes.key?(:'num_w2s_uploaded') - self.num_w2s_uploaded = attributes[:'num_w2s_uploaded'] - end - - if attributes.key?(:'num_bank_statements_uploaded') - self.num_bank_statements_uploaded = attributes[:'num_bank_statements_uploaded'] - end - - if attributes.key?(:'num_1099s_uploaded') - self.num_1099s_uploaded = attributes[:'num_1099s_uploaded'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @num_paystubs_uploaded.nil? - invalid_properties.push('invalid value for "num_paystubs_uploaded", num_paystubs_uploaded cannot be nil.') - end - - if @num_w2s_uploaded.nil? - invalid_properties.push('invalid value for "num_w2s_uploaded", num_w2s_uploaded cannot be nil.') - end - - if @num_bank_statements_uploaded.nil? - invalid_properties.push('invalid value for "num_bank_statements_uploaded", num_bank_statements_uploaded cannot be nil.') - end - - if @num_1099s_uploaded.nil? - invalid_properties.push('invalid value for "num_1099s_uploaded", num_1099s_uploaded cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @num_paystubs_uploaded.nil? - return false if @num_w2s_uploaded.nil? - return false if @num_bank_statements_uploaded.nil? - return false if @num_1099s_uploaded.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - num_paystubs_uploaded == o.num_paystubs_uploaded && - num_w2s_uploaded == o.num_w2s_uploaded && - num_bank_statements_uploaded == o.num_bank_statements_uploaded && - num_1099s_uploaded == o.num_1099s_uploaded - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [num_paystubs_uploaded, num_w2s_uploaded, num_bank_statements_uploaded, num_1099s_uploaded].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_session_error.rb b/lib/plaid/models/credit_session_error.rb deleted file mode 100644 index 81746c7f4..000000000 --- a/lib/plaid/models/credit_session_error.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The details of a Link error. - class CreditSessionError - # A broad categorization of the error. - attr_accessor :error_type - - # The particular error code. - attr_accessor :error_code - - # A developer-friendly representation of the error code. - attr_accessor :error_message - - # A user-friendly representation of the error code. `null` if the error is not related to user action. - attr_accessor :display_message - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'error_type' => :'error_type', - :'error_code' => :'error_code', - :'error_message' => :'error_message', - :'display_message' => :'display_message' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'error_type' => :'String', - :'error_code' => :'String', - :'error_message' => :'String', - :'display_message' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'display_message' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditSessionError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditSessionError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'error_type') - self.error_type = attributes[:'error_type'] - end - - if attributes.key?(:'error_code') - self.error_code = attributes[:'error_code'] - end - - if attributes.key?(:'error_message') - self.error_message = attributes[:'error_message'] - end - - if attributes.key?(:'display_message') - self.display_message = attributes[:'display_message'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - error_type == o.error_type && - error_code == o.error_code && - error_message == o.error_message && - display_message == o.display_message - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [error_type, error_code, error_message, display_message].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_session_item_add_result.rb b/lib/plaid/models/credit_session_item_add_result.rb deleted file mode 100644 index b79226356..000000000 --- a/lib/plaid/models/credit_session_item_add_result.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The details of an Item add in Link. - class CreditSessionItemAddResult - # Returned once a user has successfully linked their Item. - attr_accessor :public_token - - # 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. - attr_accessor :item_id - - # The Plaid Institution ID associated with the Item. - attr_accessor :institution_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'public_token' => :'public_token', - :'item_id' => :'item_id', - :'institution_id' => :'institution_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'public_token' => :'String', - :'item_id' => :'String', - :'institution_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditSessionItemAddResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditSessionItemAddResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'public_token') - self.public_token = attributes[:'public_token'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - public_token == o.public_token && - item_id == o.item_id && - institution_id == o.institution_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [public_token, item_id, institution_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_session_payroll_income_result.rb b/lib/plaid/models/credit_session_payroll_income_result.rb deleted file mode 100644 index 2fa73db6d..000000000 --- a/lib/plaid/models/credit_session_payroll_income_result.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The details of a digital payroll income verification in Link - class CreditSessionPayrollIncomeResult - # The number of paystubs retrieved from a payroll provider. - attr_accessor :num_paystubs_retrieved - - # The number of w2s retrieved from a payroll provider. - attr_accessor :num_w2s_retrieved - - # The Plaid Institution ID associated with the Item. - attr_accessor :institution_id - - # The Institution Name associated with the Item. - attr_accessor :institution_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'num_paystubs_retrieved' => :'num_paystubs_retrieved', - :'num_w2s_retrieved' => :'num_w2s_retrieved', - :'institution_id' => :'institution_id', - :'institution_name' => :'institution_name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'num_paystubs_retrieved' => :'Integer', - :'num_w2s_retrieved' => :'Integer', - :'institution_id' => :'String', - :'institution_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditSessionPayrollIncomeResult` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditSessionPayrollIncomeResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'num_paystubs_retrieved') - self.num_paystubs_retrieved = attributes[:'num_paystubs_retrieved'] - end - - if attributes.key?(:'num_w2s_retrieved') - self.num_w2s_retrieved = attributes[:'num_w2s_retrieved'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'institution_name') - self.institution_name = attributes[:'institution_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - num_paystubs_retrieved == o.num_paystubs_retrieved && - num_w2s_retrieved == o.num_w2s_retrieved && - institution_id == o.institution_id && - institution_name == o.institution_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [num_paystubs_retrieved, num_w2s_retrieved, institution_id, institution_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_session_results.rb b/lib/plaid/models/credit_session_results.rb deleted file mode 100644 index 74de45ffd..000000000 --- a/lib/plaid/models/credit_session_results.rb +++ /dev/null @@ -1,269 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The set of results for a Link session. - class CreditSessionResults - # The set of Item adds for the Link session. - attr_accessor :item_add_results - - # The set of bank income verifications for the Link session. - attr_accessor :bank_income_results - - # The set of bank employment verifications for the Link session. - attr_accessor :bank_employment_results - - # The set of payroll income verifications for the Link session. - attr_accessor :payroll_income_results - - attr_accessor :document_income_results - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_add_results' => :'item_add_results', - :'bank_income_results' => :'bank_income_results', - :'bank_employment_results' => :'bank_employment_results', - :'payroll_income_results' => :'payroll_income_results', - :'document_income_results' => :'document_income_results' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_add_results' => :'Array', - :'bank_income_results' => :'Array', - :'bank_employment_results' => :'Array', - :'payroll_income_results' => :'Array', - :'document_income_results' => :'CreditSessionDocumentIncomeResult' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'document_income_results' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditSessionResults` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditSessionResults`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_add_results') - if (value = attributes[:'item_add_results']).is_a?(Array) - self.item_add_results = value - end - end - - if attributes.key?(:'bank_income_results') - if (value = attributes[:'bank_income_results']).is_a?(Array) - self.bank_income_results = value - end - end - - if attributes.key?(:'bank_employment_results') - if (value = attributes[:'bank_employment_results']).is_a?(Array) - self.bank_employment_results = value - end - end - - if attributes.key?(:'payroll_income_results') - if (value = attributes[:'payroll_income_results']).is_a?(Array) - self.payroll_income_results = value - end - end - - if attributes.key?(:'document_income_results') - self.document_income_results = attributes[:'document_income_results'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_add_results == o.item_add_results && - bank_income_results == o.bank_income_results && - bank_employment_results == o.bank_employment_results && - payroll_income_results == o.payroll_income_results && - document_income_results == o.document_income_results - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_add_results, bank_income_results, bank_employment_results, payroll_income_results, document_income_results].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_sessions_get_request.rb b/lib/plaid/models/credit_sessions_get_request.rb deleted file mode 100644 index 3d6f99757..000000000 --- a/lib/plaid/models/credit_sessions_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditSessionsGetRequest defines the request schema for `/credit/sessions/get` - class CreditSessionsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditSessionsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditSessionsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_token.nil? - invalid_properties.push('invalid value for "user_token", user_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_sessions_get_response.rb b/lib/plaid/models/credit_sessions_get_response.rb deleted file mode 100644 index 12e96a157..000000000 --- a/lib/plaid/models/credit_sessions_get_response.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # CreditSessionsGetResponse defines the response schema for `/credit/sessions/get` - class CreditSessionsGetResponse - # A list of Link sessions for the user. Sessions will be sorted in reverse chronological order. - attr_accessor :sessions - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sessions' => :'sessions', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sessions' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditSessionsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditSessionsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sessions') - if (value = attributes[:'sessions']).is_a?(Array) - self.sessions = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sessions == o.sessions && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sessions, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/credit_w2.rb b/lib/plaid/models/credit_w2.rb deleted file mode 100644 index 6cda93f19..000000000 --- a/lib/plaid/models/credit_w2.rb +++ /dev/null @@ -1,487 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # W2 is an object that represents income data taken from a W2 tax document. - class CreditW2 - attr_accessor :document_metadata - - # An identifier of the document referenced by the document metadata. - attr_accessor :document_id - - attr_accessor :employer - - attr_accessor :employee - - # The tax year of the W2 document. - attr_accessor :tax_year - - # An employee identification number or EIN. - attr_accessor :employer_id_number - - # Wages from tips and other compensation. - attr_accessor :wages_tips_other_comp - - # Federal income tax withheld for the tax year. - attr_accessor :federal_income_tax_withheld - - # Wages from social security. - attr_accessor :social_security_wages - - # Social security tax withheld for the tax year. - attr_accessor :social_security_tax_withheld - - # Wages and tips from medicare. - attr_accessor :medicare_wages_and_tips - - # Medicare tax withheld for the tax year. - attr_accessor :medicare_tax_withheld - - # Tips from social security. - attr_accessor :social_security_tips - - # Allocated tips. - attr_accessor :allocated_tips - - # Contents from box 9 on the W2. - attr_accessor :box_9 - - # Dependent care benefits. - attr_accessor :dependent_care_benefits - - # Nonqualified plans. - attr_accessor :nonqualified_plans - - attr_accessor :box_12 - - # Statutory employee. - attr_accessor :statutory_employee - - # Retirement plan. - attr_accessor :retirement_plan - - # Third party sick pay. - attr_accessor :third_party_sick_pay - - # Other. - attr_accessor :other - - attr_accessor :state_and_local_wages - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'document_metadata' => :'document_metadata', - :'document_id' => :'document_id', - :'employer' => :'employer', - :'employee' => :'employee', - :'tax_year' => :'tax_year', - :'employer_id_number' => :'employer_id_number', - :'wages_tips_other_comp' => :'wages_tips_other_comp', - :'federal_income_tax_withheld' => :'federal_income_tax_withheld', - :'social_security_wages' => :'social_security_wages', - :'social_security_tax_withheld' => :'social_security_tax_withheld', - :'medicare_wages_and_tips' => :'medicare_wages_and_tips', - :'medicare_tax_withheld' => :'medicare_tax_withheld', - :'social_security_tips' => :'social_security_tips', - :'allocated_tips' => :'allocated_tips', - :'box_9' => :'box_9', - :'dependent_care_benefits' => :'dependent_care_benefits', - :'nonqualified_plans' => :'nonqualified_plans', - :'box_12' => :'box_12', - :'statutory_employee' => :'statutory_employee', - :'retirement_plan' => :'retirement_plan', - :'third_party_sick_pay' => :'third_party_sick_pay', - :'other' => :'other', - :'state_and_local_wages' => :'state_and_local_wages' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'document_metadata' => :'CreditDocumentMetadata', - :'document_id' => :'String', - :'employer' => :'CreditPayStubEmployer', - :'employee' => :'CreditPayStubEmployee', - :'tax_year' => :'String', - :'employer_id_number' => :'String', - :'wages_tips_other_comp' => :'String', - :'federal_income_tax_withheld' => :'String', - :'social_security_wages' => :'String', - :'social_security_tax_withheld' => :'String', - :'medicare_wages_and_tips' => :'String', - :'medicare_tax_withheld' => :'String', - :'social_security_tips' => :'String', - :'allocated_tips' => :'String', - :'box_9' => :'String', - :'dependent_care_benefits' => :'String', - :'nonqualified_plans' => :'String', - :'box_12' => :'Array', - :'statutory_employee' => :'String', - :'retirement_plan' => :'String', - :'third_party_sick_pay' => :'String', - :'other' => :'String', - :'state_and_local_wages' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'tax_year', - :'employer_id_number', - :'wages_tips_other_comp', - :'federal_income_tax_withheld', - :'social_security_wages', - :'social_security_tax_withheld', - :'medicare_wages_and_tips', - :'medicare_tax_withheld', - :'social_security_tips', - :'allocated_tips', - :'box_9', - :'dependent_care_benefits', - :'nonqualified_plans', - :'statutory_employee', - :'retirement_plan', - :'third_party_sick_pay', - :'other', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CreditW2` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CreditW2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'document_metadata') - self.document_metadata = attributes[:'document_metadata'] - end - - if attributes.key?(:'document_id') - self.document_id = attributes[:'document_id'] - end - - if attributes.key?(:'employer') - self.employer = attributes[:'employer'] - end - - if attributes.key?(:'employee') - self.employee = attributes[:'employee'] - end - - if attributes.key?(:'tax_year') - self.tax_year = attributes[:'tax_year'] - end - - if attributes.key?(:'employer_id_number') - self.employer_id_number = attributes[:'employer_id_number'] - end - - if attributes.key?(:'wages_tips_other_comp') - self.wages_tips_other_comp = attributes[:'wages_tips_other_comp'] - end - - if attributes.key?(:'federal_income_tax_withheld') - self.federal_income_tax_withheld = attributes[:'federal_income_tax_withheld'] - end - - if attributes.key?(:'social_security_wages') - self.social_security_wages = attributes[:'social_security_wages'] - end - - if attributes.key?(:'social_security_tax_withheld') - self.social_security_tax_withheld = attributes[:'social_security_tax_withheld'] - end - - if attributes.key?(:'medicare_wages_and_tips') - self.medicare_wages_and_tips = attributes[:'medicare_wages_and_tips'] - end - - if attributes.key?(:'medicare_tax_withheld') - self.medicare_tax_withheld = attributes[:'medicare_tax_withheld'] - end - - if attributes.key?(:'social_security_tips') - self.social_security_tips = attributes[:'social_security_tips'] - end - - if attributes.key?(:'allocated_tips') - self.allocated_tips = attributes[:'allocated_tips'] - end - - if attributes.key?(:'box_9') - self.box_9 = attributes[:'box_9'] - end - - if attributes.key?(:'dependent_care_benefits') - self.dependent_care_benefits = attributes[:'dependent_care_benefits'] - end - - if attributes.key?(:'nonqualified_plans') - self.nonqualified_plans = attributes[:'nonqualified_plans'] - end - - if attributes.key?(:'box_12') - if (value = attributes[:'box_12']).is_a?(Array) - self.box_12 = value - end - end - - if attributes.key?(:'statutory_employee') - self.statutory_employee = attributes[:'statutory_employee'] - end - - if attributes.key?(:'retirement_plan') - self.retirement_plan = attributes[:'retirement_plan'] - end - - if attributes.key?(:'third_party_sick_pay') - self.third_party_sick_pay = attributes[:'third_party_sick_pay'] - end - - if attributes.key?(:'other') - self.other = attributes[:'other'] - end - - if attributes.key?(:'state_and_local_wages') - if (value = attributes[:'state_and_local_wages']).is_a?(Array) - self.state_and_local_wages = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @document_metadata.nil? - invalid_properties.push('invalid value for "document_metadata", document_metadata cannot be nil.') - end - - if @document_id.nil? - invalid_properties.push('invalid value for "document_id", document_id cannot be nil.') - end - - if @employer.nil? - invalid_properties.push('invalid value for "employer", employer cannot be nil.') - end - - if @employee.nil? - invalid_properties.push('invalid value for "employee", employee cannot be nil.') - end - - if @box_12.nil? - invalid_properties.push('invalid value for "box_12", box_12 cannot be nil.') - end - - if @state_and_local_wages.nil? - invalid_properties.push('invalid value for "state_and_local_wages", state_and_local_wages cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @document_metadata.nil? - return false if @document_id.nil? - return false if @employer.nil? - return false if @employee.nil? - return false if @box_12.nil? - return false if @state_and_local_wages.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - document_metadata == o.document_metadata && - document_id == o.document_id && - employer == o.employer && - employee == o.employee && - tax_year == o.tax_year && - employer_id_number == o.employer_id_number && - wages_tips_other_comp == o.wages_tips_other_comp && - federal_income_tax_withheld == o.federal_income_tax_withheld && - social_security_wages == o.social_security_wages && - social_security_tax_withheld == o.social_security_tax_withheld && - medicare_wages_and_tips == o.medicare_wages_and_tips && - medicare_tax_withheld == o.medicare_tax_withheld && - social_security_tips == o.social_security_tips && - allocated_tips == o.allocated_tips && - box_9 == o.box_9 && - dependent_care_benefits == o.dependent_care_benefits && - nonqualified_plans == o.nonqualified_plans && - box_12 == o.box_12 && - statutory_employee == o.statutory_employee && - retirement_plan == o.retirement_plan && - third_party_sick_pay == o.third_party_sick_pay && - other == o.other && - state_and_local_wages == o.state_and_local_wages - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [document_metadata, document_id, employer, employee, tax_year, employer_id_number, wages_tips_other_comp, federal_income_tax_withheld, social_security_wages, social_security_tax_withheld, medicare_wages_and_tips, medicare_tax_withheld, social_security_tips, allocated_tips, box_9, dependent_care_benefits, nonqualified_plans, box_12, statutory_employee, retirement_plan, third_party_sick_pay, other, state_and_local_wages].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/customer_initiated_return_risk.rb b/lib/plaid/models/customer_initiated_return_risk.rb deleted file mode 100644 index 62256f108..000000000 --- a/lib/plaid/models/customer_initiated_return_risk.rb +++ /dev/null @@ -1,301 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The object contains a risk score and a risk tier that evaluate the transaction return risk of an unauthorized debit. Common return codes in this category include: \"R05\", \"R07\", \"R10\", \"R11\", \"R29\". These returns typically have a return time frame of up to 60 calendar days. During this period, the customer of financial institutions can dispute a transaction as unauthorized. - class CustomerInitiatedReturnRisk - # A score from 1-99 that indicates the transaction return risk: a higher risk score suggests a higher return likelihood. - attr_accessor :score - - # A tier corresponding to the projected likelihood that the transaction, if initiated, will be subject to a return. In the `customer_initiated_return_risk` object, there are five risk tiers corresponding to the scores: 1: Predicted customer-initiated return incidence rate between 0.00% - 0.02% 2: Predicted customer-initiated return incidence rate between 0.02% - 0.05% 3: Predicted customer-initiated return incidence rate between 0.05% - 0.1% 4: Predicted customer-initiated return incidence rate between 0.1% - 0.5% 5: Predicted customer-initiated return incidence rate greater than 0.5% - attr_accessor :risk_tier - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'score' => :'score', - :'risk_tier' => :'risk_tier' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'score' => :'Integer', - :'risk_tier' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::CustomerInitiatedReturnRisk` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::CustomerInitiatedReturnRisk`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'score') - self.score = attributes[:'score'] - end - - if attributes.key?(:'risk_tier') - self.risk_tier = attributes[:'risk_tier'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @score.nil? - invalid_properties.push('invalid value for "score", score cannot be nil.') - end - - if @score > 99 - invalid_properties.push('invalid value for "score", must be smaller than or equal to 99.') - end - - if @score < 1 - invalid_properties.push('invalid value for "score", must be greater than or equal to 1.') - end - - - if @risk_tier.nil? - invalid_properties.push('invalid value for "risk_tier", risk_tier cannot be nil.') - end - - if @risk_tier > 5 - invalid_properties.push('invalid value for "risk_tier", must be smaller than or equal to 5.') - end - - if @risk_tier < 1 - invalid_properties.push('invalid value for "risk_tier", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @score.nil? - return false if @score > 99 - return false if @score < 1 - return false if @risk_tier.nil? - return false if @risk_tier > 5 - return false if @risk_tier < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] score Value to be assigned - def score=(score) - if score.nil? - fail ArgumentError, 'score cannot be nil' - end - - if score > 99 - fail ArgumentError, 'invalid value for "score", must be smaller than or equal to 99.' - end - - if score < 1 - fail ArgumentError, 'invalid value for "score", must be greater than or equal to 1.' - end - - - @score = score - end - - # Custom attribute writer method with validation - # @param [Object] risk_tier Value to be assigned - def risk_tier=(risk_tier) - if risk_tier.nil? - fail ArgumentError, 'risk_tier cannot be nil' - end - - if risk_tier > 5 - fail ArgumentError, 'invalid value for "risk_tier", must be smaller than or equal to 5.' - end - - if risk_tier < 1 - fail ArgumentError, 'invalid value for "risk_tier", must be greater than or equal to 1.' - end - - - @risk_tier = risk_tier - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - score == o.score && - risk_tier == o.risk_tier - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [score, risk_tier].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/dashboard_user.rb b/lib/plaid/models/dashboard_user.rb deleted file mode 100644 index 3bc24955a..000000000 --- a/lib/plaid/models/dashboard_user.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Account information associated with a team member with access to the Plaid dashboard. - class DashboardUser - # ID of the associated user. - attr_accessor :id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - # A valid email address. - attr_accessor :email_address - - attr_accessor :status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'created_at' => :'created_at', - :'email_address' => :'email_address', - :'status' => :'status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'created_at' => :'Time', - :'email_address' => :'String', - :'status' => :'DashboardUserStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DashboardUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DashboardUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @email_address.nil? - invalid_properties.push('invalid value for "email_address", email_address cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @created_at.nil? - return false if @email_address.nil? - return false if @status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - created_at == o.created_at && - email_address == o.email_address && - status == o.status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, created_at, email_address, status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/dashboard_user_get_request.rb b/lib/plaid/models/dashboard_user_get_request.rb deleted file mode 100644 index 1f87473fb..000000000 --- a/lib/plaid/models/dashboard_user_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for fetching a dashboard user - class DashboardUserGetRequest - # ID of the associated user. - attr_accessor :dashboard_user_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'dashboard_user_id' => :'dashboard_user_id', - :'secret' => :'secret', - :'client_id' => :'client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'dashboard_user_id' => :'String', - :'secret' => :'String', - :'client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DashboardUserGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DashboardUserGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'dashboard_user_id') - self.dashboard_user_id = attributes[:'dashboard_user_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @dashboard_user_id.nil? - invalid_properties.push('invalid value for "dashboard_user_id", dashboard_user_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @dashboard_user_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - dashboard_user_id == o.dashboard_user_id && - secret == o.secret && - client_id == o.client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [dashboard_user_id, secret, client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/dashboard_user_get_response.rb b/lib/plaid/models/dashboard_user_get_response.rb deleted file mode 100644 index 9e81ed3c2..000000000 --- a/lib/plaid/models/dashboard_user_get_response.rb +++ /dev/null @@ -1,307 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Account information associated with a team member with access to the Plaid dashboard. - class DashboardUserGetResponse - # ID of the associated user. - attr_accessor :id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - # A valid email address. - attr_accessor :email_address - - attr_accessor :status - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'created_at' => :'created_at', - :'email_address' => :'email_address', - :'status' => :'status', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'created_at' => :'Time', - :'email_address' => :'String', - :'status' => :'DashboardUserStatus', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DashboardUserGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DashboardUserGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @email_address.nil? - invalid_properties.push('invalid value for "email_address", email_address cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @created_at.nil? - return false if @email_address.nil? - return false if @status.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - created_at == o.created_at && - email_address == o.email_address && - status == o.status && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, created_at, email_address, status, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/dashboard_user_list_request.rb b/lib/plaid/models/dashboard_user_list_request.rb deleted file mode 100644 index 2e2743d4f..000000000 --- a/lib/plaid/models/dashboard_user_list_request.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for listing dashboard users - class DashboardUserListRequest - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # An identifier that determines which page of results you receive. - attr_accessor :cursor - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'secret' => :'secret', - :'client_id' => :'client_id', - :'cursor' => :'cursor' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'secret' => :'String', - :'client_id' => :'String', - :'cursor' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'cursor' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DashboardUserListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DashboardUserListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - secret == o.secret && - client_id == o.client_id && - cursor == o.cursor - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [secret, client_id, cursor].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/dashboard_user_list_response.rb b/lib/plaid/models/dashboard_user_list_response.rb deleted file mode 100644 index 9efa09f5c..000000000 --- a/lib/plaid/models/dashboard_user_list_response.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Paginated list of dashboard users - class DashboardUserListResponse - # List of dashboard users - attr_accessor :dashboard_users - - # An identifier that determines which page of results you receive. - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'dashboard_users' => :'dashboard_users', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'dashboard_users' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DashboardUserListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DashboardUserListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'dashboard_users') - if (value = attributes[:'dashboard_users']).is_a?(Array) - self.dashboard_users = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @dashboard_users.nil? - invalid_properties.push('invalid value for "dashboard_users", dashboard_users cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @dashboard_users.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - dashboard_users == o.dashboard_users && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [dashboard_users, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/dashboard_user_status.rb b/lib/plaid/models/dashboard_user_status.rb deleted file mode 100644 index 719fad45a..000000000 --- a/lib/plaid/models/dashboard_user_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class DashboardUserStatus - INVITED = "invited".freeze - ACTIVE = "active".freeze - DEACTIVATED = "deactivated".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/date_range.rb b/lib/plaid/models/date_range.rb deleted file mode 100644 index 77542fad7..000000000 --- a/lib/plaid/models/date_range.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A date range with a start and end date - class DateRange - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :beginning - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :ending - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'beginning' => :'beginning', - :'ending' => :'ending' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'beginning' => :'Date', - :'ending' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DateRange` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DateRange`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'beginning') - self.beginning = attributes[:'beginning'] - end - - if attributes.key?(:'ending') - self.ending = attributes[:'ending'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @beginning.nil? - invalid_properties.push('invalid value for "beginning", beginning cannot be nil.') - end - - if @ending.nil? - invalid_properties.push('invalid value for "ending", ending cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @beginning.nil? - return false if @ending.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - beginning == o.beginning && - ending == o.ending - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [beginning, ending].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deductions.rb b/lib/plaid/models/deductions.rb deleted file mode 100644 index 0abb2ea20..000000000 --- a/lib/plaid/models/deductions.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object with the deduction information found on a paystub. - class Deductions - attr_accessor :subtotals - - attr_accessor :breakdown - - attr_accessor :totals - - attr_accessor :total - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'subtotals' => :'subtotals', - :'breakdown' => :'breakdown', - :'totals' => :'totals', - :'total' => :'total' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'subtotals' => :'Array', - :'breakdown' => :'Array', - :'totals' => :'Array', - :'total' => :'DeductionsTotal' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Deductions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Deductions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'subtotals') - if (value = attributes[:'subtotals']).is_a?(Array) - self.subtotals = value - end - end - - if attributes.key?(:'breakdown') - if (value = attributes[:'breakdown']).is_a?(Array) - self.breakdown = value - end - end - - if attributes.key?(:'totals') - if (value = attributes[:'totals']).is_a?(Array) - self.totals = value - end - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @breakdown.nil? - invalid_properties.push('invalid value for "breakdown", breakdown cannot be nil.') - end - - if @total.nil? - invalid_properties.push('invalid value for "total", total cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @breakdown.nil? - return false if @total.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - subtotals == o.subtotals && - breakdown == o.breakdown && - totals == o.totals && - total == o.total - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [subtotals, breakdown, totals, total].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deductions_breakdown.rb b/lib/plaid/models/deductions_breakdown.rb deleted file mode 100644 index ee4292bf7..000000000 --- a/lib/plaid/models/deductions_breakdown.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing the deduction line items for the pay period - class DeductionsBreakdown - # Raw amount of the deduction - attr_accessor :current_amount - - # Description of the deduction line item - attr_accessor :description - - # The ISO-4217 currency code of the line item. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # The unofficial currency code associated with the line item. 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. - attr_accessor :unofficial_currency_code - - # The year-to-date amount of the deduction - attr_accessor :ytd_amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'current_amount' => :'current_amount', - :'description' => :'description', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'ytd_amount' => :'ytd_amount' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'current_amount' => :'Float', - :'description' => :'String', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'ytd_amount' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'current_amount', - :'description', - :'iso_currency_code', - :'unofficial_currency_code', - :'ytd_amount' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DeductionsBreakdown` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DeductionsBreakdown`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'current_amount') - self.current_amount = attributes[:'current_amount'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'ytd_amount') - self.ytd_amount = attributes[:'ytd_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - current_amount == o.current_amount && - description == o.description && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - ytd_amount == o.ytd_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [current_amount, description, iso_currency_code, unofficial_currency_code, ytd_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deductions_total.rb b/lib/plaid/models/deductions_total.rb deleted file mode 100644 index 76b8f5a47..000000000 --- a/lib/plaid/models/deductions_total.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing the total deductions for the pay period - class DeductionsTotal - # Raw amount of the deduction - attr_accessor :current_amount - - # The ISO-4217 currency code of the line item. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # The unofficial currency code associated with the line item. 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. - attr_accessor :unofficial_currency_code - - # The year-to-date total amount of the deductions - attr_accessor :ytd_amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'current_amount' => :'current_amount', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'ytd_amount' => :'ytd_amount' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'current_amount' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'ytd_amount' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'current_amount', - :'iso_currency_code', - :'unofficial_currency_code', - :'ytd_amount' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DeductionsTotal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DeductionsTotal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'current_amount') - self.current_amount = attributes[:'current_amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'ytd_amount') - self.ytd_amount = attributes[:'ytd_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - current_amount == o.current_amount && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - ytd_amount == o.ytd_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [current_amount, iso_currency_code, unofficial_currency_code, ytd_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/default_update_webhook.rb b/lib/plaid/models/default_update_webhook.rb deleted file mode 100644 index c194a6df3..000000000 --- a/lib/plaid/models/default_update_webhook.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class DefaultUpdateWebhook - # `TRANSACTIONS` - attr_accessor :webhook_type - - # `DEFAULT_UPDATE` - attr_accessor :webhook_code - - attr_accessor :error - - # The number of new transactions detected since the last time this webhook was fired. - attr_accessor :new_transactions - - # The `item_id` of the Item the webhook relates to. - attr_accessor :item_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'error' => :'error', - :'new_transactions' => :'new_transactions', - :'item_id' => :'item_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'error' => :'PlaidError', - :'new_transactions' => :'Float', - :'item_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DefaultUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DefaultUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'new_transactions') - self.new_transactions = attributes[:'new_transactions'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @new_transactions.nil? - invalid_properties.push('invalid value for "new_transactions", new_transactions cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @new_transactions.nil? - return false if @item_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - error == o.error && - new_transactions == o.new_transactions && - item_id == o.item_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, error, new_transactions, item_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deposit_switch_address_data.rb b/lib/plaid/models/deposit_switch_address_data.rb deleted file mode 100644 index e105092ac..000000000 --- a/lib/plaid/models/deposit_switch_address_data.rb +++ /dev/null @@ -1,286 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The user's address. - class DepositSwitchAddressData - # The full city name - attr_accessor :city - - # The region or state Example: `\"NC\"` - attr_accessor :region - - # The full street address Example: `\"564 Main Street, APT 15\"` - attr_accessor :street - - # The postal code - attr_accessor :postal_code - - # The ISO 3166-1 alpha-2 country code - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'region' => :'region', - :'street' => :'street', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'region' => :'String', - :'street' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DepositSwitchAddressData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DepositSwitchAddressData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @city.nil? - invalid_properties.push('invalid value for "city", city cannot be nil.') - end - - if @region.nil? - invalid_properties.push('invalid value for "region", region cannot be nil.') - end - - if @street.nil? - invalid_properties.push('invalid value for "street", street cannot be nil.') - end - - if @postal_code.nil? - invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.') - end - - if @country.nil? - invalid_properties.push('invalid value for "country", country cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @city.nil? - return false if @region.nil? - return false if @street.nil? - return false if @postal_code.nil? - return false if @country.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - region == o.region && - street == o.street && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, region, street, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deposit_switch_alt_create_request.rb b/lib/plaid/models/deposit_switch_alt_create_request.rb deleted file mode 100644 index a87d006bb..000000000 --- a/lib/plaid/models/deposit_switch_alt_create_request.rb +++ /dev/null @@ -1,313 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # DepositSwitchAltCreateRequest defines the request schema for `/deposit_switch/alt/create` - class DepositSwitchAltCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - attr_accessor :target_account - - attr_accessor :target_user - - attr_accessor :options - - # ISO-3166-1 alpha-2 country code standard. - attr_accessor :country_code - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'target_account' => :'target_account', - :'target_user' => :'target_user', - :'options' => :'options', - :'country_code' => :'country_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'target_account' => :'DepositSwitchTargetAccount', - :'target_user' => :'DepositSwitchTargetUser', - :'options' => :'DepositSwitchCreateRequestOptions', - :'country_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'country_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DepositSwitchAltCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DepositSwitchAltCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'target_account') - self.target_account = attributes[:'target_account'] - end - - if attributes.key?(:'target_user') - self.target_user = attributes[:'target_user'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @target_account.nil? - invalid_properties.push('invalid value for "target_account", target_account cannot be nil.') - end - - if @target_user.nil? - invalid_properties.push('invalid value for "target_user", target_user cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @target_account.nil? - return false if @target_user.nil? - country_code_validator = EnumAttributeValidator.new('String', ["US", "CA"]) - return false unless country_code_validator.valid?(@country_code) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] country_code Object to be assigned - def country_code=(country_code) - validator = EnumAttributeValidator.new('String', ["US", "CA"]) - unless validator.valid?(country_code) - fail ArgumentError, "invalid value for \"country_code\", must be one of #{validator.allowable_values}." - end - @country_code = country_code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - target_account == o.target_account && - target_user == o.target_user && - options == o.options && - country_code == o.country_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, target_account, target_user, options, country_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deposit_switch_alt_create_response.rb b/lib/plaid/models/deposit_switch_alt_create_response.rb deleted file mode 100644 index 89c9d962a..000000000 --- a/lib/plaid/models/deposit_switch_alt_create_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # DepositSwitchAltCreateResponse defines the response schema for `/deposit_switch/alt/create` - class DepositSwitchAltCreateResponse - # ID of the deposit switch. This ID is persisted throughout the lifetime of the deposit switch. - attr_accessor :deposit_switch_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deposit_switch_id' => :'deposit_switch_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deposit_switch_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DepositSwitchAltCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DepositSwitchAltCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deposit_switch_id') - self.deposit_switch_id = attributes[:'deposit_switch_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @deposit_switch_id.nil? - invalid_properties.push('invalid value for "deposit_switch_id", deposit_switch_id cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @deposit_switch_id.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deposit_switch_id == o.deposit_switch_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deposit_switch_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deposit_switch_create_request.rb b/lib/plaid/models/deposit_switch_create_request.rb deleted file mode 100644 index f2fa6c83b..000000000 --- a/lib/plaid/models/deposit_switch_create_request.rb +++ /dev/null @@ -1,315 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # DepositSwitchCreateRequest defines the request schema for `/deposit_switch/create` - class DepositSwitchCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Access token for the target Item, typically provided in the Import Item response. - attr_accessor :target_access_token - - # Plaid Account ID that specifies the target bank account. This account will become the recipient for a user's direct deposit. - attr_accessor :target_account_id - - # ISO-3166-1 alpha-2 country code standard. - attr_accessor :country_code - - attr_accessor :options - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'target_access_token' => :'target_access_token', - :'target_account_id' => :'target_account_id', - :'country_code' => :'country_code', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'target_access_token' => :'String', - :'target_account_id' => :'String', - :'country_code' => :'String', - :'options' => :'DepositSwitchCreateRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'country_code', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DepositSwitchCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DepositSwitchCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'target_access_token') - self.target_access_token = attributes[:'target_access_token'] - end - - if attributes.key?(:'target_account_id') - self.target_account_id = attributes[:'target_account_id'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @target_access_token.nil? - invalid_properties.push('invalid value for "target_access_token", target_access_token cannot be nil.') - end - - if @target_account_id.nil? - invalid_properties.push('invalid value for "target_account_id", target_account_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @target_access_token.nil? - return false if @target_account_id.nil? - country_code_validator = EnumAttributeValidator.new('String', ["US", "CA"]) - return false unless country_code_validator.valid?(@country_code) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] country_code Object to be assigned - def country_code=(country_code) - validator = EnumAttributeValidator.new('String', ["US", "CA"]) - unless validator.valid?(country_code) - fail ArgumentError, "invalid value for \"country_code\", must be one of #{validator.allowable_values}." - end - @country_code = country_code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - target_access_token == o.target_access_token && - target_account_id == o.target_account_id && - country_code == o.country_code && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, target_access_token, target_account_id, country_code, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deposit_switch_create_request_options.rb b/lib/plaid/models/deposit_switch_create_request_options.rb deleted file mode 100644 index 40abddc3d..000000000 --- a/lib/plaid/models/deposit_switch_create_request_options.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Options to configure the `/deposit_switch/create` request. If provided, cannot be `null`. - class DepositSwitchCreateRequestOptions - # The URL registered to receive webhooks when the status of a deposit switch request has changed. - attr_accessor :webhook - - # 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. - attr_accessor :transaction_item_access_tokens - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook' => :'webhook', - :'transaction_item_access_tokens' => :'transaction_item_access_tokens' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook' => :'String', - :'transaction_item_access_tokens' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'webhook', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DepositSwitchCreateRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DepositSwitchCreateRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - - if attributes.key?(:'transaction_item_access_tokens') - if (value = attributes[:'transaction_item_access_tokens']).is_a?(Array) - self.transaction_item_access_tokens = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - - if !@transaction_item_access_tokens.nil? && @transaction_item_access_tokens.length < 1 - invalid_properties.push('invalid value for "transaction_item_access_tokens", number of items must be greater than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@transaction_item_access_tokens.nil? && @transaction_item_access_tokens.length > 99 - return false if !@transaction_item_access_tokens.nil? && @transaction_item_access_tokens.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] transaction_item_access_tokens Value to be assigned - def transaction_item_access_tokens=(transaction_item_access_tokens) - - if !transaction_item_access_tokens.nil? && transaction_item_access_tokens.length < 1 - fail ArgumentError, 'invalid value for "transaction_item_access_tokens", number of items must be greater than or equal to 1.' - end - - @transaction_item_access_tokens = transaction_item_access_tokens - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook == o.webhook && - transaction_item_access_tokens == o.transaction_item_access_tokens - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook, transaction_item_access_tokens].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deposit_switch_create_response.rb b/lib/plaid/models/deposit_switch_create_response.rb deleted file mode 100644 index 06f88f665..000000000 --- a/lib/plaid/models/deposit_switch_create_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # DepositSwitchCreateResponse defines the response schema for `/deposit_switch/create` - class DepositSwitchCreateResponse - # ID of the deposit switch. This ID is persisted throughout the lifetime of the deposit switch. - attr_accessor :deposit_switch_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deposit_switch_id' => :'deposit_switch_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deposit_switch_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DepositSwitchCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DepositSwitchCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deposit_switch_id') - self.deposit_switch_id = attributes[:'deposit_switch_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @deposit_switch_id.nil? - invalid_properties.push('invalid value for "deposit_switch_id", deposit_switch_id cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @deposit_switch_id.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deposit_switch_id == o.deposit_switch_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deposit_switch_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deposit_switch_get_request.rb b/lib/plaid/models/deposit_switch_get_request.rb deleted file mode 100644 index 9164e4880..000000000 --- a/lib/plaid/models/deposit_switch_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # DepositSwitchGetRequest defines the request schema for `/deposit_switch/get` - class DepositSwitchGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the deposit switch - attr_accessor :deposit_switch_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'deposit_switch_id' => :'deposit_switch_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'deposit_switch_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DepositSwitchGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DepositSwitchGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'deposit_switch_id') - self.deposit_switch_id = attributes[:'deposit_switch_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @deposit_switch_id.nil? - invalid_properties.push('invalid value for "deposit_switch_id", deposit_switch_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @deposit_switch_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - deposit_switch_id == o.deposit_switch_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, deposit_switch_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deposit_switch_get_response.rb b/lib/plaid/models/deposit_switch_get_response.rb deleted file mode 100644 index 92f1fab89..000000000 --- a/lib/plaid/models/deposit_switch_get_response.rb +++ /dev/null @@ -1,449 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # DepositSwitchGetResponse defines the response schema for `/deposit_switch/get` - class DepositSwitchGetResponse - # The ID of the deposit switch. - attr_accessor :deposit_switch_id - - # The ID of the bank account the direct deposit was switched to. - attr_accessor :target_account_id - - # The ID of the Item the direct deposit was switched to. - attr_accessor :target_item_id - - # 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. - `processing` – The deposit switch request has been submitted and is being processed. - `completed` – The user's employer has fulfilled the deposit switch request. - `error` – There was an error processing the deposit switch request. - attr_accessor :state - - # The method used to make the deposit switch. - `instant` – User instantly switched their direct deposit to a new or existing bank account by connecting their payroll or employer account. - `mail` – User requested that Plaid contact their employer by mail to make the direct deposit switch. - `pdf` – User generated a PDF or email to be sent to their employer with the information necessary to make the deposit switch.' - attr_accessor :switch_method - - # 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. - attr_accessor :account_has_multiple_allocations - - # When `true`, the target account is allocated the remainder of direct deposit after all other allocations have been deducted. When `false`, user’s direct deposit is allocated as a percent or amount. Always `null` if the deposit switch has not been completed. - attr_accessor :is_allocated_remainder - - # The percentage of direct deposit allocated to the target account. Always `null` if the target account is not allocated a percentage or if the deposit switch has not been completed or if `is_allocated_remainder` is true. - attr_accessor :percent_allocated - - # The dollar amount of direct deposit allocated to the target account. Always `null` if the target account is not allocated an amount or if the deposit switch has not been completed. - attr_accessor :amount_allocated - - # The name of the employer selected by the user. If the user did not select an employer, the value returned is `null`. - attr_accessor :employer_name - - # The ID of the employer selected by the user. If the user did not select an employer, the value returned is `null`. - attr_accessor :employer_id - - # The name of the institution selected by the user. If the user did not select an institution, the value returned is `null`. - attr_accessor :institution_name - - # The ID of the institution selected by the user. If the user did not select an institution, the value returned is `null`. - attr_accessor :institution_id - - # [ISO 8601](https://wikipedia.org/wiki/ISO_8601) date the deposit switch was created. - attr_accessor :date_created - - # [ISO 8601](https://wikipedia.org/wiki/ISO_8601) date the deposit switch was completed. Always `null` if the deposit switch has not been completed. - attr_accessor :date_completed - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deposit_switch_id' => :'deposit_switch_id', - :'target_account_id' => :'target_account_id', - :'target_item_id' => :'target_item_id', - :'state' => :'state', - :'switch_method' => :'switch_method', - :'account_has_multiple_allocations' => :'account_has_multiple_allocations', - :'is_allocated_remainder' => :'is_allocated_remainder', - :'percent_allocated' => :'percent_allocated', - :'amount_allocated' => :'amount_allocated', - :'employer_name' => :'employer_name', - :'employer_id' => :'employer_id', - :'institution_name' => :'institution_name', - :'institution_id' => :'institution_id', - :'date_created' => :'date_created', - :'date_completed' => :'date_completed', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deposit_switch_id' => :'String', - :'target_account_id' => :'String', - :'target_item_id' => :'String', - :'state' => :'String', - :'switch_method' => :'String', - :'account_has_multiple_allocations' => :'Boolean', - :'is_allocated_remainder' => :'Boolean', - :'percent_allocated' => :'Float', - :'amount_allocated' => :'Float', - :'employer_name' => :'String', - :'employer_id' => :'String', - :'institution_name' => :'String', - :'institution_id' => :'String', - :'date_created' => :'Date', - :'date_completed' => :'Date', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'target_account_id', - :'target_item_id', - :'switch_method', - :'account_has_multiple_allocations', - :'is_allocated_remainder', - :'percent_allocated', - :'amount_allocated', - :'employer_name', - :'employer_id', - :'institution_name', - :'institution_id', - :'date_completed', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DepositSwitchGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DepositSwitchGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deposit_switch_id') - self.deposit_switch_id = attributes[:'deposit_switch_id'] - end - - if attributes.key?(:'target_account_id') - self.target_account_id = attributes[:'target_account_id'] - end - - if attributes.key?(:'target_item_id') - self.target_item_id = attributes[:'target_item_id'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'switch_method') - self.switch_method = attributes[:'switch_method'] - end - - if attributes.key?(:'account_has_multiple_allocations') - self.account_has_multiple_allocations = attributes[:'account_has_multiple_allocations'] - end - - if attributes.key?(:'is_allocated_remainder') - self.is_allocated_remainder = attributes[:'is_allocated_remainder'] - end - - if attributes.key?(:'percent_allocated') - self.percent_allocated = attributes[:'percent_allocated'] - end - - if attributes.key?(:'amount_allocated') - self.amount_allocated = attributes[:'amount_allocated'] - end - - if attributes.key?(:'employer_name') - self.employer_name = attributes[:'employer_name'] - end - - if attributes.key?(:'employer_id') - self.employer_id = attributes[:'employer_id'] - end - - if attributes.key?(:'institution_name') - self.institution_name = attributes[:'institution_name'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'date_created') - self.date_created = attributes[:'date_created'] - end - - if attributes.key?(:'date_completed') - self.date_completed = attributes[:'date_completed'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @deposit_switch_id.nil? - invalid_properties.push('invalid value for "deposit_switch_id", deposit_switch_id cannot be nil.') - end - - if @state.nil? - invalid_properties.push('invalid value for "state", state cannot be nil.') - end - - if @date_created.nil? - invalid_properties.push('invalid value for "date_created", date_created cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @deposit_switch_id.nil? - return false if @state.nil? - state_validator = EnumAttributeValidator.new('String', ["initialized", "processing", "completed", "error"]) - return false unless state_validator.valid?(@state) - switch_method_validator = EnumAttributeValidator.new('String', ["instant", "mail", "pdf", "null"]) - return false unless switch_method_validator.valid?(@switch_method) - return false if @date_created.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] state Object to be assigned - def state=(state) - validator = EnumAttributeValidator.new('String', ["initialized", "processing", "completed", "error"]) - unless validator.valid?(state) - fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}." - end - @state = state - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] switch_method Object to be assigned - def switch_method=(switch_method) - validator = EnumAttributeValidator.new('String', ["instant", "mail", "pdf", "null"]) - unless validator.valid?(switch_method) - fail ArgumentError, "invalid value for \"switch_method\", must be one of #{validator.allowable_values}." - end - @switch_method = switch_method - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deposit_switch_id == o.deposit_switch_id && - target_account_id == o.target_account_id && - target_item_id == o.target_item_id && - state == o.state && - switch_method == o.switch_method && - account_has_multiple_allocations == o.account_has_multiple_allocations && - is_allocated_remainder == o.is_allocated_remainder && - percent_allocated == o.percent_allocated && - amount_allocated == o.amount_allocated && - employer_name == o.employer_name && - employer_id == o.employer_id && - institution_name == o.institution_name && - institution_id == o.institution_id && - date_created == o.date_created && - date_completed == o.date_completed && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deposit_switch_id, target_account_id, target_item_id, state, switch_method, account_has_multiple_allocations, is_allocated_remainder, percent_allocated, amount_allocated, employer_name, employer_id, institution_name, institution_id, date_created, date_completed, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deposit_switch_state_update_webhook.rb b/lib/plaid/models/deposit_switch_state_update_webhook.rb deleted file mode 100644 index 5a946878c..000000000 --- a/lib/plaid/models/deposit_switch_state_update_webhook.rb +++ /dev/null @@ -1,282 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when the status of a deposit switch request has changed. - class DepositSwitchStateUpdateWebhook - # `\"DEPOSIT_SWITCH\"` - attr_accessor :webhook_type - - # `\"SWITCH_STATE_UPDATE\"` - attr_accessor :webhook_code - - # 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. `processing`: The deposit switch request has been submitted and is being processed. `completed`: The user's employer has fulfilled and completed the deposit switch request. `error`: There was an error processing the deposit switch request. For more information, see the [Deposit Switch API reference](/docs/deposit-switch/reference#deposit_switchget). - attr_accessor :state - - # The ID of the deposit switch. - attr_accessor :deposit_switch_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'state' => :'state', - :'deposit_switch_id' => :'deposit_switch_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'state' => :'String', - :'deposit_switch_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DepositSwitchStateUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DepositSwitchStateUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'deposit_switch_id') - self.deposit_switch_id = attributes[:'deposit_switch_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - state == o.state && - deposit_switch_id == o.deposit_switch_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, state, deposit_switch_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deposit_switch_target_account.rb b/lib/plaid/models/deposit_switch_target_account.rb deleted file mode 100644 index e254a51bc..000000000 --- a/lib/plaid/models/deposit_switch_target_account.rb +++ /dev/null @@ -1,305 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The deposit switch destination account - class DepositSwitchTargetAccount - # Account number for deposit switch destination - attr_accessor :account_number - - # Routing number for deposit switch destination - attr_accessor :routing_number - - # 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. - attr_accessor :account_name - - # The account subtype of the account, either `checking` or `savings`. - attr_accessor :account_subtype - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_number' => :'account_number', - :'routing_number' => :'routing_number', - :'account_name' => :'account_name', - :'account_subtype' => :'account_subtype' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_number' => :'String', - :'routing_number' => :'String', - :'account_name' => :'String', - :'account_subtype' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DepositSwitchTargetAccount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DepositSwitchTargetAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_number') - self.account_number = attributes[:'account_number'] - end - - if attributes.key?(:'routing_number') - self.routing_number = attributes[:'routing_number'] - end - - if attributes.key?(:'account_name') - self.account_name = attributes[:'account_name'] - end - - if attributes.key?(:'account_subtype') - self.account_subtype = attributes[:'account_subtype'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_number.nil? - invalid_properties.push('invalid value for "account_number", account_number cannot be nil.') - end - - if @routing_number.nil? - invalid_properties.push('invalid value for "routing_number", routing_number cannot be nil.') - end - - if @account_name.nil? - invalid_properties.push('invalid value for "account_name", account_name cannot be nil.') - end - - if @account_subtype.nil? - invalid_properties.push('invalid value for "account_subtype", account_subtype cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_number.nil? - return false if @routing_number.nil? - return false if @account_name.nil? - return false if @account_subtype.nil? - account_subtype_validator = EnumAttributeValidator.new('String', ["checking", "savings"]) - return false unless account_subtype_validator.valid?(@account_subtype) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] account_subtype Object to be assigned - def account_subtype=(account_subtype) - validator = EnumAttributeValidator.new('String', ["checking", "savings"]) - unless validator.valid?(account_subtype) - fail ArgumentError, "invalid value for \"account_subtype\", must be one of #{validator.allowable_values}." - end - @account_subtype = account_subtype - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_number == o.account_number && - routing_number == o.routing_number && - account_name == o.account_name && - account_subtype == o.account_subtype - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_number, routing_number, account_name, account_subtype].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deposit_switch_target_user.rb b/lib/plaid/models/deposit_switch_target_user.rb deleted file mode 100644 index d623f15f4..000000000 --- a/lib/plaid/models/deposit_switch_target_user.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The deposit switch target user - class DepositSwitchTargetUser - # The given name (first name) of the user. - attr_accessor :given_name - - # The family name (last name) of the user. - attr_accessor :family_name - - # The phone number of the user. The endpoint can accept a variety of phone number formats, including E.164. - attr_accessor :phone - - # The email address of the user. - attr_accessor :email - - attr_accessor :address - - # The taxpayer ID of the user, generally their SSN, EIN, or TIN. - attr_accessor :tax_payer_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'given_name', - :'family_name' => :'family_name', - :'phone' => :'phone', - :'email' => :'email', - :'address' => :'address', - :'tax_payer_id' => :'tax_payer_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String', - :'phone' => :'String', - :'email' => :'String', - :'address' => :'DepositSwitchAddressData', - :'tax_payer_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DepositSwitchTargetUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DepositSwitchTargetUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'tax_payer_id') - self.tax_payer_id = attributes[:'tax_payer_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @given_name.nil? - invalid_properties.push('invalid value for "given_name", given_name cannot be nil.') - end - - if @family_name.nil? - invalid_properties.push('invalid value for "family_name", family_name cannot be nil.') - end - - if @phone.nil? - invalid_properties.push('invalid value for "phone", phone cannot be nil.') - end - - if @email.nil? - invalid_properties.push('invalid value for "email", email cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @given_name.nil? - return false if @family_name.nil? - return false if @phone.nil? - return false if @email.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name && - phone == o.phone && - email == o.email && - address == o.address && - tax_payer_id == o.tax_payer_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name, phone, email, address, tax_payer_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deposit_switch_token_create_request.rb b/lib/plaid/models/deposit_switch_token_create_request.rb deleted file mode 100644 index 8bddfb88c..000000000 --- a/lib/plaid/models/deposit_switch_token_create_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # DepositSwitchTokenCreateRequest defines the request schema for `/deposit_switch/token/create` - class DepositSwitchTokenCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the deposit switch - attr_accessor :deposit_switch_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'deposit_switch_id' => :'deposit_switch_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'deposit_switch_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DepositSwitchTokenCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DepositSwitchTokenCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'deposit_switch_id') - self.deposit_switch_id = attributes[:'deposit_switch_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @deposit_switch_id.nil? - invalid_properties.push('invalid value for "deposit_switch_id", deposit_switch_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @deposit_switch_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - deposit_switch_id == o.deposit_switch_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, deposit_switch_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/deposit_switch_token_create_response.rb b/lib/plaid/models/deposit_switch_token_create_response.rb deleted file mode 100644 index 6141b117c..000000000 --- a/lib/plaid/models/deposit_switch_token_create_response.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # DepositSwitchTokenCreateResponse defines the response schema for `/deposit_switch/token/create` - class DepositSwitchTokenCreateResponse - # Deposit switch token, used to initialize Link for the Deposit Switch product - attr_accessor :deposit_switch_token - - # Expiration time of the token, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format - attr_accessor :deposit_switch_token_expiration_time - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deposit_switch_token' => :'deposit_switch_token', - :'deposit_switch_token_expiration_time' => :'deposit_switch_token_expiration_time', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deposit_switch_token' => :'String', - :'deposit_switch_token_expiration_time' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DepositSwitchTokenCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DepositSwitchTokenCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deposit_switch_token') - self.deposit_switch_token = attributes[:'deposit_switch_token'] - end - - if attributes.key?(:'deposit_switch_token_expiration_time') - self.deposit_switch_token_expiration_time = attributes[:'deposit_switch_token_expiration_time'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @deposit_switch_token.nil? - invalid_properties.push('invalid value for "deposit_switch_token", deposit_switch_token cannot be nil.') - end - - if @deposit_switch_token_expiration_time.nil? - invalid_properties.push('invalid value for "deposit_switch_token_expiration_time", deposit_switch_token_expiration_time cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @deposit_switch_token.nil? - return false if @deposit_switch_token_expiration_time.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deposit_switch_token == o.deposit_switch_token && - deposit_switch_token_expiration_time == o.deposit_switch_token_expiration_time && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deposit_switch_token, deposit_switch_token_expiration_time, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/depository_account_subtype.rb b/lib/plaid/models/depository_account_subtype.rb deleted file mode 100644 index 04b21961f..000000000 --- a/lib/plaid/models/depository_account_subtype.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class DepositoryAccountSubtype - CHECKING = "checking".freeze - SAVINGS = "savings".freeze - HSA = "hsa".freeze - CD = "cd".freeze - MONEY_MARKET = "money market".freeze - PAYPAL = "paypal".freeze - PREPAID = "prepaid".freeze - CASH_MANAGEMENT = "cash management".freeze - EBT = "ebt".freeze - ALL = "all".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/depository_filter.rb b/lib/plaid/models/depository_filter.rb deleted file mode 100644 index 7b361cba3..000000000 --- a/lib/plaid/models/depository_filter.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A filter to apply to `depository`-type accounts - class 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). - attr_accessor :account_subtypes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_subtypes' => :'account_subtypes' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_subtypes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DepositoryFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DepositoryFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_subtypes') - if (value = attributes[:'account_subtypes']).is_a?(Array) - self.account_subtypes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_subtypes.nil? - invalid_properties.push('invalid value for "account_subtypes", account_subtypes cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_subtypes.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_subtypes == o.account_subtypes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_subtypes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/detailed_originator.rb b/lib/plaid/models/detailed_originator.rb deleted file mode 100644 index 1a4f58eca..000000000 --- a/lib/plaid/models/detailed_originator.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Originator and their status. - class DetailedOriginator - # Originator’s client ID. - attr_accessor :client_id - - attr_accessor :transfer_diligence_status - - # The company name of the end customer. - attr_accessor :company_name - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'transfer_diligence_status' => :'transfer_diligence_status', - :'company_name' => :'company_name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'transfer_diligence_status' => :'TransferDiligenceStatus', - :'company_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DetailedOriginator` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DetailedOriginator`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'transfer_diligence_status') - self.transfer_diligence_status = attributes[:'transfer_diligence_status'] - end - - if attributes.key?(:'company_name') - self.company_name = attributes[:'company_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @client_id.nil? - invalid_properties.push('invalid value for "client_id", client_id cannot be nil.') - end - - if @transfer_diligence_status.nil? - invalid_properties.push('invalid value for "transfer_diligence_status", transfer_diligence_status cannot be nil.') - end - - if @company_name.nil? - invalid_properties.push('invalid value for "company_name", company_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @client_id.nil? - return false if @transfer_diligence_status.nil? - return false if @company_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - transfer_diligence_status == o.transfer_diligence_status && - company_name == o.company_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, transfer_diligence_status, company_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/detected_account.rb b/lib/plaid/models/detected_account.rb deleted file mode 100644 index 5ec320e40..000000000 --- a/lib/plaid/models/detected_account.rb +++ /dev/null @@ -1,308 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A possible account detected to be associated with a transaction user. - class DetectedAccount - # The detected account type (depository, credit, loan, investment etc.). - attr_accessor :account_type - - # The detected subtype of the account, based on the transactions to/from the institution. - attr_accessor :account_subtype - - # The number of transactions associated with this detected account type at this financial institution. - attr_accessor :transaction_count - - # The date of the oldest transaction associated with this detected account type at this financial institution. - attr_accessor :oldest_transaction_date - - # The date of the newest transaction associated with this detected account type at this financial institution. - attr_accessor :newest_transaction_date - - # Amount of the most recent transaction associated with this detected account type at this financial institution. - attr_accessor :newest_transaction_amount - - # Sum of outflow amounts associated with this detected account type at this financial institution. - attr_accessor :total_outflows - - # Sum of inflow amounts associated with this detected account type at this financial institution. - attr_accessor :total_inflows - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_type' => :'account_type', - :'account_subtype' => :'account_subtype', - :'transaction_count' => :'transaction_count', - :'oldest_transaction_date' => :'oldest_transaction_date', - :'newest_transaction_date' => :'newest_transaction_date', - :'newest_transaction_amount' => :'newest_transaction_amount', - :'total_outflows' => :'total_outflows', - :'total_inflows' => :'total_inflows' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_type' => :'String', - :'account_subtype' => :'String', - :'transaction_count' => :'Integer', - :'oldest_transaction_date' => :'Date', - :'newest_transaction_date' => :'Date', - :'newest_transaction_amount' => :'Float', - :'total_outflows' => :'Float', - :'total_inflows' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_type', - :'account_subtype', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DetectedAccount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DetectedAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_type') - self.account_type = attributes[:'account_type'] - end - - if attributes.key?(:'account_subtype') - self.account_subtype = attributes[:'account_subtype'] - end - - if attributes.key?(:'transaction_count') - self.transaction_count = attributes[:'transaction_count'] - end - - if attributes.key?(:'oldest_transaction_date') - self.oldest_transaction_date = attributes[:'oldest_transaction_date'] - end - - if attributes.key?(:'newest_transaction_date') - self.newest_transaction_date = attributes[:'newest_transaction_date'] - end - - if attributes.key?(:'newest_transaction_amount') - self.newest_transaction_amount = attributes[:'newest_transaction_amount'] - end - - if attributes.key?(:'total_outflows') - self.total_outflows = attributes[:'total_outflows'] - end - - if attributes.key?(:'total_inflows') - self.total_inflows = attributes[:'total_inflows'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transaction_count.nil? - invalid_properties.push('invalid value for "transaction_count", transaction_count cannot be nil.') - end - - if @total_outflows.nil? - invalid_properties.push('invalid value for "total_outflows", total_outflows cannot be nil.') - end - - if @total_inflows.nil? - invalid_properties.push('invalid value for "total_inflows", total_inflows cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transaction_count.nil? - return false if @total_outflows.nil? - return false if @total_inflows.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_type == o.account_type && - account_subtype == o.account_subtype && - transaction_count == o.transaction_count && - oldest_transaction_date == o.oldest_transaction_date && - newest_transaction_date == o.newest_transaction_date && - newest_transaction_amount == o.newest_transaction_amount && - total_outflows == o.total_outflows && - total_inflows == o.total_inflows - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_type, account_subtype, transaction_count, oldest_transaction_date, newest_transaction_date, newest_transaction_amount, total_outflows, total_inflows].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/distribution_breakdown.rb b/lib/plaid/models/distribution_breakdown.rb deleted file mode 100644 index 74b0458f5..000000000 --- a/lib/plaid/models/distribution_breakdown.rb +++ /dev/null @@ -1,297 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the accounts that the payment was distributed to. - class DistributionBreakdown - # Name of the account for the given distribution. - attr_accessor :account_name - - # The name of the bank that the payment is being deposited to. - attr_accessor :bank_name - - # The amount distributed to this account. - attr_accessor :current_amount - - # The ISO-4217 currency code of the net pay. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # The last 2-4 alphanumeric characters of an account's official account number. - attr_accessor :mask - - # Type of the account that the paystub was sent to (e.g. 'checking'). - attr_accessor :type - - # 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. - attr_accessor :unofficial_currency_code - - attr_accessor :current_pay - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_name' => :'account_name', - :'bank_name' => :'bank_name', - :'current_amount' => :'current_amount', - :'iso_currency_code' => :'iso_currency_code', - :'mask' => :'mask', - :'type' => :'type', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'current_pay' => :'current_pay' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_name' => :'String', - :'bank_name' => :'String', - :'current_amount' => :'Float', - :'iso_currency_code' => :'String', - :'mask' => :'String', - :'type' => :'String', - :'unofficial_currency_code' => :'String', - :'current_pay' => :'Pay' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_name', - :'bank_name', - :'current_amount', - :'iso_currency_code', - :'mask', - :'type', - :'unofficial_currency_code', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DistributionBreakdown` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DistributionBreakdown`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_name') - self.account_name = attributes[:'account_name'] - end - - if attributes.key?(:'bank_name') - self.bank_name = attributes[:'bank_name'] - end - - if attributes.key?(:'current_amount') - self.current_amount = attributes[:'current_amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'mask') - self.mask = attributes[:'mask'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'current_pay') - self.current_pay = attributes[:'current_pay'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_name == o.account_name && - bank_name == o.bank_name && - current_amount == o.current_amount && - iso_currency_code == o.iso_currency_code && - mask == o.mask && - type == o.type && - unofficial_currency_code == o.unofficial_currency_code && - current_pay == o.current_pay - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_name, bank_name, current_amount, iso_currency_code, mask, type, unofficial_currency_code, current_pay].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/doc_type.rb b/lib/plaid/models/doc_type.rb deleted file mode 100644 index 7022d2dc5..000000000 --- a/lib/plaid/models/doc_type.rb +++ /dev/null @@ -1,49 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class DocType - UNKNOWN = "UNKNOWN".freeze - DOCUMENT_TYPE_PAYSTUB = "DOCUMENT_TYPE_PAYSTUB".freeze - DOCUMENT_TYPE_BANK_STATEMENT = "DOCUMENT_TYPE_BANK_STATEMENT".freeze - DOCUMENT_TYPE_US_TAX_W2 = "DOCUMENT_TYPE_US_TAX_W2".freeze - DOCUMENT_TYPE_US_MILITARY_ERAS = "DOCUMENT_TYPE_US_MILITARY_ERAS".freeze - DOCUMENT_TYPE_US_MILITARY_LES = "DOCUMENT_TYPE_US_MILITARY_LES".freeze - DOCUMENT_TYPE_US_MILITARY_CLES = "DOCUMENT_TYPE_US_MILITARY_CLES".freeze - DOCUMENT_TYPE_GIG = "DOCUMENT_TYPE_GIG".freeze - DOCUMENT_TYPE_NONE = "DOCUMENT_TYPE_NONE".freeze - DOCUMENT_TYPE_US_TAX_1099_MISC = "DOCUMENT_TYPE_US_TAX_1099_MISC".freeze - DOCUMENT_TYPE_US_TAX_1099_K = "DOCUMENT_TYPE_US_TAX_1099_K".freeze - DOCUMENT_TYPE_PLAID_GENERATED_PAYSTUB_PDF = "DOCUMENT_TYPE_PLAID_GENERATED_PAYSTUB_PDF".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/document_analysis.rb b/lib/plaid/models/document_analysis.rb deleted file mode 100644 index 090d07cae..000000000 --- a/lib/plaid/models/document_analysis.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class DocumentAnalysis - attr_accessor :authenticity - - attr_accessor :image_quality - - attr_accessor :extracted_data - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'authenticity' => :'authenticity', - :'image_quality' => :'image_quality', - :'extracted_data' => :'extracted_data' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'authenticity' => :'DocumentAuthenticityMatchCode', - :'image_quality' => :'ImageQuality', - :'extracted_data' => :'PhysicalDocumentExtractedDataAnalysis' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'extracted_data' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DocumentAnalysis` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DocumentAnalysis`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'authenticity') - self.authenticity = attributes[:'authenticity'] - end - - if attributes.key?(:'image_quality') - self.image_quality = attributes[:'image_quality'] - end - - if attributes.key?(:'extracted_data') - self.extracted_data = attributes[:'extracted_data'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @authenticity.nil? - invalid_properties.push('invalid value for "authenticity", authenticity cannot be nil.') - end - - if @image_quality.nil? - invalid_properties.push('invalid value for "image_quality", image_quality cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @authenticity.nil? - return false if @image_quality.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - authenticity == o.authenticity && - image_quality == o.image_quality && - extracted_data == o.extracted_data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [authenticity, image_quality, extracted_data].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/document_authenticity_match_code.rb b/lib/plaid/models/document_authenticity_match_code.rb deleted file mode 100644 index d48924ef5..000000000 --- a/lib/plaid/models/document_authenticity_match_code.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class DocumentAuthenticityMatchCode - MATCH = "match".freeze - PARTIAL_MATCH = "partial_match".freeze - NO_MATCH = "no_match".freeze - NO_DATA = "no_data".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/document_date_of_birth_match_code.rb b/lib/plaid/models/document_date_of_birth_match_code.rb deleted file mode 100644 index 93c2c3af9..000000000 --- a/lib/plaid/models/document_date_of_birth_match_code.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class DocumentDateOfBirthMatchCode - MATCH = "match".freeze - PARTIAL_MATCH = "partial_match".freeze - NO_MATCH = "no_match".freeze - NO_DATA = "no_data".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/document_metadata.rb b/lib/plaid/models/document_metadata.rb deleted file mode 100644 index 37cf2d426..000000000 --- a/lib/plaid/models/document_metadata.rb +++ /dev/null @@ -1,273 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing metadata from the end user's uploaded document. - class DocumentMetadata - # The name of the document. - attr_accessor :name - - # 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. - attr_accessor :status - - # An identifier of the document that is also present in the paystub response. - attr_accessor :doc_id - - attr_accessor :doc_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'status' => :'status', - :'doc_id' => :'doc_id', - :'doc_type' => :'doc_type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'status' => :'String', - :'doc_id' => :'String', - :'doc_type' => :'DocType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'status', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DocumentMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DocumentMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'doc_id') - self.doc_id = attributes[:'doc_id'] - end - - if attributes.key?(:'doc_type') - self.doc_type = attributes[:'doc_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - status == o.status && - doc_id == o.doc_id && - doc_type == o.doc_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, status, doc_id, doc_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/document_name_match_code.rb b/lib/plaid/models/document_name_match_code.rb deleted file mode 100644 index 3c54069d9..000000000 --- a/lib/plaid/models/document_name_match_code.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class DocumentNameMatchCode - MATCH = "match".freeze - PARTIAL_MATCH = "partial_match".freeze - NO_MATCH = "no_match".freeze - NO_DATA = "no_data".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/document_risk_signal.rb b/lib/plaid/models/document_risk_signal.rb deleted file mode 100644 index afeecd323..000000000 --- a/lib/plaid/models/document_risk_signal.rb +++ /dev/null @@ -1,298 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Details about a certain reason as to why a document could potentially be fraudulent. - class DocumentRiskSignal - # The result from the risk signal check. - attr_accessor :type - - # The field which the risk signal was computed for - attr_accessor :field - - # A flag used to quickly identify if the signal indicates that this field is authentic or fraudulent - attr_accessor :has_fraud_risk - - attr_accessor :institution_metadata - - # The expected value of the field, as seen on the document - attr_accessor :expected_value - - # The derived value obtained in the risk signal calculation process for this field - attr_accessor :actual_value - - # A human-readable explanation providing more detail into the particular risk signal - attr_accessor :signal_description - - # The relevant page associated with the risk signal - attr_accessor :page_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'field' => :'field', - :'has_fraud_risk' => :'has_fraud_risk', - :'institution_metadata' => :'institution_metadata', - :'expected_value' => :'expected_value', - :'actual_value' => :'actual_value', - :'signal_description' => :'signal_description', - :'page_number' => :'page_number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'field' => :'String', - :'has_fraud_risk' => :'Boolean', - :'institution_metadata' => :'DocumentRiskSignalInstitutionMetadata', - :'expected_value' => :'String', - :'actual_value' => :'String', - :'signal_description' => :'String', - :'page_number' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'type', - :'field', - :'has_fraud_risk', - :'institution_metadata', - :'expected_value', - :'actual_value', - :'signal_description', - :'page_number' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DocumentRiskSignal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DocumentRiskSignal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'field') - self.field = attributes[:'field'] - end - - if attributes.key?(:'has_fraud_risk') - self.has_fraud_risk = attributes[:'has_fraud_risk'] - end - - if attributes.key?(:'institution_metadata') - self.institution_metadata = attributes[:'institution_metadata'] - end - - if attributes.key?(:'expected_value') - self.expected_value = attributes[:'expected_value'] - end - - if attributes.key?(:'actual_value') - self.actual_value = attributes[:'actual_value'] - end - - if attributes.key?(:'signal_description') - self.signal_description = attributes[:'signal_description'] - end - - if attributes.key?(:'page_number') - self.page_number = attributes[:'page_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - field == o.field && - has_fraud_risk == o.has_fraud_risk && - institution_metadata == o.institution_metadata && - expected_value == o.expected_value && - actual_value == o.actual_value && - signal_description == o.signal_description && - page_number == o.page_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, field, has_fraud_risk, institution_metadata, expected_value, actual_value, signal_description, page_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/document_risk_signal_institution_metadata.rb b/lib/plaid/models/document_risk_signal_institution_metadata.rb deleted file mode 100644 index 4b86be0ef..000000000 --- a/lib/plaid/models/document_risk_signal_institution_metadata.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object which contains additional metadata about the institution used to compute the verification attribute - class DocumentRiskSignalInstitutionMetadata - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_id' => :'item_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DocumentRiskSignalInstitutionMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DocumentRiskSignalInstitutionMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_id == o.item_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/document_risk_signals_object.rb b/lib/plaid/models/document_risk_signals_object.rb deleted file mode 100644 index f8aba97ae..000000000 --- a/lib/plaid/models/document_risk_signals_object.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Object containing fraud risk data for a set of income documents. - class DocumentRiskSignalsObject - # ID of the payroll provider account. - attr_accessor :account_id - - # Array of document metadata and associated risk signals per document - attr_accessor :single_document_risk_signals - - # Array of risk signals computed from a set of uploaded documents and the associated documents' metadata - attr_accessor :multi_document_risk_signals - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'single_document_risk_signals' => :'single_document_risk_signals', - :'multi_document_risk_signals' => :'multi_document_risk_signals' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'single_document_risk_signals' => :'Array', - :'multi_document_risk_signals' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DocumentRiskSignalsObject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DocumentRiskSignalsObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'single_document_risk_signals') - if (value = attributes[:'single_document_risk_signals']).is_a?(Array) - self.single_document_risk_signals = value - end - end - - if attributes.key?(:'multi_document_risk_signals') - if (value = attributes[:'multi_document_risk_signals']).is_a?(Array) - self.multi_document_risk_signals = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @single_document_risk_signals.nil? - invalid_properties.push('invalid value for "single_document_risk_signals", single_document_risk_signals cannot be nil.') - end - - if @multi_document_risk_signals.nil? - invalid_properties.push('invalid value for "multi_document_risk_signals", multi_document_risk_signals cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @single_document_risk_signals.nil? - return false if @multi_document_risk_signals.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - single_document_risk_signals == o.single_document_risk_signals && - multi_document_risk_signals == o.multi_document_risk_signals - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, single_document_risk_signals, multi_document_risk_signals].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/document_risk_summary.rb b/lib/plaid/models/document_risk_summary.rb deleted file mode 100644 index d7490af58..000000000 --- a/lib/plaid/models/document_risk_summary.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A summary across all risk signals associated with a document - class 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 - attr_accessor :risk_score - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'risk_score' => :'risk_score' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'risk_score' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'risk_score' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DocumentRiskSummary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DocumentRiskSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'risk_score') - self.risk_score = attributes[:'risk_score'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - risk_score == o.risk_score - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [risk_score].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/document_status.rb b/lib/plaid/models/document_status.rb deleted file mode 100644 index 7cb014fe7..000000000 --- a/lib/plaid/models/document_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class DocumentStatus - SUCCESS = "success".freeze - FAILED = "failed".freeze - MANUALLY_APPROVED = "manually_approved".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/documentary_verification.rb b/lib/plaid/models/documentary_verification.rb deleted file mode 100644 index 39d1cf26d..000000000 --- a/lib/plaid/models/documentary_verification.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data, images, analysis, and results from the `documentary_verification` step. This field will be `null` unless `steps.documentary_verification` has reached a terminal state of either `success` or `failed`. - class DocumentaryVerification - # The outcome status for the associated Identity Verification attempt's `documentary_verification` step. This field will always have the same value as `steps.documentary_verification`. - attr_accessor :status - - # An array of documents submitted to the `documentary_verification` step. Each entry represents one user submission, where each submission will contain both a front and back image, or just a front image, depending on the document type. Note: Plaid will automatically let a user submit a new set of document images up to three times if we detect that a previous attempt might have failed due to user error. For example, if the first set of document images are blurry or obscured by glare, the user will be asked to capture their documents again, resulting in at least two separate entries within `documents`. If the overall `documentary_verification` is `failed`, the user has exhausted their retry attempts. - attr_accessor :documents - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'documents' => :'documents' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'String', - :'documents' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DocumentaryVerification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DocumentaryVerification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'documents') - if (value = attributes[:'documents']).is_a?(Array) - self.documents = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @documents.nil? - invalid_properties.push('invalid value for "documents", documents cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @status.nil? - return false if @documents.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - documents == o.documents - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, documents].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/documentary_verification_document.rb b/lib/plaid/models/documentary_verification_document.rb deleted file mode 100644 index 3facab62f..000000000 --- a/lib/plaid/models/documentary_verification_document.rb +++ /dev/null @@ -1,311 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Images, extracted data, and analysis from a user's identity document - class DocumentaryVerificationDocument - attr_accessor :status - - # The `attempt` field begins with 1 and increments with each subsequent document upload. - attr_accessor :attempt - - attr_accessor :images - - attr_accessor :extracted_data - - attr_accessor :analysis - - # An ISO8601 formatted timestamp. - attr_accessor :redacted_at - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'attempt' => :'attempt', - :'images' => :'images', - :'extracted_data' => :'extracted_data', - :'analysis' => :'analysis', - :'redacted_at' => :'redacted_at' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'DocumentStatus', - :'attempt' => :'Integer', - :'images' => :'PhysicalDocumentImages', - :'extracted_data' => :'PhysicalDocumentExtractedData', - :'analysis' => :'DocumentAnalysis', - :'redacted_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'extracted_data', - :'redacted_at' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::DocumentaryVerificationDocument` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::DocumentaryVerificationDocument`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'attempt') - self.attempt = attributes[:'attempt'] - end - - if attributes.key?(:'images') - self.images = attributes[:'images'] - end - - if attributes.key?(:'extracted_data') - self.extracted_data = attributes[:'extracted_data'] - end - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - - if attributes.key?(:'redacted_at') - self.redacted_at = attributes[:'redacted_at'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @attempt.nil? - invalid_properties.push('invalid value for "attempt", attempt cannot be nil.') - end - - if @images.nil? - invalid_properties.push('invalid value for "images", images cannot be nil.') - end - - if @analysis.nil? - invalid_properties.push('invalid value for "analysis", analysis cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @status.nil? - return false if @attempt.nil? - return false if @images.nil? - return false if @analysis.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - attempt == o.attempt && - images == o.images && - extracted_data == o.extracted_data && - analysis == o.analysis && - redacted_at == o.redacted_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, attempt, images, extracted_data, analysis, redacted_at].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/earnings.rb b/lib/plaid/models/earnings.rb deleted file mode 100644 index 3f87032d6..000000000 --- a/lib/plaid/models/earnings.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing both a breakdown of earnings on a paystub and the total earnings. - class Earnings - attr_accessor :subtotals - - attr_accessor :totals - - attr_accessor :breakdown - - attr_accessor :total - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'subtotals' => :'subtotals', - :'totals' => :'totals', - :'breakdown' => :'breakdown', - :'total' => :'total' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'subtotals' => :'Array', - :'totals' => :'Array', - :'breakdown' => :'Array', - :'total' => :'EarningsTotal' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Earnings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Earnings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'subtotals') - if (value = attributes[:'subtotals']).is_a?(Array) - self.subtotals = value - end - end - - if attributes.key?(:'totals') - if (value = attributes[:'totals']).is_a?(Array) - self.totals = value - end - end - - if attributes.key?(:'breakdown') - if (value = attributes[:'breakdown']).is_a?(Array) - self.breakdown = value - end - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - subtotals == o.subtotals && - totals == o.totals && - breakdown == o.breakdown && - total == o.total - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [subtotals, totals, breakdown, total].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/earnings_breakdown.rb b/lib/plaid/models/earnings_breakdown.rb deleted file mode 100644 index 2fe01aeae..000000000 --- a/lib/plaid/models/earnings_breakdown.rb +++ /dev/null @@ -1,320 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing the earnings line items for the pay period. - class EarningsBreakdown - attr_accessor :canonical_description - - # Raw amount of the earning line item. - attr_accessor :current_amount - - # Description of the earning line item. - attr_accessor :description - - # Number of hours applicable for this earning. - attr_accessor :hours - - # The ISO-4217 currency code of the line item. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # Hourly rate applicable for this earning. - attr_accessor :rate - - # The unofficial currency code associated with the line item. 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. - attr_accessor :unofficial_currency_code - - # The year-to-date amount of the deduction. - attr_accessor :ytd_amount - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'canonical_description' => :'canonical_description', - :'current_amount' => :'current_amount', - :'description' => :'description', - :'hours' => :'hours', - :'iso_currency_code' => :'iso_currency_code', - :'rate' => :'rate', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'ytd_amount' => :'ytd_amount' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'canonical_description' => :'EarningsBreakdownCanonicalDescription', - :'current_amount' => :'Float', - :'description' => :'String', - :'hours' => :'Float', - :'iso_currency_code' => :'String', - :'rate' => :'Float', - :'unofficial_currency_code' => :'String', - :'ytd_amount' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'canonical_description', - :'current_amount', - :'description', - :'hours', - :'iso_currency_code', - :'rate', - :'unofficial_currency_code', - :'ytd_amount' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EarningsBreakdown` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EarningsBreakdown`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'canonical_description') - self.canonical_description = attributes[:'canonical_description'] - end - - if attributes.key?(:'current_amount') - self.current_amount = attributes[:'current_amount'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'hours') - self.hours = attributes[:'hours'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'rate') - self.rate = attributes[:'rate'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'ytd_amount') - self.ytd_amount = attributes[:'ytd_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - canonical_description == o.canonical_description && - current_amount == o.current_amount && - description == o.description && - hours == o.hours && - iso_currency_code == o.iso_currency_code && - rate == o.rate && - unofficial_currency_code == o.unofficial_currency_code && - ytd_amount == o.ytd_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [canonical_description, current_amount, description, hours, iso_currency_code, rate, unofficial_currency_code, ytd_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/earnings_breakdown_canonical_description.rb b/lib/plaid/models/earnings_breakdown_canonical_description.rb deleted file mode 100644 index 0f48f3653..000000000 --- a/lib/plaid/models/earnings_breakdown_canonical_description.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class EarningsBreakdownCanonicalDescription - BONUS = "BONUS".freeze - COMMISSION = "COMMISSION".freeze - OVERTIME = "OVERTIME".freeze - PAID_TIME_OFF = "PAID TIME OFF".freeze - REGULAR_PAY = "REGULAR PAY".freeze - VACATION = "VACATION".freeze - BASIC_ALLOWANCE_HOUSING = "BASIC ALLOWANCE HOUSING".freeze - BASIC_ALLOWANCE_SUBSISTENCE = "BASIC ALLOWANCE SUBSISTENCE".freeze - OTHER = "OTHER".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/earnings_total.rb b/lib/plaid/models/earnings_total.rb deleted file mode 100644 index 087fa5617..000000000 --- a/lib/plaid/models/earnings_total.rb +++ /dev/null @@ -1,284 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing both the current pay period and year to date amount for an earning category. - class EarningsTotal - # Total amount of the earnings for this pay period - attr_accessor :current_amount - - attr_accessor :current_pay - - attr_accessor :ytd_pay - - # Total number of hours worked for this pay period - attr_accessor :hours - - # The ISO-4217 currency code of the line item. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # The unofficial currency code associated with the security. 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. - attr_accessor :unofficial_currency_code - - # The total year-to-date amount of the earnings - attr_accessor :ytd_amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'current_amount' => :'current_amount', - :'current_pay' => :'current_pay', - :'ytd_pay' => :'ytd_pay', - :'hours' => :'hours', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'ytd_amount' => :'ytd_amount' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'current_amount' => :'Float', - :'current_pay' => :'Pay', - :'ytd_pay' => :'Pay', - :'hours' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'ytd_amount' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'current_amount', - :'hours', - :'iso_currency_code', - :'unofficial_currency_code', - :'ytd_amount' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EarningsTotal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EarningsTotal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'current_amount') - self.current_amount = attributes[:'current_amount'] - end - - if attributes.key?(:'current_pay') - self.current_pay = attributes[:'current_pay'] - end - - if attributes.key?(:'ytd_pay') - self.ytd_pay = attributes[:'ytd_pay'] - end - - if attributes.key?(:'hours') - self.hours = attributes[:'hours'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'ytd_amount') - self.ytd_amount = attributes[:'ytd_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - current_amount == o.current_amount && - current_pay == o.current_pay && - ytd_pay == o.ytd_pay && - hours == o.hours && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - ytd_amount == o.ytd_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [current_amount, current_pay, ytd_pay, hours, iso_currency_code, unofficial_currency_code, ytd_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/email.rb b/lib/plaid/models/email.rb deleted file mode 100644 index aea181674..000000000 --- a/lib/plaid/models/email.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing an email address - class Email - # The email address. - attr_accessor :data - - # When `true`, identifies the email address as the primary email on an account. - attr_accessor :primary - - # The type of email account as described by the financial institution. - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'data' => :'data', - :'primary' => :'primary', - :'type' => :'type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'data' => :'String', - :'primary' => :'Boolean', - :'type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Email` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Email`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - - if attributes.key?(:'primary') - self.primary = attributes[:'primary'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @data.nil? - invalid_properties.push('invalid value for "data", data cannot be nil.') - end - - if @primary.nil? - invalid_properties.push('invalid value for "primary", primary cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @data.nil? - return false if @primary.nil? - return false if @type.nil? - type_validator = EnumAttributeValidator.new('String', ["primary", "secondary", "other"]) - return false unless type_validator.valid?(@type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["primary", "secondary", "other"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - data == o.data && - primary == o.primary && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [data, primary, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/email_address_match_score.rb b/lib/plaid/models/email_address_match_score.rb deleted file mode 100644 index 46493a752..000000000 --- a/lib/plaid/models/email_address_match_score.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Score found by matching email provided by the API with the email on the account at the financial institution. 100 is a perfect match and 0 is a no match. If the account contains multiple owners, the maximum match score is filled. - class EmailAddressMatchScore - # Match score for normalized email. 100 is a perfect match, 99-70 is a partial match (matching the same email with different '+' extensions), anything below 70 is considered a mismatch. Typically, the match threshold should be set to a score of 70 or higher. If the email is missing from either the API or financial institution, this is null. - attr_accessor :score - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'score' => :'score' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'score' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'score' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EmailAddressMatchScore` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EmailAddressMatchScore`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'score') - self.score = attributes[:'score'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - score == o.score - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [score].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/employee.rb b/lib/plaid/models/employee.rb deleted file mode 100644 index 98fb95fd2..000000000 --- a/lib/plaid/models/employee.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data about the employee. - class Employee - attr_accessor :address - - # The name of the employee. - attr_accessor :name - - # Marital status of the employee - either `single` or `married`. - attr_accessor :marital_status - - attr_accessor :taxpayer_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'address' => :'address', - :'name' => :'name', - :'marital_status' => :'marital_status', - :'taxpayer_id' => :'taxpayer_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'address' => :'PaystubAddress', - :'name' => :'String', - :'marital_status' => :'String', - :'taxpayer_id' => :'TaxpayerID' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'marital_status', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Employee` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Employee`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'marital_status') - self.marital_status = attributes[:'marital_status'] - end - - if attributes.key?(:'taxpayer_id') - self.taxpayer_id = attributes[:'taxpayer_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @address.nil? - invalid_properties.push('invalid value for "address", address cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @address.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - address == o.address && - name == o.name && - marital_status == o.marital_status && - taxpayer_id == o.taxpayer_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [address, name, marital_status, taxpayer_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/employee_income_summary_field_string.rb b/lib/plaid/models/employee_income_summary_field_string.rb deleted file mode 100644 index 6c003b66c..000000000 --- a/lib/plaid/models/employee_income_summary_field_string.rb +++ /dev/null @@ -1,269 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The name of the employee, as reported on the paystub. - class EmployeeIncomeSummaryFieldString - # The value of the field. - attr_accessor :value - - attr_accessor :verification_status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'verification_status' => :'verification_status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'String', - :'verification_status' => :'VerificationStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'IncomeSummaryFieldString' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EmployeeIncomeSummaryFieldString` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EmployeeIncomeSummaryFieldString`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @verification_status.nil? - invalid_properties.push('invalid value for "verification_status", verification_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @value.nil? - return false if @verification_status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - verification_status == o.verification_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, verification_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/employer.rb b/lib/plaid/models/employer.rb deleted file mode 100644 index a613d286b..000000000 --- a/lib/plaid/models/employer.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data about the employer. - class Employer - # Plaid's unique identifier for the employer. - attr_accessor :employer_id - - # The name of the employer - attr_accessor :name - - attr_accessor :address - - # A number from 0 to 1 indicating Plaid's level of confidence in the pairing between the employer and the institution (not yet implemented). - attr_accessor :confidence_score - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'employer_id' => :'employer_id', - :'name' => :'name', - :'address' => :'address', - :'confidence_score' => :'confidence_score' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'employer_id' => :'String', - :'name' => :'String', - :'address' => :'AddressDataNullable', - :'confidence_score' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'address', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Employer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Employer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'employer_id') - self.employer_id = attributes[:'employer_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'confidence_score') - self.confidence_score = attributes[:'confidence_score'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @employer_id.nil? - invalid_properties.push('invalid value for "employer_id", employer_id cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @confidence_score.nil? - invalid_properties.push('invalid value for "confidence_score", confidence_score cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @employer_id.nil? - return false if @name.nil? - return false if @confidence_score.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - employer_id == o.employer_id && - name == o.name && - address == o.address && - confidence_score == o.confidence_score - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [employer_id, name, address, confidence_score].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/employer_income_summary_field_string.rb b/lib/plaid/models/employer_income_summary_field_string.rb deleted file mode 100644 index d562ce868..000000000 --- a/lib/plaid/models/employer_income_summary_field_string.rb +++ /dev/null @@ -1,269 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The name of the employer, as reported on the paystub. - class EmployerIncomeSummaryFieldString - # The value of the field. - attr_accessor :value - - attr_accessor :verification_status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'verification_status' => :'verification_status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'String', - :'verification_status' => :'VerificationStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'IncomeSummaryFieldString' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EmployerIncomeSummaryFieldString` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EmployerIncomeSummaryFieldString`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @verification_status.nil? - invalid_properties.push('invalid value for "verification_status", verification_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @value.nil? - return false if @verification_status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - verification_status == o.verification_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, verification_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/employer_verification.rb b/lib/plaid/models/employer_verification.rb deleted file mode 100644 index e6d8745b1..000000000 --- a/lib/plaid/models/employer_verification.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing employer data. - class EmployerVerification - # Name of employer. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EmployerVerification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EmployerVerification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/employers_search_request.rb b/lib/plaid/models/employers_search_request.rb deleted file mode 100644 index 45499b868..000000000 --- a/lib/plaid/models/employers_search_request.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # EmployersSearchRequest defines the request schema for `/employers/search`. - class EmployersSearchRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The employer name to be searched for. - attr_accessor :query - - # The Plaid products the returned employers should support. Currently, this field must be set to `\"deposit_switch\"`. - attr_accessor :products - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'query' => :'query', - :'products' => :'products' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'query' => :'String', - :'products' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EmployersSearchRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EmployersSearchRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'query') - self.query = attributes[:'query'] - end - - if attributes.key?(:'products') - if (value = attributes[:'products']).is_a?(Array) - self.products = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @query.nil? - invalid_properties.push('invalid value for "query", query cannot be nil.') - end - - if @products.nil? - invalid_properties.push('invalid value for "products", products cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @query.nil? - return false if @products.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - query == o.query && - products == o.products - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, query, products].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/employers_search_response.rb b/lib/plaid/models/employers_search_response.rb deleted file mode 100644 index f04db2921..000000000 --- a/lib/plaid/models/employers_search_response.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # EmployersSearchResponse defines the response schema for `/employers/search`. - class EmployersSearchResponse - # A list of employers matching the search criteria. - attr_accessor :employers - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'employers' => :'employers', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'employers' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EmployersSearchResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EmployersSearchResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'employers') - if (value = attributes[:'employers']).is_a?(Array) - self.employers = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @employers.nil? - invalid_properties.push('invalid value for "employers", employers cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @employers.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - employers == o.employers && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [employers, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/employment_details.rb b/lib/plaid/models/employment_details.rb deleted file mode 100644 index 7fba0ff14..000000000 --- a/lib/plaid/models/employment_details.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing employment details found on a paystub. - class EmploymentDetails - attr_accessor :annual_salary - - # Date on which the employee was hired, in the YYYY-MM-DD format. - attr_accessor :hire_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'annual_salary' => :'annual_salary', - :'hire_date' => :'hire_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'annual_salary' => :'Pay', - :'hire_date' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'hire_date' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EmploymentDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EmploymentDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'annual_salary') - self.annual_salary = attributes[:'annual_salary'] - end - - if attributes.key?(:'hire_date') - self.hire_date = attributes[:'hire_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - annual_salary == o.annual_salary && - hire_date == o.hire_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [annual_salary, hire_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/employment_source_type.rb b/lib/plaid/models/employment_source_type.rb deleted file mode 100644 index 5397948ba..000000000 --- a/lib/plaid/models/employment_source_type.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class EmploymentSourceType - BANK = "bank".freeze - PAYROLL = "payroll".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/employment_verification.rb b/lib/plaid/models/employment_verification.rb deleted file mode 100644 index 19d832c38..000000000 --- a/lib/plaid/models/employment_verification.rb +++ /dev/null @@ -1,294 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing proof of employment data for an individual - class EmploymentVerification - attr_accessor :status - - # Start of employment in ISO 8601 format (YYYY-MM-DD). - attr_accessor :start_date - - # End of employment, if applicable. Provided in ISO 8601 format (YYY-MM-DD). - attr_accessor :end_date - - attr_accessor :employer - - # Current title of employee. - attr_accessor :title - - attr_accessor :platform_ids - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'employer' => :'employer', - :'title' => :'title', - :'platform_ids' => :'platform_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'EmploymentVerificationStatus', - :'start_date' => :'Date', - :'end_date' => :'Date', - :'employer' => :'EmployerVerification', - :'title' => :'String', - :'platform_ids' => :'PlatformIds' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'status', - :'start_date', - :'end_date', - :'title', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EmploymentVerification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EmploymentVerification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'employer') - self.employer = attributes[:'employer'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'platform_ids') - self.platform_ids = attributes[:'platform_ids'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - start_date == o.start_date && - end_date == o.end_date && - employer == o.employer && - title == o.title && - platform_ids == o.platform_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, start_date, end_date, employer, title, platform_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/employment_verification_get_request.rb b/lib/plaid/models/employment_verification_get_request.rb deleted file mode 100644 index 259d2c691..000000000 --- a/lib/plaid/models/employment_verification_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # EmploymentVerificationGetRequest defines the request schema for `/employment/verification/get`. - class EmploymentVerificationGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EmploymentVerificationGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EmploymentVerificationGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/employment_verification_get_response.rb b/lib/plaid/models/employment_verification_get_response.rb deleted file mode 100644 index 44bfe4e18..000000000 --- a/lib/plaid/models/employment_verification_get_response.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # EmploymentVerificationGetResponse defines the response schema for `/employment/verification/get`. - class EmploymentVerificationGetResponse - # A list of employment verification summaries. - attr_accessor :employments - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'employments' => :'employments', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'employments' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EmploymentVerificationGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EmploymentVerificationGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'employments') - if (value = attributes[:'employments']).is_a?(Array) - self.employments = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @employments.nil? - invalid_properties.push('invalid value for "employments", employments cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @employments.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - employments == o.employments && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [employments, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/employment_verification_status.rb b/lib/plaid/models/employment_verification_status.rb deleted file mode 100644 index 113148639..000000000 --- a/lib/plaid/models/employment_verification_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class EmploymentVerificationStatus - EMPLOYMENT_STATUS_ACTIVE = "EMPLOYMENT_STATUS_ACTIVE".freeze - EMPLOYMENT_STATUS_INACTIVE = "EMPLOYMENT_STATUS_INACTIVE".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/enhancements.rb b/lib/plaid/models/enhancements.rb deleted file mode 100644 index f130a68a5..000000000 --- a/lib/plaid/models/enhancements.rb +++ /dev/null @@ -1,365 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A grouping of the Plaid produced transaction enhancement fields. - class Enhancements - # The name of the primary counterparty, such as the merchant or the financial institution, as extracted by Plaid from the raw description. - attr_accessor :merchant_name - - # The website associated with this transaction, if available. - attr_accessor :website - - # The URL of a logo associated with this transaction, if available. The logo will always be 100×100 pixel PNG file. - attr_accessor :logo_url - - # The check number of the transaction. This field is only populated for check transactions. - attr_accessor :check_number - - attr_accessor :payment_channel - - # 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). - attr_accessor :category_id - - # 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). - attr_accessor :category - - attr_accessor :location - - attr_accessor :personal_finance_category - - # The URL of an icon associated with the primary personal finance category. The icon will always be 100×100 pixel PNG file. - attr_accessor :personal_finance_category_icon_url - - # The counterparties present in the transaction. Counterparties, such as the merchant or the financial institution, are extracted by Plaid from the raw description. - attr_accessor :counterparties - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'merchant_name' => :'merchant_name', - :'website' => :'website', - :'logo_url' => :'logo_url', - :'check_number' => :'check_number', - :'payment_channel' => :'payment_channel', - :'category_id' => :'category_id', - :'category' => :'category', - :'location' => :'location', - :'personal_finance_category' => :'personal_finance_category', - :'personal_finance_category_icon_url' => :'personal_finance_category_icon_url', - :'counterparties' => :'counterparties' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'merchant_name' => :'String', - :'website' => :'String', - :'logo_url' => :'String', - :'check_number' => :'String', - :'payment_channel' => :'PaymentChannel', - :'category_id' => :'String', - :'category' => :'Array', - :'location' => :'Location', - :'personal_finance_category' => :'PersonalFinanceCategory', - :'personal_finance_category_icon_url' => :'String', - :'counterparties' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'merchant_name', - :'website', - :'logo_url', - :'check_number', - :'category_id', - :'personal_finance_category', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Enhancements` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Enhancements`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'merchant_name') - self.merchant_name = attributes[:'merchant_name'] - end - - if attributes.key?(:'website') - self.website = attributes[:'website'] - end - - if attributes.key?(:'logo_url') - self.logo_url = attributes[:'logo_url'] - end - - if attributes.key?(:'check_number') - self.check_number = attributes[:'check_number'] - end - - if attributes.key?(:'payment_channel') - self.payment_channel = attributes[:'payment_channel'] - end - - if attributes.key?(:'category_id') - self.category_id = attributes[:'category_id'] - end - - if attributes.key?(:'category') - if (value = attributes[:'category']).is_a?(Array) - self.category = value - end - end - - if attributes.key?(:'location') - self.location = attributes[:'location'] - end - - if attributes.key?(:'personal_finance_category') - self.personal_finance_category = attributes[:'personal_finance_category'] - end - - if attributes.key?(:'personal_finance_category_icon_url') - self.personal_finance_category_icon_url = attributes[:'personal_finance_category_icon_url'] - end - - if attributes.key?(:'counterparties') - if (value = attributes[:'counterparties']).is_a?(Array) - self.counterparties = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment_channel.nil? - invalid_properties.push('invalid value for "payment_channel", payment_channel cannot be nil.') - end - - if @category.nil? - invalid_properties.push('invalid value for "category", category cannot be nil.') - end - - if @location.nil? - invalid_properties.push('invalid value for "location", location cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment_channel.nil? - return false if @category.nil? - return false if @location.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - merchant_name == o.merchant_name && - website == o.website && - logo_url == o.logo_url && - check_number == o.check_number && - payment_channel == o.payment_channel && - category_id == o.category_id && - category == o.category && - location == o.location && - personal_finance_category == o.personal_finance_category && - personal_finance_category_icon_url == o.personal_finance_category_icon_url && - counterparties == o.counterparties - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [merchant_name, website, logo_url, check_number, payment_channel, category_id, category, location, personal_finance_category, personal_finance_category_icon_url, counterparties].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/enrich_transaction_direction.rb b/lib/plaid/models/enrich_transaction_direction.rb deleted file mode 100644 index 392c545d5..000000000 --- a/lib/plaid/models/enrich_transaction_direction.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class EnrichTransactionDirection - INFLOW = "INFLOW".freeze - OUTFLOW = "OUTFLOW".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/enrichments.rb b/lib/plaid/models/enrichments.rb deleted file mode 100644 index e79a46769..000000000 --- a/lib/plaid/models/enrichments.rb +++ /dev/null @@ -1,402 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A grouping of the Plaid produced transaction enrichment fields. - class Enrichments - # The check number of the transaction. This field is only populated for check transactions. - attr_accessor :check_number - - # The counterparties present in the transaction. Counterparties, such as the merchant or the financial institution, are extracted by Plaid from the raw description. - attr_accessor :counterparties - - # A unique, stable, Plaid-generated ID that maps to the primary counterparty. - attr_accessor :entity_id - - # The ID of the legacy category to which this transaction belongs. For a full list of legacy categories, see [`/categories/get`](https://plaid.com/docs/api/products/transactions/#categoriesget). We recommend using the `personal_finance_category` for transaction categorization to obtain the best results. - attr_accessor :legacy_category_id - - # A hierarchical array of the legacy categories to which this transaction belongs. For a full list of legacy categories, see [`/categories/get`](https://plaid.com/docs/api/products/transactions/#categoriesget). We recommend using the `personal_finance_category` for transaction categorization to obtain the best results. - attr_accessor :legacy_category - - attr_accessor :location - - # The URL of a logo associated with this transaction, if available. The logo will always be 100×100 pixel PNG file. - attr_accessor :logo_url - - # The name of the primary counterparty, such as the merchant or the financial institution, as extracted by Plaid from the raw description. - attr_accessor :merchant_name - - attr_accessor :payment_channel - - # 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. - attr_accessor :phone_number - - attr_accessor :personal_finance_category - - # The URL of an icon associated with the primary personal finance category. The icon will always be 100×100 pixel PNG file. - attr_accessor :personal_finance_category_icon_url - - attr_accessor :recurrence - - # The website associated with this transaction. - attr_accessor :website - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'check_number' => :'check_number', - :'counterparties' => :'counterparties', - :'entity_id' => :'entity_id', - :'legacy_category_id' => :'legacy_category_id', - :'legacy_category' => :'legacy_category', - :'location' => :'location', - :'logo_url' => :'logo_url', - :'merchant_name' => :'merchant_name', - :'payment_channel' => :'payment_channel', - :'phone_number' => :'phone_number', - :'personal_finance_category' => :'personal_finance_category', - :'personal_finance_category_icon_url' => :'personal_finance_category_icon_url', - :'recurrence' => :'recurrence', - :'website' => :'website' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'check_number' => :'String', - :'counterparties' => :'Array', - :'entity_id' => :'String', - :'legacy_category_id' => :'String', - :'legacy_category' => :'Array', - :'location' => :'Location', - :'logo_url' => :'String', - :'merchant_name' => :'String', - :'payment_channel' => :'PaymentChannel', - :'phone_number' => :'String', - :'personal_finance_category' => :'PersonalFinanceCategory', - :'personal_finance_category_icon_url' => :'String', - :'recurrence' => :'Recurrence', - :'website' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'check_number', - :'entity_id', - :'legacy_category_id', - :'logo_url', - :'merchant_name', - :'phone_number', - :'personal_finance_category', - :'recurrence', - :'website' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Enrichments` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Enrichments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'check_number') - self.check_number = attributes[:'check_number'] - end - - if attributes.key?(:'counterparties') - if (value = attributes[:'counterparties']).is_a?(Array) - self.counterparties = value - end - end - - if attributes.key?(:'entity_id') - self.entity_id = attributes[:'entity_id'] - end - - if attributes.key?(:'legacy_category_id') - self.legacy_category_id = attributes[:'legacy_category_id'] - end - - if attributes.key?(:'legacy_category') - if (value = attributes[:'legacy_category']).is_a?(Array) - self.legacy_category = value - end - end - - if attributes.key?(:'location') - self.location = attributes[:'location'] - end - - if attributes.key?(:'logo_url') - self.logo_url = attributes[:'logo_url'] - end - - if attributes.key?(:'merchant_name') - self.merchant_name = attributes[:'merchant_name'] - end - - if attributes.key?(:'payment_channel') - self.payment_channel = attributes[:'payment_channel'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'personal_finance_category') - self.personal_finance_category = attributes[:'personal_finance_category'] - end - - if attributes.key?(:'personal_finance_category_icon_url') - self.personal_finance_category_icon_url = attributes[:'personal_finance_category_icon_url'] - end - - if attributes.key?(:'recurrence') - self.recurrence = attributes[:'recurrence'] - end - - if attributes.key?(:'website') - self.website = attributes[:'website'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @counterparties.nil? - invalid_properties.push('invalid value for "counterparties", counterparties cannot be nil.') - end - - if @location.nil? - invalid_properties.push('invalid value for "location", location cannot be nil.') - end - - if @payment_channel.nil? - invalid_properties.push('invalid value for "payment_channel", payment_channel cannot be nil.') - end - - if @personal_finance_category_icon_url.nil? - invalid_properties.push('invalid value for "personal_finance_category_icon_url", personal_finance_category_icon_url cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @counterparties.nil? - return false if @location.nil? - return false if @payment_channel.nil? - return false if @personal_finance_category_icon_url.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - check_number == o.check_number && - counterparties == o.counterparties && - entity_id == o.entity_id && - legacy_category_id == o.legacy_category_id && - legacy_category == o.legacy_category && - location == o.location && - logo_url == o.logo_url && - merchant_name == o.merchant_name && - payment_channel == o.payment_channel && - phone_number == o.phone_number && - personal_finance_category == o.personal_finance_category && - personal_finance_category_icon_url == o.personal_finance_category_icon_url && - recurrence == o.recurrence && - website == o.website - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [check_number, counterparties, entity_id, legacy_category_id, legacy_category, location, logo_url, merchant_name, payment_channel, phone_number, personal_finance_category, personal_finance_category_icon_url, recurrence, website].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_document.rb b/lib/plaid/models/entity_document.rb deleted file mode 100644 index a35ac0df9..000000000 --- a/lib/plaid/models/entity_document.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An official document, usually issued by a governing body or institution, with an associated identifier. - class EntityDocument - attr_accessor :type - - # The numeric or alphanumeric identifier associated with this document. - attr_accessor :number - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'number' => :'number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'EntityDocumentType', - :'number' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityDocument` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityDocument`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'number') - self.number = attributes[:'number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @number.nil? - invalid_properties.push('invalid value for "number", number cannot be nil.') - end - - if @number.to_s.length < 4 - invalid_properties.push('invalid value for "number", the character length must be great than or equal to 4.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - return false if @number.nil? - return false if @number.to_s.length < 4 - true - end - - # Custom attribute writer method with validation - # @param [Object] number Value to be assigned - def number=(number) - if number.nil? - fail ArgumentError, 'number cannot be nil' - end - - if number.to_s.length < 4 - fail ArgumentError, 'invalid value for "number", the character length must be great than or equal to 4.' - end - - - @number = number - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - number == o.number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_document_type.rb b/lib/plaid/models/entity_document_type.rb deleted file mode 100644 index b10facc14..000000000 --- a/lib/plaid/models/entity_document_type.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class EntityDocumentType - BIK = "bik".freeze - BUSINESS_NUMBER = "business_number".freeze - IMO = "imo".freeze - OTHER = "other".freeze - SWIFT = "swift".freeze - TAX_ID = "tax_id".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/entity_screening_hit_analysis.rb b/lib/plaid/models/entity_screening_hit_analysis.rb deleted file mode 100644 index 03a078b07..000000000 --- a/lib/plaid/models/entity_screening_hit_analysis.rb +++ /dev/null @@ -1,302 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Analysis information describing why a screening hit matched the provided entity information - class EntityScreeningHitAnalysis - attr_accessor :documents - - attr_accessor :email_addresses - - attr_accessor :locations - - attr_accessor :names - - attr_accessor :phone_numbers - - attr_accessor :urls - - # 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. - attr_accessor :search_terms_version - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'documents' => :'documents', - :'email_addresses' => :'email_addresses', - :'locations' => :'locations', - :'names' => :'names', - :'phone_numbers' => :'phone_numbers', - :'urls' => :'urls', - :'search_terms_version' => :'search_terms_version' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'documents' => :'MatchSummaryCode', - :'email_addresses' => :'MatchSummaryCode', - :'locations' => :'MatchSummaryCode', - :'names' => :'MatchSummaryCode', - :'phone_numbers' => :'MatchSummaryCode', - :'urls' => :'MatchSummaryCode', - :'search_terms_version' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityScreeningHitAnalysis` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityScreeningHitAnalysis`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'documents') - self.documents = attributes[:'documents'] - end - - if attributes.key?(:'email_addresses') - self.email_addresses = attributes[:'email_addresses'] - end - - if attributes.key?(:'locations') - self.locations = attributes[:'locations'] - end - - if attributes.key?(:'names') - self.names = attributes[:'names'] - end - - if attributes.key?(:'phone_numbers') - self.phone_numbers = attributes[:'phone_numbers'] - end - - if attributes.key?(:'urls') - self.urls = attributes[:'urls'] - end - - if attributes.key?(:'search_terms_version') - self.search_terms_version = attributes[:'search_terms_version'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @search_terms_version.nil? - invalid_properties.push('invalid value for "search_terms_version", search_terms_version cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @search_terms_version.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - documents == o.documents && - email_addresses == o.email_addresses && - locations == o.locations && - names == o.names && - phone_numbers == o.phone_numbers && - urls == o.urls && - search_terms_version == o.search_terms_version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [documents, email_addresses, locations, names, phone_numbers, urls, search_terms_version].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_screening_hit_data.rb b/lib/plaid/models/entity_screening_hit_data.rb deleted file mode 100644 index 00038e77a..000000000 --- a/lib/plaid/models/entity_screening_hit_data.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information associated with the entity watchlist hit - class EntityScreeningHitData - # Documents associated with the watchlist hit - attr_accessor :documents - - # Email addresses associated with the watchlist hit - attr_accessor :email_addresses - - # Locations associated with the watchlist hit - attr_accessor :locations - - # Names associated with the watchlist hit - attr_accessor :names - - # Phone numbers associated with the watchlist hit - attr_accessor :phone_numbers - - # URLs associated with the watchlist hit - attr_accessor :urls - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'documents' => :'documents', - :'email_addresses' => :'email_addresses', - :'locations' => :'locations', - :'names' => :'names', - :'phone_numbers' => :'phone_numbers', - :'urls' => :'urls' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'documents' => :'Array', - :'email_addresses' => :'Array', - :'locations' => :'Array', - :'names' => :'Array', - :'phone_numbers' => :'Array', - :'urls' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityScreeningHitData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityScreeningHitData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'documents') - if (value = attributes[:'documents']).is_a?(Array) - self.documents = value - end - end - - if attributes.key?(:'email_addresses') - if (value = attributes[:'email_addresses']).is_a?(Array) - self.email_addresses = value - end - end - - if attributes.key?(:'locations') - if (value = attributes[:'locations']).is_a?(Array) - self.locations = value - end - end - - if attributes.key?(:'names') - if (value = attributes[:'names']).is_a?(Array) - self.names = value - end - end - - if attributes.key?(:'phone_numbers') - if (value = attributes[:'phone_numbers']).is_a?(Array) - self.phone_numbers = value - end - end - - if attributes.key?(:'urls') - if (value = attributes[:'urls']).is_a?(Array) - self.urls = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - documents == o.documents && - email_addresses == o.email_addresses && - locations == o.locations && - names == o.names && - phone_numbers == o.phone_numbers && - urls == o.urls - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [documents, email_addresses, locations, names, phone_numbers, urls].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_screening_hit_documents_items.rb b/lib/plaid/models/entity_screening_hit_documents_items.rb deleted file mode 100644 index 37480ae67..000000000 --- a/lib/plaid/models/entity_screening_hit_documents_items.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Analyzed documents for the associated hit - class EntityScreeningHitDocumentsItems - attr_accessor :analysis - - attr_accessor :data - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'analysis' => :'analysis', - :'data' => :'data' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'analysis' => :'MatchSummary', - :'data' => :'EntityDocument' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityScreeningHitDocumentsItems` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityScreeningHitDocumentsItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - analysis == o.analysis && - data == o.data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [analysis, data].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_screening_hit_emails.rb b/lib/plaid/models/entity_screening_hit_emails.rb deleted file mode 100644 index 6890db34c..000000000 --- a/lib/plaid/models/entity_screening_hit_emails.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Email address information for the associated entity watchlist hit - class EntityScreeningHitEmails - # A valid email address. - attr_accessor :email_address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'email_address' => :'email_address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'email_address' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityScreeningHitEmails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityScreeningHitEmails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @email_address.nil? - invalid_properties.push('invalid value for "email_address", email_address cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @email_address.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - email_address == o.email_address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [email_address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_screening_hit_emails_items.rb b/lib/plaid/models/entity_screening_hit_emails_items.rb deleted file mode 100644 index 0c151187f..000000000 --- a/lib/plaid/models/entity_screening_hit_emails_items.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Analyzed emails for the associated hit - class EntityScreeningHitEmailsItems - attr_accessor :analysis - - attr_accessor :data - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'analysis' => :'analysis', - :'data' => :'data' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'analysis' => :'MatchSummary', - :'data' => :'EntityScreeningHitEmails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityScreeningHitEmailsItems` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityScreeningHitEmailsItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - analysis == o.analysis && - data == o.data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [analysis, data].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_screening_hit_names.rb b/lib/plaid/models/entity_screening_hit_names.rb deleted file mode 100644 index 859b8a127..000000000 --- a/lib/plaid/models/entity_screening_hit_names.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Name information for the associated entity watchlist hit - class EntityScreeningHitNames - # The full name of the entity. - attr_accessor :full - - # Primary names are those most commonly used to refer to this entity. Only one name will ever be marked as primary. - attr_accessor :is_primary - - attr_accessor :weak_alias_determination - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'full' => :'full', - :'is_primary' => :'is_primary', - :'weak_alias_determination' => :'weak_alias_determination' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'full' => :'String', - :'is_primary' => :'Boolean', - :'weak_alias_determination' => :'WeakAliasDetermination' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityScreeningHitNames` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityScreeningHitNames`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'full') - self.full = attributes[:'full'] - end - - if attributes.key?(:'is_primary') - self.is_primary = attributes[:'is_primary'] - end - - if attributes.key?(:'weak_alias_determination') - self.weak_alias_determination = attributes[:'weak_alias_determination'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @full.nil? - invalid_properties.push('invalid value for "full", full cannot be nil.') - end - - if @is_primary.nil? - invalid_properties.push('invalid value for "is_primary", is_primary cannot be nil.') - end - - if @weak_alias_determination.nil? - invalid_properties.push('invalid value for "weak_alias_determination", weak_alias_determination cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @full.nil? - return false if @is_primary.nil? - return false if @weak_alias_determination.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - full == o.full && - is_primary == o.is_primary && - weak_alias_determination == o.weak_alias_determination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [full, is_primary, weak_alias_determination].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_screening_hit_names_items.rb b/lib/plaid/models/entity_screening_hit_names_items.rb deleted file mode 100644 index 1cbfa9c81..000000000 --- a/lib/plaid/models/entity_screening_hit_names_items.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Analyzed names for the associated hit - class EntityScreeningHitNamesItems - attr_accessor :analysis - - attr_accessor :data - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'analysis' => :'analysis', - :'data' => :'data' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'analysis' => :'MatchSummary', - :'data' => :'EntityScreeningHitNames' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityScreeningHitNamesItems` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityScreeningHitNamesItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - analysis == o.analysis && - data == o.data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [analysis, data].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_screening_hit_phone_numbers.rb b/lib/plaid/models/entity_screening_hit_phone_numbers.rb deleted file mode 100644 index 398d6a186..000000000 --- a/lib/plaid/models/entity_screening_hit_phone_numbers.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Phone number information associated with the entity screening hit - class EntityScreeningHitPhoneNumbers - attr_accessor :type - - # A phone number in E.164 format. - attr_accessor :phone_number - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'phone_number' => :'phone_number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'PhoneType', - :'phone_number' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityScreeningHitPhoneNumbers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityScreeningHitPhoneNumbers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @phone_number.nil? - invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - return false if @phone_number.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - phone_number == o.phone_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, phone_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_screening_hit_urls.rb b/lib/plaid/models/entity_screening_hit_urls.rb deleted file mode 100644 index 0ecc79e9c..000000000 --- a/lib/plaid/models/entity_screening_hit_urls.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # URLs associated with the entity screening hit - class EntityScreeningHitUrls - # An 'http' or 'https' URL (must begin with either of those). - attr_accessor :url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'url' => :'url' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityScreeningHitUrls` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityScreeningHitUrls`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @url.nil? - invalid_properties.push('invalid value for "url", url cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @url.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - url == o.url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_screening_hit_urls_items.rb b/lib/plaid/models/entity_screening_hit_urls_items.rb deleted file mode 100644 index 1d1b2898e..000000000 --- a/lib/plaid/models/entity_screening_hit_urls_items.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Analyzed URLs for the associated hit - class EntityScreeningHitUrlsItems - attr_accessor :analysis - - attr_accessor :data - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'analysis' => :'analysis', - :'data' => :'data' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'analysis' => :'MatchSummary', - :'data' => :'EntityScreeningHitUrls' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityScreeningHitUrlsItems` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityScreeningHitUrlsItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - analysis == o.analysis && - data == o.data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [analysis, data].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_screening_hits_phone_number_items.rb b/lib/plaid/models/entity_screening_hits_phone_number_items.rb deleted file mode 100644 index 41f29e0cf..000000000 --- a/lib/plaid/models/entity_screening_hits_phone_number_items.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Analyzed phone numbers for the associated hit - class EntityScreeningHitsPhoneNumberItems - attr_accessor :analysis - - attr_accessor :data - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'analysis' => :'analysis', - :'data' => :'data' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'analysis' => :'MatchSummary', - :'data' => :'EntityScreeningHitPhoneNumbers' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityScreeningHitsPhoneNumberItems` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityScreeningHitsPhoneNumberItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - analysis == o.analysis && - data == o.data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [analysis, data].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_screening_status_updated_webhook.rb b/lib/plaid/models/entity_screening_status_updated_webhook.rb deleted file mode 100644 index 2df769acd..000000000 --- a/lib/plaid/models/entity_screening_status_updated_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when an entity screening status has changed, which can occur manually via the dashboard or during ongoing monitoring. - class EntityScreeningStatusUpdatedWebhook - # `ENTITY_SCREENING` - attr_accessor :webhook_type - - # `STATUS_UPDATED` - attr_accessor :webhook_code - - # The ID of the associated screening. - attr_accessor :screening_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'screening_id' => :'screening_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'screening_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityScreeningStatusUpdatedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityScreeningStatusUpdatedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'screening_id') - self.screening_id = attributes[:'screening_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @screening_id.nil? - invalid_properties.push('invalid value for "screening_id", screening_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @screening_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - screening_id == o.screening_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, screening_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_watchlist_code.rb b/lib/plaid/models/entity_watchlist_code.rb deleted file mode 100644 index 771aa81ee..000000000 --- a/lib/plaid/models/entity_watchlist_code.rb +++ /dev/null @@ -1,51 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class EntityWatchlistCode - CA_CON = "CA_CON".freeze - EU_CON = "EU_CON".freeze - IZ_SOE = "IZ_SOE".freeze - IZ_UNC = "IZ_UNC".freeze - IZ_WBK = "IZ_WBK".freeze - US_CAP = "US_CAP".freeze - US_FSE = "US_FSE".freeze - US_MBS = "US_MBS".freeze - US_SDN = "US_SDN".freeze - US_SSI = "US_SSI".freeze - US_CMC = "US_CMC".freeze - US_UVL = "US_UVL".freeze - AU_CON = "AU_CON".freeze - UK_HMC = "UK_HMC".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/entity_watchlist_program.rb b/lib/plaid/models/entity_watchlist_program.rb deleted file mode 100644 index 662a7b125..000000000 --- a/lib/plaid/models/entity_watchlist_program.rb +++ /dev/null @@ -1,386 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A program that configures the active lists, search parameters, and other behavior for initial and ongoing screening of entities. - class EntityWatchlistProgram - # ID of the associated entity program. - attr_accessor :id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - # Indicator specifying whether the program is enabled and will perform daily rescans. - attr_accessor :is_rescanning_enabled - - # Watchlists enabled for the associated program - attr_accessor :lists_enabled - - # A name for the entity program to define its purpose. For example, \"High Risk Organizations\" or \"Applicants\". - attr_accessor :name - - attr_accessor :name_sensitivity - - attr_accessor :audit_trail - - # Archived programs are read-only and cannot screen new customers nor participate in ongoing monitoring. - attr_accessor :is_archived - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'created_at' => :'created_at', - :'is_rescanning_enabled' => :'is_rescanning_enabled', - :'lists_enabled' => :'lists_enabled', - :'name' => :'name', - :'name_sensitivity' => :'name_sensitivity', - :'audit_trail' => :'audit_trail', - :'is_archived' => :'is_archived' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'created_at' => :'Time', - :'is_rescanning_enabled' => :'Boolean', - :'lists_enabled' => :'Array', - :'name' => :'String', - :'name_sensitivity' => :'ProgramNameSensitivity', - :'audit_trail' => :'WatchlistScreeningAuditTrail', - :'is_archived' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityWatchlistProgram` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityWatchlistProgram`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'is_rescanning_enabled') - self.is_rescanning_enabled = attributes[:'is_rescanning_enabled'] - end - - if attributes.key?(:'lists_enabled') - if (value = attributes[:'lists_enabled']).is_a?(Array) - self.lists_enabled = value - end - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'name_sensitivity') - self.name_sensitivity = attributes[:'name_sensitivity'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'is_archived') - self.is_archived = attributes[:'is_archived'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @is_rescanning_enabled.nil? - invalid_properties.push('invalid value for "is_rescanning_enabled", is_rescanning_enabled cannot be nil.') - end - - if @lists_enabled.nil? - invalid_properties.push('invalid value for "lists_enabled", lists_enabled cannot be nil.') - end - - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @name.to_s.length < 1 - invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') - end - - - if @name_sensitivity.nil? - invalid_properties.push('invalid value for "name_sensitivity", name_sensitivity cannot be nil.') - end - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @is_archived.nil? - invalid_properties.push('invalid value for "is_archived", is_archived cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @created_at.nil? - return false if @is_rescanning_enabled.nil? - return false if @lists_enabled.nil? - return false if @name.nil? - return false if @name.to_s.length < 1 - return false if @name_sensitivity.nil? - return false if @audit_trail.nil? - return false if @is_archived.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] lists_enabled Value to be assigned - def lists_enabled=(lists_enabled) - if lists_enabled.nil? - fail ArgumentError, 'lists_enabled cannot be nil' - end - - - @lists_enabled = lists_enabled - end - - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if name.nil? - fail ArgumentError, 'name cannot be nil' - end - - if name.to_s.length < 1 - fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' - end - - - @name = name - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - created_at == o.created_at && - is_rescanning_enabled == o.is_rescanning_enabled && - lists_enabled == o.lists_enabled && - name == o.name && - name_sensitivity == o.name_sensitivity && - audit_trail == o.audit_trail && - is_archived == o.is_archived - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, created_at, is_rescanning_enabled, lists_enabled, name, name_sensitivity, audit_trail, is_archived].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_watchlist_screening.rb b/lib/plaid/models/entity_watchlist_screening.rb deleted file mode 100644 index dfad6b95d..000000000 --- a/lib/plaid/models/entity_watchlist_screening.rb +++ /dev/null @@ -1,329 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class EntityWatchlistScreening - # ID of the associated entity screening. - attr_accessor :id - - attr_accessor :search_terms - - # ID of the associated user. - attr_accessor :assignee - - attr_accessor :status - - # 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`. - attr_accessor :client_user_id - - attr_accessor :audit_trail - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'search_terms' => :'search_terms', - :'assignee' => :'assignee', - :'status' => :'status', - :'client_user_id' => :'client_user_id', - :'audit_trail' => :'audit_trail' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'search_terms' => :'EntityWatchlistScreeningSearchTerms', - :'assignee' => :'String', - :'status' => :'WatchlistScreeningStatus', - :'client_user_id' => :'String', - :'audit_trail' => :'WatchlistScreeningAuditTrail' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'assignee', - :'client_user_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityWatchlistScreening` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityWatchlistScreening`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'search_terms') - self.search_terms = attributes[:'search_terms'] - end - - if attributes.key?(:'assignee') - self.assignee = attributes[:'assignee'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @search_terms.nil? - invalid_properties.push('invalid value for "search_terms", search_terms cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @search_terms.nil? - return false if @status.nil? - return false if @client_user_id.to_s.length < 1 - return false if @audit_trail.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - search_terms == o.search_terms && - assignee == o.assignee && - status == o.status && - client_user_id == o.client_user_id && - audit_trail == o.audit_trail - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, search_terms, assignee, status, client_user_id, audit_trail].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_watchlist_screening_hit.rb b/lib/plaid/models/entity_watchlist_screening_hit.rb deleted file mode 100644 index 24b2c38fb..000000000 --- a/lib/plaid/models/entity_watchlist_screening_hit.rb +++ /dev/null @@ -1,374 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data from a government watchlist that has been attached to the screening. - class EntityWatchlistScreeningHit - # ID of the associated entity screening hit. - attr_accessor :id - - attr_accessor :review_status - - # An ISO8601 formatted timestamp. - attr_accessor :first_active - - # An ISO8601 formatted timestamp. - attr_accessor :inactive_since - - # An ISO8601 formatted timestamp. - attr_accessor :historical_since - - attr_accessor :list_code - - # A universal identifier for a watchlist individual that is stable across searches and updates. - attr_accessor :plaid_uid - - # The identifier provided by the source sanction or watchlist. When one is not provided by the source, this is `null`. - attr_accessor :source_uid - - attr_accessor :analysis - - attr_accessor :data - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'review_status' => :'review_status', - :'first_active' => :'first_active', - :'inactive_since' => :'inactive_since', - :'historical_since' => :'historical_since', - :'list_code' => :'list_code', - :'plaid_uid' => :'plaid_uid', - :'source_uid' => :'source_uid', - :'analysis' => :'analysis', - :'data' => :'data' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'review_status' => :'WatchlistScreeningHitStatus', - :'first_active' => :'Time', - :'inactive_since' => :'Time', - :'historical_since' => :'Time', - :'list_code' => :'EntityWatchlistCode', - :'plaid_uid' => :'String', - :'source_uid' => :'String', - :'analysis' => :'EntityScreeningHitAnalysis', - :'data' => :'EntityScreeningHitData' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'inactive_since', - :'historical_since', - :'source_uid', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityWatchlistScreeningHit` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityWatchlistScreeningHit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'review_status') - self.review_status = attributes[:'review_status'] - end - - if attributes.key?(:'first_active') - self.first_active = attributes[:'first_active'] - end - - if attributes.key?(:'inactive_since') - self.inactive_since = attributes[:'inactive_since'] - end - - if attributes.key?(:'historical_since') - self.historical_since = attributes[:'historical_since'] - end - - if attributes.key?(:'list_code') - self.list_code = attributes[:'list_code'] - end - - if attributes.key?(:'plaid_uid') - self.plaid_uid = attributes[:'plaid_uid'] - end - - if attributes.key?(:'source_uid') - self.source_uid = attributes[:'source_uid'] - end - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @review_status.nil? - invalid_properties.push('invalid value for "review_status", review_status cannot be nil.') - end - - if @first_active.nil? - invalid_properties.push('invalid value for "first_active", first_active cannot be nil.') - end - - if @list_code.nil? - invalid_properties.push('invalid value for "list_code", list_code cannot be nil.') - end - - if @plaid_uid.nil? - invalid_properties.push('invalid value for "plaid_uid", plaid_uid cannot be nil.') - end - - if @source_uid.to_s.length < 1 - invalid_properties.push('invalid value for "source_uid", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @review_status.nil? - return false if @first_active.nil? - return false if @list_code.nil? - return false if @plaid_uid.nil? - return false if @source_uid.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] source_uid Value to be assigned - def source_uid=(source_uid) - if source_uid.to_s.length < 1 - fail ArgumentError, 'invalid value for "source_uid", the character length must be great than or equal to 1.' - end - - - @source_uid = source_uid - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - review_status == o.review_status && - first_active == o.first_active && - inactive_since == o.inactive_since && - historical_since == o.historical_since && - list_code == o.list_code && - plaid_uid == o.plaid_uid && - source_uid == o.source_uid && - analysis == o.analysis && - data == o.data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, review_status, first_active, inactive_since, historical_since, list_code, plaid_uid, source_uid, analysis, data].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_watchlist_screening_review.rb b/lib/plaid/models/entity_watchlist_screening_review.rb deleted file mode 100644 index c95a91184..000000000 --- a/lib/plaid/models/entity_watchlist_screening_review.rb +++ /dev/null @@ -1,302 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class EntityWatchlistScreeningReview - # ID of the associated entity review. - attr_accessor :id - - # Hits marked as a true positive after thorough manual review. These hits will never recur or be updated once dismissed. In most cases, confirmed hits indicate that the customer should be rejected. - attr_accessor :confirmed_hits - - # Hits marked as a false positive after thorough manual review. These hits will never recur or be updated once dismissed. - attr_accessor :dismissed_hits - - # A comment submitted by a team member as part of reviewing a watchlist screening. - attr_accessor :comment - - attr_accessor :audit_trail - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'confirmed_hits' => :'confirmed_hits', - :'dismissed_hits' => :'dismissed_hits', - :'comment' => :'comment', - :'audit_trail' => :'audit_trail' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'confirmed_hits' => :'Array', - :'dismissed_hits' => :'Array', - :'comment' => :'String', - :'audit_trail' => :'WatchlistScreeningAuditTrail' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'comment', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityWatchlistScreeningReview` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityWatchlistScreeningReview`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'confirmed_hits') - if (value = attributes[:'confirmed_hits']).is_a?(Array) - self.confirmed_hits = value - end - end - - if attributes.key?(:'dismissed_hits') - if (value = attributes[:'dismissed_hits']).is_a?(Array) - self.dismissed_hits = value - end - end - - if attributes.key?(:'comment') - self.comment = attributes[:'comment'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @confirmed_hits.nil? - invalid_properties.push('invalid value for "confirmed_hits", confirmed_hits cannot be nil.') - end - - if @dismissed_hits.nil? - invalid_properties.push('invalid value for "dismissed_hits", dismissed_hits cannot be nil.') - end - - if @comment.to_s.length < 1 - invalid_properties.push('invalid value for "comment", the character length must be great than or equal to 1.') - end - - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @confirmed_hits.nil? - return false if @dismissed_hits.nil? - return false if @comment.to_s.length < 1 - return false if @audit_trail.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] comment Value to be assigned - def comment=(comment) - if comment.to_s.length < 1 - fail ArgumentError, 'invalid value for "comment", the character length must be great than or equal to 1.' - end - - - @comment = comment - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - confirmed_hits == o.confirmed_hits && - dismissed_hits == o.dismissed_hits && - comment == o.comment && - audit_trail == o.audit_trail - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, confirmed_hits, dismissed_hits, comment, audit_trail].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_watchlist_screening_search_terms.rb b/lib/plaid/models/entity_watchlist_screening_search_terms.rb deleted file mode 100644 index 5d05e2206..000000000 --- a/lib/plaid/models/entity_watchlist_screening_search_terms.rb +++ /dev/null @@ -1,366 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Search terms associated with an entity used for searching against watchlists - class EntityWatchlistScreeningSearchTerms - # ID of the associated entity program. - attr_accessor :entity_watchlist_program_id - - # The name of the organization being screened. - attr_accessor :legal_name - - # The numeric or alphanumeric identifier associated with this document. - attr_accessor :document_number - - # A valid email address. - attr_accessor :email_address - - # Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :country - - # A phone number in E.164 format. - attr_accessor :phone_number - - # An 'http' or 'https' URL (must begin with either of those). - attr_accessor :url - - # The current version of the search terms. Starts at `1` and increments with each edit to `search_terms`. - attr_accessor :version - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'entity_watchlist_program_id' => :'entity_watchlist_program_id', - :'legal_name' => :'legal_name', - :'document_number' => :'document_number', - :'email_address' => :'email_address', - :'country' => :'country', - :'phone_number' => :'phone_number', - :'url' => :'url', - :'version' => :'version' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'entity_watchlist_program_id' => :'String', - :'legal_name' => :'String', - :'document_number' => :'String', - :'email_address' => :'String', - :'country' => :'String', - :'phone_number' => :'String', - :'url' => :'String', - :'version' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'document_number', - :'email_address', - :'country', - :'phone_number', - :'url', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityWatchlistScreeningSearchTerms` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityWatchlistScreeningSearchTerms`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'entity_watchlist_program_id') - self.entity_watchlist_program_id = attributes[:'entity_watchlist_program_id'] - end - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'document_number') - self.document_number = attributes[:'document_number'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @entity_watchlist_program_id.nil? - invalid_properties.push('invalid value for "entity_watchlist_program_id", entity_watchlist_program_id cannot be nil.') - end - - if @legal_name.nil? - invalid_properties.push('invalid value for "legal_name", legal_name cannot be nil.') - end - - if @legal_name.to_s.length < 1 - invalid_properties.push('invalid value for "legal_name", the character length must be great than or equal to 1.') - end - - - if @document_number.to_s.length < 4 - invalid_properties.push('invalid value for "document_number", the character length must be great than or equal to 4.') - end - - - if @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - if @version.nil? - invalid_properties.push('invalid value for "version", version cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @entity_watchlist_program_id.nil? - return false if @legal_name.nil? - return false if @legal_name.to_s.length < 1 - return false if @document_number.to_s.length < 4 - return false if @country.to_s.length < 2 - return false if @version.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] legal_name Value to be assigned - def legal_name=(legal_name) - if legal_name.nil? - fail ArgumentError, 'legal_name cannot be nil' - end - - if legal_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "legal_name", the character length must be great than or equal to 1.' - end - - - @legal_name = legal_name - end - - # Custom attribute writer method with validation - # @param [Object] document_number Value to be assigned - def document_number=(document_number) - if document_number.to_s.length < 4 - fail ArgumentError, 'invalid value for "document_number", the character length must be great than or equal to 4.' - end - - - @document_number = document_number - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - entity_watchlist_program_id == o.entity_watchlist_program_id && - legal_name == o.legal_name && - document_number == o.document_number && - email_address == o.email_address && - country == o.country && - phone_number == o.phone_number && - url == o.url && - version == o.version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [entity_watchlist_program_id, legal_name, document_number, email_address, country, phone_number, url, version].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/entity_watchlist_search_terms.rb b/lib/plaid/models/entity_watchlist_search_terms.rb deleted file mode 100644 index bebd1d6ed..000000000 --- a/lib/plaid/models/entity_watchlist_search_terms.rb +++ /dev/null @@ -1,351 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Search inputs for creating an entity watchlist screening - class EntityWatchlistSearchTerms - # ID of the associated entity program. - attr_accessor :entity_watchlist_program_id - - # The name of the organization being screened. - attr_accessor :legal_name - - # The numeric or alphanumeric identifier associated with this document. - attr_accessor :document_number - - # A valid email address. - attr_accessor :email_address - - # Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :country - - # A phone number in E.164 format. - attr_accessor :phone_number - - # An 'http' or 'https' URL (must begin with either of those). - attr_accessor :url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'entity_watchlist_program_id' => :'entity_watchlist_program_id', - :'legal_name' => :'legal_name', - :'document_number' => :'document_number', - :'email_address' => :'email_address', - :'country' => :'country', - :'phone_number' => :'phone_number', - :'url' => :'url' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'entity_watchlist_program_id' => :'String', - :'legal_name' => :'String', - :'document_number' => :'String', - :'email_address' => :'String', - :'country' => :'String', - :'phone_number' => :'String', - :'url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'document_number', - :'email_address', - :'country', - :'phone_number', - :'url' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::EntityWatchlistSearchTerms` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::EntityWatchlistSearchTerms`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'entity_watchlist_program_id') - self.entity_watchlist_program_id = attributes[:'entity_watchlist_program_id'] - end - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'document_number') - self.document_number = attributes[:'document_number'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @entity_watchlist_program_id.nil? - invalid_properties.push('invalid value for "entity_watchlist_program_id", entity_watchlist_program_id cannot be nil.') - end - - if @legal_name.nil? - invalid_properties.push('invalid value for "legal_name", legal_name cannot be nil.') - end - - if @legal_name.to_s.length < 1 - invalid_properties.push('invalid value for "legal_name", the character length must be great than or equal to 1.') - end - - - if !@document_number.nil? && @document_number.to_s.length < 4 - invalid_properties.push('invalid value for "document_number", the character length must be great than or equal to 4.') - end - - - if !@country.nil? && @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @entity_watchlist_program_id.nil? - return false if @legal_name.nil? - return false if @legal_name.to_s.length < 1 - return false if !@document_number.nil? && @document_number.to_s.length < 4 - return false if !@country.nil? && @country.to_s.length < 2 - true - end - - # Custom attribute writer method with validation - # @param [Object] legal_name Value to be assigned - def legal_name=(legal_name) - if legal_name.nil? - fail ArgumentError, 'legal_name cannot be nil' - end - - if legal_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "legal_name", the character length must be great than or equal to 1.' - end - - - @legal_name = legal_name - end - - # Custom attribute writer method with validation - # @param [Object] document_number Value to be assigned - def document_number=(document_number) - if !document_number.nil? && document_number.to_s.length < 4 - fail ArgumentError, 'invalid value for "document_number", the character length must be great than or equal to 4.' - end - - - @document_number = document_number - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if !country.nil? && country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - entity_watchlist_program_id == o.entity_watchlist_program_id && - legal_name == o.legal_name && - document_number == o.document_number && - email_address == o.email_address && - country == o.country && - phone_number == o.phone_number && - url == o.url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [entity_watchlist_program_id, legal_name, document_number, email_address, country, phone_number, url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/expiration_date.rb b/lib/plaid/models/expiration_date.rb deleted file mode 100644 index 73779db3c..000000000 --- a/lib/plaid/models/expiration_date.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class ExpirationDate - NOT_EXPIRED = "not_expired".freeze - EXPIRED = "expired".freeze - NO_DATA = "no_data".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/external_payment_initiation_consent_options.rb b/lib/plaid/models/external_payment_initiation_consent_options.rb deleted file mode 100644 index f001ffcf7..000000000 --- a/lib/plaid/models/external_payment_initiation_consent_options.rb +++ /dev/null @@ -1,269 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Additional payment consent options - class ExternalPaymentInitiationConsentOptions - # When `true`, Plaid will attempt to request refund details from the payee's financial institution. Support varies between financial institutions and will not always be available. If refund details could be retrieved, they will be available in the `/payment_initiation/payment/get` response. - attr_accessor :request_refund_details - - # The International Bank Account Number (IBAN) for the payer's account. Where possible, the end user will be able to set up payment consent using only the specified bank account if provided. - attr_accessor :iban - - attr_accessor :bacs - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_refund_details' => :'request_refund_details', - :'iban' => :'iban', - :'bacs' => :'bacs' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_refund_details' => :'Boolean', - :'iban' => :'String', - :'bacs' => :'PaymentInitiationOptionalRestrictionBacs' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'request_refund_details', - :'iban', - :'bacs' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ExternalPaymentInitiationConsentOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ExternalPaymentInitiationConsentOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_refund_details') - self.request_refund_details = attributes[:'request_refund_details'] - end - - if attributes.key?(:'iban') - self.iban = attributes[:'iban'] - end - - if attributes.key?(:'bacs') - self.bacs = attributes[:'bacs'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@iban.nil? && @iban.to_s.length > 34 - invalid_properties.push('invalid value for "iban", the character length must be smaller than or equal to 34.') - end - - if !@iban.nil? && @iban.to_s.length < 15 - invalid_properties.push('invalid value for "iban", the character length must be great than or equal to 15.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@iban.nil? && @iban.to_s.length > 34 - return false if !@iban.nil? && @iban.to_s.length < 15 - true - end - - # Custom attribute writer method with validation - # @param [Object] iban Value to be assigned - def iban=(iban) - if !iban.nil? && iban.to_s.length > 34 - fail ArgumentError, 'invalid value for "iban", the character length must be smaller than or equal to 34.' - end - - if !iban.nil? && iban.to_s.length < 15 - fail ArgumentError, 'invalid value for "iban", the character length must be great than or equal to 15.' - end - - - @iban = iban - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_refund_details == o.request_refund_details && - iban == o.iban && - bacs == o.bacs - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_refund_details, iban, bacs].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/external_payment_options.rb b/lib/plaid/models/external_payment_options.rb deleted file mode 100644 index 6dbf122a5..000000000 --- a/lib/plaid/models/external_payment_options.rb +++ /dev/null @@ -1,301 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Additional payment options - class ExternalPaymentOptions - # When `true`, Plaid will attempt to request refund details from the payee's financial institution. Support varies between financial institutions and will not always be available. If refund details could be retrieved, they will be available in the `/payment_initiation/payment/get` response. - attr_accessor :request_refund_details - - # The International Bank Account Number (IBAN) for the payer's account. Where possible, the end user will be able to send payments only from the specified bank account if provided. - attr_accessor :iban - - attr_accessor :bacs - - attr_accessor :scheme - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_refund_details' => :'request_refund_details', - :'iban' => :'iban', - :'bacs' => :'bacs', - :'scheme' => :'scheme' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_refund_details' => :'Boolean', - :'iban' => :'String', - :'bacs' => :'PaymentInitiationOptionalRestrictionBacs', - :'scheme' => :'PaymentScheme' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'request_refund_details', - :'iban', - :'bacs', - :'scheme' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ExternalPaymentOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ExternalPaymentOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_refund_details') - self.request_refund_details = attributes[:'request_refund_details'] - end - - if attributes.key?(:'iban') - self.iban = attributes[:'iban'] - end - - if attributes.key?(:'bacs') - self.bacs = attributes[:'bacs'] - end - - if attributes.key?(:'scheme') - self.scheme = attributes[:'scheme'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@iban.nil? && @iban.to_s.length > 34 - invalid_properties.push('invalid value for "iban", the character length must be smaller than or equal to 34.') - end - - if !@iban.nil? && @iban.to_s.length < 15 - invalid_properties.push('invalid value for "iban", the character length must be great than or equal to 15.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@iban.nil? && @iban.to_s.length > 34 - return false if !@iban.nil? && @iban.to_s.length < 15 - true - end - - # Custom attribute writer method with validation - # @param [Object] iban Value to be assigned - def iban=(iban) - if !iban.nil? && iban.to_s.length > 34 - fail ArgumentError, 'invalid value for "iban", the character length must be smaller than or equal to 34.' - end - - if !iban.nil? && iban.to_s.length < 15 - fail ArgumentError, 'invalid value for "iban", the character length must be great than or equal to 15.' - end - - - @iban = iban - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_refund_details == o.request_refund_details && - iban == o.iban && - bacs == o.bacs && - scheme == o.scheme - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_refund_details, iban, bacs, scheme].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/external_payment_refund_details.rb b/lib/plaid/models/external_payment_refund_details.rb deleted file mode 100644 index eb0afdfea..000000000 --- a/lib/plaid/models/external_payment_refund_details.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Details about external payment refund - class ExternalPaymentRefundDetails - # The name of the account holder. - attr_accessor :name - - # The International Bank Account Number (IBAN) for the account. - attr_accessor :iban - - attr_accessor :bacs - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'iban' => :'iban', - :'bacs' => :'bacs' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'iban' => :'String', - :'bacs' => :'RecipientBACSNullable' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'iban', - :'bacs' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ExternalPaymentRefundDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ExternalPaymentRefundDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'iban') - self.iban = attributes[:'iban'] - end - - if attributes.key?(:'bacs') - self.bacs = attributes[:'bacs'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - iban == o.iban && - bacs == o.bacs - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, iban, bacs].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/external_payment_schedule_base.rb b/lib/plaid/models/external_payment_schedule_base.rb deleted file mode 100644 index 6d236c361..000000000 --- a/lib/plaid/models/external_payment_schedule_base.rb +++ /dev/null @@ -1,284 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class ExternalPaymentScheduleBase - attr_accessor :interval - - # 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). If the payment interval is monthly, `interval_execution_day` should be an integer indicating which day of the month to make the payment on. Integers from 1 to 28 can be used to make a payment on that day of the month. Negative integers from -1 to -5 can be used to make a payment relative to the end of the month. To make a payment on the last day of the month, use -1; to make the payment on the second-to-last day, use -2, and so on. - attr_accessor :interval_execution_day - - # A date in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). Standing order payments 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 `/payment_initiation/payment/create` was called, the bank *may* make the first payment on that day, but it is not guaranteed to do so. - attr_accessor :start_date - - # A date in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). Standing order payments will end on the last `interval_execution_day` on or before the `end_date`. If the only `interval_execution_day` between the start date and the end date (inclusive) is also the same day that `/payment_initiation/payment/create` was called, the bank *may* make a payment on that day, but it is not guaranteed to do so. - attr_accessor :end_date - - # 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`. - attr_accessor :adjusted_start_date - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'interval' => :'interval', - :'interval_execution_day' => :'interval_execution_day', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'adjusted_start_date' => :'adjusted_start_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'interval' => :'PaymentScheduleInterval', - :'interval_execution_day' => :'Integer', - :'start_date' => :'Date', - :'end_date' => :'Date', - :'adjusted_start_date' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'end_date', - :'adjusted_start_date' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ExternalPaymentScheduleBase` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ExternalPaymentScheduleBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'interval') - self.interval = attributes[:'interval'] - end - - if attributes.key?(:'interval_execution_day') - self.interval_execution_day = attributes[:'interval_execution_day'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'adjusted_start_date') - self.adjusted_start_date = attributes[:'adjusted_start_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - interval == o.interval && - interval_execution_day == o.interval_execution_day && - start_date == o.start_date && - end_date == o.end_date && - adjusted_start_date == o.adjusted_start_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [interval, interval_execution_day, start_date, end_date, adjusted_start_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/external_payment_schedule_get.rb b/lib/plaid/models/external_payment_schedule_get.rb deleted file mode 100644 index a0152523b..000000000 --- a/lib/plaid/models/external_payment_schedule_get.rb +++ /dev/null @@ -1,306 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class ExternalPaymentScheduleGet - attr_accessor :interval - - # 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). If the payment interval is monthly, `interval_execution_day` should be an integer indicating which day of the month to make the payment on. Integers from 1 to 28 can be used to make a payment on that day of the month. Negative integers from -1 to -5 can be used to make a payment relative to the end of the month. To make a payment on the last day of the month, use -1; to make the payment on the second-to-last day, use -2, and so on. - attr_accessor :interval_execution_day - - # A date in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). Standing order payments 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 `/payment_initiation/payment/create` was called, the bank *may* make the first payment on that day, but it is not guaranteed to do so. - attr_accessor :start_date - - # A date in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). Standing order payments will end on the last `interval_execution_day` on or before the `end_date`. If the only `interval_execution_day` between the start date and the end date (inclusive) is also the same day that `/payment_initiation/payment/create` was called, the bank *may* make a payment on that day, but it is not guaranteed to do so. - attr_accessor :end_date - - # 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`. - attr_accessor :adjusted_start_date - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'interval' => :'interval', - :'interval_execution_day' => :'interval_execution_day', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'adjusted_start_date' => :'adjusted_start_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'interval' => :'PaymentScheduleInterval', - :'interval_execution_day' => :'Integer', - :'start_date' => :'Date', - :'end_date' => :'Date', - :'adjusted_start_date' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'end_date', - :'adjusted_start_date' - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'ExternalPaymentScheduleBase' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ExternalPaymentScheduleGet` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ExternalPaymentScheduleGet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'interval') - self.interval = attributes[:'interval'] - end - - if attributes.key?(:'interval_execution_day') - self.interval_execution_day = attributes[:'interval_execution_day'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'adjusted_start_date') - self.adjusted_start_date = attributes[:'adjusted_start_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @interval.nil? - invalid_properties.push('invalid value for "interval", interval cannot be nil.') - end - - if @interval_execution_day.nil? - invalid_properties.push('invalid value for "interval_execution_day", interval_execution_day cannot be nil.') - end - - if @start_date.nil? - invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @interval.nil? - return false if @interval_execution_day.nil? - return false if @start_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - interval == o.interval && - interval_execution_day == o.interval_execution_day && - start_date == o.start_date && - end_date == o.end_date && - adjusted_start_date == o.adjusted_start_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [interval, interval_execution_day, start_date, end_date, adjusted_start_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/external_payment_schedule_request.rb b/lib/plaid/models/external_payment_schedule_request.rb deleted file mode 100644 index 1a83817e3..000000000 --- a/lib/plaid/models/external_payment_schedule_request.rb +++ /dev/null @@ -1,306 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class ExternalPaymentScheduleRequest - attr_accessor :interval - - # 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). If the payment interval is monthly, `interval_execution_day` should be an integer indicating which day of the month to make the payment on. Integers from 1 to 28 can be used to make a payment on that day of the month. Negative integers from -1 to -5 can be used to make a payment relative to the end of the month. To make a payment on the last day of the month, use -1; to make the payment on the second-to-last day, use -2, and so on. - attr_accessor :interval_execution_day - - # A date in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). Standing order payments 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 `/payment_initiation/payment/create` was called, the bank *may* make the first payment on that day, but it is not guaranteed to do so. - attr_accessor :start_date - - # A date in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). Standing order payments will end on the last `interval_execution_day` on or before the `end_date`. If the only `interval_execution_day` between the start date and the end date (inclusive) is also the same day that `/payment_initiation/payment/create` was called, the bank *may* make a payment on that day, but it is not guaranteed to do so. - attr_accessor :end_date - - # 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`. - attr_accessor :adjusted_start_date - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'interval' => :'interval', - :'interval_execution_day' => :'interval_execution_day', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'adjusted_start_date' => :'adjusted_start_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'interval' => :'PaymentScheduleInterval', - :'interval_execution_day' => :'Integer', - :'start_date' => :'Date', - :'end_date' => :'Date', - :'adjusted_start_date' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'end_date', - :'adjusted_start_date' - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'ExternalPaymentScheduleBase' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ExternalPaymentScheduleRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ExternalPaymentScheduleRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'interval') - self.interval = attributes[:'interval'] - end - - if attributes.key?(:'interval_execution_day') - self.interval_execution_day = attributes[:'interval_execution_day'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'adjusted_start_date') - self.adjusted_start_date = attributes[:'adjusted_start_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @interval.nil? - invalid_properties.push('invalid value for "interval", interval cannot be nil.') - end - - if @interval_execution_day.nil? - invalid_properties.push('invalid value for "interval_execution_day", interval_execution_day cannot be nil.') - end - - if @start_date.nil? - invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @interval.nil? - return false if @interval_execution_day.nil? - return false if @start_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - interval == o.interval && - interval_execution_day == o.interval_execution_day && - start_date == o.start_date && - end_date == o.end_date && - adjusted_start_date == o.adjusted_start_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [interval, interval_execution_day, start_date, end_date, adjusted_start_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/fallback_auth_microdeposit_auto_verified_webhook.rb b/lib/plaid/models/fallback_auth_microdeposit_auto_verified_webhook.rb deleted file mode 100644 index e4affe724..000000000 --- a/lib/plaid/models/fallback_auth_microdeposit_auto_verified_webhook.rb +++ /dev/null @@ -1,318 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fires when an account is automatically verified using micro-deposits - class FallbackAuthMicrodepositAutoVerifiedWebhook - # `AUTH` - attr_accessor :webhook_type - - # `AUTOMATICALLY_VERIFIED` - attr_accessor :webhook_code - - # The error code associated with the webhook. - attr_accessor :error - - # The external account ID associated with the micro-deposit - attr_accessor :account_id - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'error' => :'error', - :'account_id' => :'account_id', - :'item_id' => :'item_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'error' => :'String', - :'account_id' => :'String', - :'item_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::FallbackAuthMicrodepositAutoVerifiedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::FallbackAuthMicrodepositAutoVerifiedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @account_id.nil? - return false if @item_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - error == o.error && - account_id == o.account_id && - item_id == o.item_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, error, account_id, item_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/fallback_auth_microdeposit_verification_expired_webhook.rb b/lib/plaid/models/fallback_auth_microdeposit_verification_expired_webhook.rb deleted file mode 100644 index 4928427b5..000000000 --- a/lib/plaid/models/fallback_auth_microdeposit_verification_expired_webhook.rb +++ /dev/null @@ -1,318 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fires when an account has an expired verification when using micro-deposits - class FallbackAuthMicrodepositVerificationExpiredWebhook - # `AUTH` - attr_accessor :webhook_type - - # `VERIFICATION_EXPIRED` - attr_accessor :webhook_code - - # The error code associated with the webhook. - attr_accessor :error - - # The external account ID associated with the micro-deposit - attr_accessor :account_id - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'error' => :'error', - :'account_id' => :'account_id', - :'item_id' => :'item_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'error' => :'String', - :'account_id' => :'String', - :'item_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::FallbackAuthMicrodepositVerificationExpiredWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::FallbackAuthMicrodepositVerificationExpiredWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @account_id.nil? - return false if @item_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - error == o.error && - account_id == o.account_id && - item_id == o.item_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, error, account_id, item_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/fdx_content_types.rb b/lib/plaid/models/fdx_content_types.rb deleted file mode 100644 index 712b4b618..000000000 --- a/lib/plaid/models/fdx_content_types.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class FDXContentTypes - APPLICATION_PDF = "application/pdf".freeze - IMAGE_GIF = "image/gif".freeze - IMAGE_JPEG = "image/jpeg".freeze - IMAGE_TIFF = "image/tiff".freeze - IMAGE_PNG = "image/png".freeze - APPLICATION_JSON = "application/json".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/fdx_hateoas_link.rb b/lib/plaid/models/fdx_hateoas_link.rb deleted file mode 100644 index 0e4e53e50..000000000 --- a/lib/plaid/models/fdx_hateoas_link.rb +++ /dev/null @@ -1,279 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # REST application constraint (Hypermedia As The Engine Of Application State) - class FDXHateoasLink - # URL to invoke the action on the resource - attr_accessor :href - - attr_accessor :action - - # 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) - attr_accessor :rel - - # Content-types that can be used in the Accept header - attr_accessor :types - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'href' => :'href', - :'action' => :'action', - :'rel' => :'rel', - :'types' => :'types' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'href' => :'String', - :'action' => :'FDXHateoasLinkAction', - :'rel' => :'String', - :'types' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::FDXHateoasLink` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::FDXHateoasLink`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'href') - self.href = attributes[:'href'] - end - - if attributes.key?(:'action') - self.action = attributes[:'action'] - end - - if attributes.key?(:'rel') - self.rel = attributes[:'rel'] - end - - if attributes.key?(:'types') - if (value = attributes[:'types']).is_a?(Array) - self.types = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @href.nil? - invalid_properties.push('invalid value for "href", href cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @href.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - href == o.href && - action == o.action && - rel == o.rel && - types == o.types - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [href, action, rel, types].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/fdx_hateoas_link_action.rb b/lib/plaid/models/fdx_hateoas_link_action.rb deleted file mode 100644 index 687a896dd..000000000 --- a/lib/plaid/models/fdx_hateoas_link_action.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class FDXHateoasLinkAction - GET = "GET".freeze - POST = "POST".freeze - PATCH = "PATCH".freeze - DELETE = "DELETE".freeze - PUT = "PUT".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/fdx_initiator_fi_attribute.rb b/lib/plaid/models/fdx_initiator_fi_attribute.rb deleted file mode 100644 index ca08ce852..000000000 --- a/lib/plaid/models/fdx_initiator_fi_attribute.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Initiator Fi Attribute - class FDXInitiatorFiAttribute - attr_accessor :name - - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'value' => :'value' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'value' => :'FDXPartyType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::FDXInitiatorFiAttribute` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::FDXInitiatorFiAttribute`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/fdx_notification.rb b/lib/plaid/models/fdx_notification.rb deleted file mode 100644 index 49fc2b795..000000000 --- a/lib/plaid/models/fdx_notification.rb +++ /dev/null @@ -1,350 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Provides the base fields of a notification. Clients will read the `type` property to determine the expected notification payload - class FDXNotification - # Id of notification - attr_accessor :notification_id - - attr_accessor :type - - # ISO 8601 date-time in format 'YYYY-MM-DDThh:mm:ss.nnn[Z|[+|-]hh:mm]' according to [IETF RFC3339](https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14) - attr_accessor :sent_on - - attr_accessor :category - - attr_accessor :severity - - attr_accessor :priority - - attr_accessor :publisher - - attr_accessor :subscriber - - attr_accessor :notification_payload - - attr_accessor :url - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'notification_id' => :'notificationId', - :'type' => :'type', - :'sent_on' => :'sentOn', - :'category' => :'category', - :'severity' => :'severity', - :'priority' => :'priority', - :'publisher' => :'publisher', - :'subscriber' => :'subscriber', - :'notification_payload' => :'notificationPayload', - :'url' => :'url' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'notification_id' => :'String', - :'type' => :'FDXNotificationType', - :'sent_on' => :'Time', - :'category' => :'FDXNotificationCategory', - :'severity' => :'FDXNotificationSeverity', - :'priority' => :'FDXNotificationPriority', - :'publisher' => :'FDXParty', - :'subscriber' => :'FDXParty', - :'notification_payload' => :'FDXNotificationPayload', - :'url' => :'FDXHateoasLink' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::FDXNotification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::FDXNotification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'notification_id') - self.notification_id = attributes[:'notification_id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'sent_on') - self.sent_on = attributes[:'sent_on'] - end - - if attributes.key?(:'category') - self.category = attributes[:'category'] - end - - if attributes.key?(:'severity') - self.severity = attributes[:'severity'] - end - - if attributes.key?(:'priority') - self.priority = attributes[:'priority'] - end - - if attributes.key?(:'publisher') - self.publisher = attributes[:'publisher'] - end - - if attributes.key?(:'subscriber') - self.subscriber = attributes[:'subscriber'] - end - - if attributes.key?(:'notification_payload') - self.notification_payload = attributes[:'notification_payload'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @notification_id.nil? - invalid_properties.push('invalid value for "notification_id", notification_id cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @sent_on.nil? - invalid_properties.push('invalid value for "sent_on", sent_on cannot be nil.') - end - - if @category.nil? - invalid_properties.push('invalid value for "category", category cannot be nil.') - end - - if @notification_payload.nil? - invalid_properties.push('invalid value for "notification_payload", notification_payload cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @notification_id.nil? - return false if @type.nil? - return false if @sent_on.nil? - return false if @category.nil? - return false if @notification_payload.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - notification_id == o.notification_id && - type == o.type && - sent_on == o.sent_on && - category == o.category && - severity == o.severity && - priority == o.priority && - publisher == o.publisher && - subscriber == o.subscriber && - notification_payload == o.notification_payload && - url == o.url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [notification_id, type, sent_on, category, severity, priority, publisher, subscriber, notification_payload, url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/fdx_notification_category.rb b/lib/plaid/models/fdx_notification_category.rb deleted file mode 100644 index 9d1cb60d5..000000000 --- a/lib/plaid/models/fdx_notification_category.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class FDXNotificationCategory - SECURITY = "SECURITY".freeze - MAINTENANCE = "MAINTENANCE".freeze - FRAUD = "FRAUD".freeze - CONSENT = "CONSENT".freeze - NEW_DATA = "NEW_DATA".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/fdx_notification_payload.rb b/lib/plaid/models/fdx_notification_payload.rb deleted file mode 100644 index 4250aa535..000000000 --- a/lib/plaid/models/fdx_notification_payload.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Custom key-value pairs payload for a notification - class FDXNotificationPayload - # ID for the origination entity related to the notification - attr_accessor :id - - attr_accessor :id_type - - attr_accessor :custom_fields - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'id_type' => :'idType', - :'custom_fields' => :'customFields' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'id_type' => :'FDXNotificationPayloadIdType', - :'custom_fields' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::FDXNotificationPayload` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::FDXNotificationPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'id_type') - self.id_type = attributes[:'id_type'] - end - - if attributes.key?(:'custom_fields') - if (value = attributes[:'custom_fields']).is_a?(Array) - self.custom_fields = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - id_type == o.id_type && - custom_fields == o.custom_fields - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, id_type, custom_fields].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/fdx_notification_payload_id_type.rb b/lib/plaid/models/fdx_notification_payload_id_type.rb deleted file mode 100644 index bfdab8830..000000000 --- a/lib/plaid/models/fdx_notification_payload_id_type.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class FDXNotificationPayloadIdType - ACCOUNT = "ACCOUNT".freeze - CUSTOMER = "CUSTOMER".freeze - PARTY = "PARTY".freeze - MAINTENANCE = "MAINTENANCE".freeze - CONSENT = "CONSENT".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/fdx_notification_priority.rb b/lib/plaid/models/fdx_notification_priority.rb deleted file mode 100644 index 80e66bd45..000000000 --- a/lib/plaid/models/fdx_notification_priority.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class FDXNotificationPriority - HIGH = "HIGH".freeze - MEDIUM = "MEDIUM".freeze - LOW = "LOW".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/fdx_notification_severity.rb b/lib/plaid/models/fdx_notification_severity.rb deleted file mode 100644 index 42384d537..000000000 --- a/lib/plaid/models/fdx_notification_severity.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class FDXNotificationSeverity - EMERGENCY = "EMERGENCY".freeze - ALERT = "ALERT".freeze - WARNING = "WARNING".freeze - NOTICE = "NOTICE".freeze - INFO = "INFO".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/fdx_notification_type.rb b/lib/plaid/models/fdx_notification_type.rb deleted file mode 100644 index b288faa2f..000000000 --- a/lib/plaid/models/fdx_notification_type.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class FDXNotificationType - CONSENT_REVOKED = "CONSENT_REVOKED".freeze - CONSENT_UPDATED = "CONSENT_UPDATED".freeze - CUSTOM = "CUSTOM".freeze - SERVICE = "SERVICE".freeze - BALANCE = "BALANCE".freeze - PLANNED_OUTAGE = "PLANNED_OUTAGE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/fdx_party.rb b/lib/plaid/models/fdx_party.rb deleted file mode 100644 index 6b9969d52..000000000 --- a/lib/plaid/models/fdx_party.rb +++ /dev/null @@ -1,311 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # FDX Participant - an entity or person that is a part of a FDX API transaction - class FDXParty - # Human recognizable common name - attr_accessor :name - - attr_accessor :type - - # URI for party, where an end user could learn more about the company or application involved in the data sharing chain - attr_accessor :home_uri - - # URI for a logo asset to be displayed to the end user - attr_accessor :logo_uri - - attr_accessor :registry - - # Registered name of party - attr_accessor :registered_entity_name - - # Registered id of party - attr_accessor :registered_entity_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'type' => :'type', - :'home_uri' => :'homeUri', - :'logo_uri' => :'logoUri', - :'registry' => :'registry', - :'registered_entity_name' => :'registeredEntityName', - :'registered_entity_id' => :'registeredEntityId' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'type' => :'FDXPartyType', - :'home_uri' => :'String', - :'logo_uri' => :'String', - :'registry' => :'FDXPartyRegistry', - :'registered_entity_name' => :'String', - :'registered_entity_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::FDXParty` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::FDXParty`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'home_uri') - self.home_uri = attributes[:'home_uri'] - end - - if attributes.key?(:'logo_uri') - self.logo_uri = attributes[:'logo_uri'] - end - - if attributes.key?(:'registry') - self.registry = attributes[:'registry'] - end - - if attributes.key?(:'registered_entity_name') - self.registered_entity_name = attributes[:'registered_entity_name'] - end - - if attributes.key?(:'registered_entity_id') - self.registered_entity_id = attributes[:'registered_entity_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - type == o.type && - home_uri == o.home_uri && - logo_uri == o.logo_uri && - registry == o.registry && - registered_entity_name == o.registered_entity_name && - registered_entity_id == o.registered_entity_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, type, home_uri, logo_uri, registry, registered_entity_name, registered_entity_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/fdx_party_registry.rb b/lib/plaid/models/fdx_party_registry.rb deleted file mode 100644 index 223c01031..000000000 --- a/lib/plaid/models/fdx_party_registry.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class FDXPartyRegistry - FDX = "FDX".freeze - GLEIF = "GLEIF".freeze - ICANN = "ICANN".freeze - PRIVATE = "PRIVATE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/fdx_party_type.rb b/lib/plaid/models/fdx_party_type.rb deleted file mode 100644 index 6708344e0..000000000 --- a/lib/plaid/models/fdx_party_type.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class FDXPartyType - DATA_ACCESS_PLATFORM = "DATA_ACCESS_PLATFORM".freeze - DATA_PROVIDER = "DATA_PROVIDER".freeze - DATA_RECIPIENT = "DATA_RECIPIENT".freeze - INDIVIDUAL = "INDIVIDUAL".freeze - MERCHANT = "MERCHANT".freeze - VENDOR = "VENDOR".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/fdxfi_attribute.rb b/lib/plaid/models/fdxfi_attribute.rb deleted file mode 100644 index 7719c9af0..000000000 --- a/lib/plaid/models/fdxfi_attribute.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Financial Institution provider-specific attribute - class FDXFiAttribute - # Name of attribute - attr_accessor :name - - # Value of attribute - attr_accessor :value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'value' => :'value' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'value' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::FDXFiAttribute` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::FDXFiAttribute`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @value.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/financial_institution_insights.rb b/lib/plaid/models/financial_institution_insights.rb deleted file mode 100644 index 8689a4c67..000000000 --- a/lib/plaid/models/financial_institution_insights.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Insights surrounding external financial institution counterparties associated with a user. - class FinancialInstitutionInsights - # Name of the financial institution counterparty. - attr_accessor :name - - # A unique, stable, Plaid-generated id that maps to the counterparty. - attr_accessor :entity_id - - # The website associated with the counterparty. - attr_accessor :website - - # Associated accounts, detected based on the nature of transfers to/from this institution. - attr_accessor :detected_accounts - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'entity_id' => :'entity_id', - :'website' => :'website', - :'detected_accounts' => :'detected_accounts' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'entity_id' => :'String', - :'website' => :'String', - :'detected_accounts' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'entity_id', - :'website', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::FinancialInstitutionInsights` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::FinancialInstitutionInsights`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'entity_id') - self.entity_id = attributes[:'entity_id'] - end - - if attributes.key?(:'website') - self.website = attributes[:'website'] - end - - if attributes.key?(:'detected_accounts') - if (value = attributes[:'detected_accounts']).is_a?(Array) - self.detected_accounts = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @detected_accounts.nil? - invalid_properties.push('invalid value for "detected_accounts", detected_accounts cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @detected_accounts.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - entity_id == o.entity_id && - website == o.website && - detected_accounts == o.detected_accounts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, entity_id, website, detected_accounts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/form1099_type.rb b/lib/plaid/models/form1099_type.rb deleted file mode 100644 index 35dac570b..000000000 --- a/lib/plaid/models/form1099_type.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class Form1099Type - UNKNOWN = "FORM_1099_TYPE_UNKNOWN".freeze - MISC = "FORM_1099_TYPE_MISC".freeze - K = "FORM_1099_TYPE_K".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/fraud_amount.rb b/lib/plaid/models/fraud_amount.rb deleted file mode 100644 index 659ba2e39..000000000 --- a/lib/plaid/models/fraud_amount.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The amount and currency of the fraud or attempted fraud. `fraud_amount` should be omitted to indicate an unknown fraud amount. - class FraudAmount - attr_accessor :iso_currency_code - - # 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`). - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'iso_currency_code' => :'iso_currency_code', - :'value' => :'value' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'iso_currency_code' => :'ISOCurrencyCode', - :'value' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::FraudAmount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::FraudAmount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @iso_currency_code.nil? - return false if @value.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - iso_currency_code == o.iso_currency_code && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [iso_currency_code, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/generic_screening_hit_location_items.rb b/lib/plaid/models/generic_screening_hit_location_items.rb deleted file mode 100644 index c77156cda..000000000 --- a/lib/plaid/models/generic_screening_hit_location_items.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Analyzed location information for the associated hit - class GenericScreeningHitLocationItems - attr_accessor :analysis - - attr_accessor :data - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'analysis' => :'analysis', - :'data' => :'data' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'analysis' => :'MatchSummary', - :'data' => :'WatchlistScreeningHitLocations' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::GenericScreeningHitLocationItems` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::GenericScreeningHitLocationItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - analysis == o.analysis && - data == o.data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [analysis, data].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/health_incident.rb b/lib/plaid/models/health_incident.rb deleted file mode 100644 index cfd30c782..000000000 --- a/lib/plaid/models/health_incident.rb +++ /dev/null @@ -1,269 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A status health incident - class HealthIncident - # The start date of the incident, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format, e.g. `\"2020-10-30T15:26:48Z\"`. - attr_accessor :start_date - - # The end date of the incident, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format, e.g. `\"2020-10-30T15:26:48Z\"`. - attr_accessor :end_date - - # The title of the incident - attr_accessor :title - - # Updates on the health incident. - attr_accessor :incident_updates - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'title' => :'title', - :'incident_updates' => :'incident_updates' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_date' => :'Time', - :'end_date' => :'Time', - :'title' => :'String', - :'incident_updates' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'end_date', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::HealthIncident` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::HealthIncident`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'incident_updates') - if (value = attributes[:'incident_updates']).is_a?(Array) - self.incident_updates = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @start_date.nil? - invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') - end - - if @title.nil? - invalid_properties.push('invalid value for "title", title cannot be nil.') - end - - if @incident_updates.nil? - invalid_properties.push('invalid value for "incident_updates", incident_updates cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @start_date.nil? - return false if @title.nil? - return false if @incident_updates.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_date == o.start_date && - end_date == o.end_date && - title == o.title && - incident_updates == o.incident_updates - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_date, end_date, title, incident_updates].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/historical_balance.rb b/lib/plaid/models/historical_balance.rb deleted file mode 100644 index 94ddba018..000000000 --- a/lib/plaid/models/historical_balance.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing a balance held by an account in the past - class HistoricalBalance - # The date of the calculated historical balance, in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD) - attr_accessor :date - - # 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. - attr_accessor :current - - # The ISO-4217 currency code of the balance. Always `null` if `unofficial_currency_code` is non-`null`. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'date' => :'date', - :'current' => :'current', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'date' => :'Date', - :'current' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'iso_currency_code', - :'unofficial_currency_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::HistoricalBalance` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::HistoricalBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'current') - self.current = attributes[:'current'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @date.nil? - invalid_properties.push('invalid value for "date", date cannot be nil.') - end - - if @current.nil? - invalid_properties.push('invalid value for "current", current cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @date.nil? - return false if @current.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - date == o.date && - current == o.current && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [date, current, iso_currency_code, unofficial_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/historical_update_webhook.rb b/lib/plaid/models/historical_update_webhook.rb deleted file mode 100644 index c12c2da89..000000000 --- a/lib/plaid/models/historical_update_webhook.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. 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. - class HistoricalUpdateWebhook - # `TRANSACTIONS` - attr_accessor :webhook_type - - # `HISTORICAL_UPDATE` - attr_accessor :webhook_code - - attr_accessor :error - - # The number of new, unfetched transactions available - attr_accessor :new_transactions - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'error' => :'error', - :'new_transactions' => :'new_transactions', - :'item_id' => :'item_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'error' => :'PlaidError', - :'new_transactions' => :'Float', - :'item_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::HistoricalUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::HistoricalUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'new_transactions') - self.new_transactions = attributes[:'new_transactions'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @new_transactions.nil? - invalid_properties.push('invalid value for "new_transactions", new_transactions cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @new_transactions.nil? - return false if @item_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - error == o.error && - new_transactions == o.new_transactions && - item_id == o.item_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, error, new_transactions, item_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/holding.rb b/lib/plaid/models/holding.rb deleted file mode 100644 index 056ccf7c7..000000000 --- a/lib/plaid/models/holding.rb +++ /dev/null @@ -1,341 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A securities holding at an institution. - class Holding - # The Plaid `account_id` associated with the holding. - attr_accessor :account_id - - # The Plaid `security_id` associated with the holding. Security data is not specific to a user's account; any user who held the same security at the same financial institution at the same time would have identical security data. The `security_id` for the same security will typically be the same across different institutions, but this is not guaranteed. The `security_id` does not typically change, but 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. - attr_accessor :security_id - - # The last price given by the institution for this security. - attr_accessor :institution_price - - # The date at which `institution_price` was current. - attr_accessor :institution_price_as_of - - # Date and time at which `institution_price` was current, in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ). 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). - attr_accessor :institution_price_datetime - - # The value of the holding, as reported by the institution. - attr_accessor :institution_value - - # The total cost basis of the holding (e.g., the total amount spent to acquire all assets currently in the holding). - attr_accessor :cost_basis - - # The total quantity of the asset held, as reported by the financial institution. If the security is an option, `quantity` will reflect the total number of options (typically the number of contracts multiplied by 100), not the number of contracts. - attr_accessor :quantity - - # The ISO-4217 currency code of the holding. Always `null` if `unofficial_currency_code` is non-`null`. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'security_id' => :'security_id', - :'institution_price' => :'institution_price', - :'institution_price_as_of' => :'institution_price_as_of', - :'institution_price_datetime' => :'institution_price_datetime', - :'institution_value' => :'institution_value', - :'cost_basis' => :'cost_basis', - :'quantity' => :'quantity', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'security_id' => :'String', - :'institution_price' => :'Float', - :'institution_price_as_of' => :'Date', - :'institution_price_datetime' => :'Time', - :'institution_value' => :'Float', - :'cost_basis' => :'Float', - :'quantity' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'institution_price_as_of', - :'institution_price_datetime', - :'cost_basis', - :'iso_currency_code', - :'unofficial_currency_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Holding` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Holding`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'security_id') - self.security_id = attributes[:'security_id'] - end - - if attributes.key?(:'institution_price') - self.institution_price = attributes[:'institution_price'] - end - - if attributes.key?(:'institution_price_as_of') - self.institution_price_as_of = attributes[:'institution_price_as_of'] - end - - if attributes.key?(:'institution_price_datetime') - self.institution_price_datetime = attributes[:'institution_price_datetime'] - end - - if attributes.key?(:'institution_value') - self.institution_value = attributes[:'institution_value'] - end - - if attributes.key?(:'cost_basis') - self.cost_basis = attributes[:'cost_basis'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @security_id.nil? - invalid_properties.push('invalid value for "security_id", security_id cannot be nil.') - end - - if @institution_price.nil? - invalid_properties.push('invalid value for "institution_price", institution_price cannot be nil.') - end - - if @institution_value.nil? - invalid_properties.push('invalid value for "institution_value", institution_value cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @security_id.nil? - return false if @institution_price.nil? - return false if @institution_value.nil? - return false if @quantity.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - security_id == o.security_id && - institution_price == o.institution_price && - institution_price_as_of == o.institution_price_as_of && - institution_price_datetime == o.institution_price_datetime && - institution_value == o.institution_value && - cost_basis == o.cost_basis && - quantity == o.quantity && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, security_id, institution_price, institution_price_as_of, institution_price_datetime, institution_value, cost_basis, quantity, iso_currency_code, unofficial_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/holdings_default_update_webhook.rb b/lib/plaid/models/holdings_default_update_webhook.rb deleted file mode 100644 index 39a159398..000000000 --- a/lib/plaid/models/holdings_default_update_webhook.rb +++ /dev/null @@ -1,332 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class HoldingsDefaultUpdateWebhook - # `HOLDINGS` - attr_accessor :webhook_type - - # `DEFAULT_UPDATE` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :error - - # The number of new holdings reported since the last time this webhook was fired. - attr_accessor :new_holdings - - # The number of updated holdings reported since the last time this webhook was fired. - attr_accessor :updated_holdings - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'error' => :'error', - :'new_holdings' => :'new_holdings', - :'updated_holdings' => :'updated_holdings', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'error' => :'PlaidError', - :'new_holdings' => :'Float', - :'updated_holdings' => :'Float', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::HoldingsDefaultUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::HoldingsDefaultUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'new_holdings') - self.new_holdings = attributes[:'new_holdings'] - end - - if attributes.key?(:'updated_holdings') - self.updated_holdings = attributes[:'updated_holdings'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @new_holdings.nil? - invalid_properties.push('invalid value for "new_holdings", new_holdings cannot be nil.') - end - - if @updated_holdings.nil? - invalid_properties.push('invalid value for "updated_holdings", updated_holdings cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @new_holdings.nil? - return false if @updated_holdings.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - error == o.error && - new_holdings == o.new_holdings && - updated_holdings == o.updated_holdings && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, error, new_holdings, updated_holdings, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/holdings_override.rb b/lib/plaid/models/holdings_override.rb deleted file mode 100644 index 91a06f479..000000000 --- a/lib/plaid/models/holdings_override.rb +++ /dev/null @@ -1,312 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specify the holdings on the account. - class HoldingsOverride - # The last price given by the institution for this security - attr_accessor :institution_price - - # The date at which `institution_price` was current. Must be formatted as an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) date. - attr_accessor :institution_price_as_of - - # The total cost basis of the holding (e.g., the total amount spent to acquire all assets currently in the holding). - attr_accessor :cost_basis - - # The total quantity of the asset held, as reported by the financial institution. - attr_accessor :quantity - - # 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). - attr_accessor :vested_quantity - - # The value of the vested holdings as reported by the institution. - attr_accessor :vested_value - - # Either a valid `iso_currency_code` or `unofficial_currency_code` - attr_accessor :currency - - attr_accessor :security - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'institution_price' => :'institution_price', - :'institution_price_as_of' => :'institution_price_as_of', - :'cost_basis' => :'cost_basis', - :'quantity' => :'quantity', - :'vested_quantity' => :'vested_quantity', - :'vested_value' => :'vested_value', - :'currency' => :'currency', - :'security' => :'security' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'institution_price' => :'Float', - :'institution_price_as_of' => :'Date', - :'cost_basis' => :'Float', - :'quantity' => :'Float', - :'vested_quantity' => :'Float', - :'vested_value' => :'Float', - :'currency' => :'String', - :'security' => :'SecurityOverride' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'vested_quantity', - :'vested_value', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::HoldingsOverride` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::HoldingsOverride`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'institution_price') - self.institution_price = attributes[:'institution_price'] - end - - if attributes.key?(:'institution_price_as_of') - self.institution_price_as_of = attributes[:'institution_price_as_of'] - end - - if attributes.key?(:'cost_basis') - self.cost_basis = attributes[:'cost_basis'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'vested_quantity') - self.vested_quantity = attributes[:'vested_quantity'] - end - - if attributes.key?(:'vested_value') - self.vested_value = attributes[:'vested_value'] - end - - if attributes.key?(:'currency') - self.currency = attributes[:'currency'] - end - - if attributes.key?(:'security') - self.security = attributes[:'security'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @institution_price.nil? - invalid_properties.push('invalid value for "institution_price", institution_price cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - if @currency.nil? - invalid_properties.push('invalid value for "currency", currency cannot be nil.') - end - - if @security.nil? - invalid_properties.push('invalid value for "security", security cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @institution_price.nil? - return false if @quantity.nil? - return false if @currency.nil? - return false if @security.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - institution_price == o.institution_price && - institution_price_as_of == o.institution_price_as_of && - cost_basis == o.cost_basis && - quantity == o.quantity && - vested_quantity == o.vested_quantity && - vested_value == o.vested_value && - currency == o.currency && - security == o.security - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [institution_price, institution_price_as_of, cost_basis, quantity, vested_quantity, vested_value, currency, security].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/hosted_link_delivery_method.rb b/lib/plaid/models/hosted_link_delivery_method.rb deleted file mode 100644 index ff3887409..000000000 --- a/lib/plaid/models/hosted_link_delivery_method.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class HostedLinkDeliveryMethod - SMS = "sms".freeze - EMAIL = "email".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/hosted_mmd_verification_webhook.rb b/lib/plaid/models/hosted_mmd_verification_webhook.rb deleted file mode 100644 index 004a8a637..000000000 --- a/lib/plaid/models/hosted_mmd_verification_webhook.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Contains the state of a SMS same-day microdeposits verification session. - class HostedMMDVerificationWebhook - # `AUTH` - attr_accessor :webhook_type - - # `SMS_MICRODEPOSITS_VERIFICATION` - attr_accessor :webhook_code - - # The final status of the same-day microdeposits verification. Will always be `MANUALLY_VERIFIED` or `VERIFICATION_FAILED`. - attr_accessor :status - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - # The external account ID of the affected account - attr_accessor :account_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'status' => :'status', - :'item_id' => :'item_id', - :'account_id' => :'account_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'status' => :'String', - :'item_id' => :'String', - :'account_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::HostedMMDVerificationWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::HostedMMDVerificationWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @status.nil? - return false if @item_id.nil? - return false if @account_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - status == o.status && - item_id == o.item_id && - account_id == o.account_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, status, item_id, account_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/id_number_type.rb b/lib/plaid/models/id_number_type.rb deleted file mode 100644 index c2f0aa4e4..000000000 --- a/lib/plaid/models/id_number_type.rb +++ /dev/null @@ -1,72 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class IDNumberType - AR_DNI = "ar_dni".freeze - AU_DRIVERS_LICENSE = "au_drivers_license".freeze - AU_PASSPORT = "au_passport".freeze - BR_CPF = "br_cpf".freeze - CA_SIN = "ca_sin".freeze - CL_RUN = "cl_run".freeze - CN_RESIDENT_CARD = "cn_resident_card".freeze - CO_NIT = "co_nit".freeze - DK_CPR = "dk_cpr".freeze - EG_NATIONAL_ID = "eg_national_id".freeze - ES_DNI = "es_dni".freeze - ES_NIE = "es_nie".freeze - HK_HKID = "hk_hkid".freeze - IN_PAN = "in_pan".freeze - IT_CF = "it_cf".freeze - JO_CIVIL_ID = "jo_civil_id".freeze - JP_MY_NUMBER = "jp_my_number".freeze - KE_HUDUMA_NAMBA = "ke_huduma_namba".freeze - KW_CIVIL_ID = "kw_civil_id".freeze - MX_CURP = "mx_curp".freeze - MX_RFC = "mx_rfc".freeze - MY_NRIC = "my_nric".freeze - NG_NIN = "ng_nin".freeze - NZ_DRIVERS_LICENSE = "nz_drivers_license".freeze - OM_CIVIL_ID = "om_civil_id".freeze - PH_PSN = "ph_psn".freeze - PL_PESEL = "pl_pesel".freeze - RO_CNP = "ro_cnp".freeze - SA_NATIONAL_ID = "sa_national_id".freeze - SE_PIN = "se_pin".freeze - SG_NRIC = "sg_nric".freeze - TR_TC_KIMLIK = "tr_tc_kimlik".freeze - US_SSN = "us_ssn".freeze - US_SSN_LAST_4 = "us_ssn_last_4".freeze - ZA_SMART_ID = "za_smart_id".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/identity_default_update_webhook.rb b/lib/plaid/models/identity_default_update_webhook.rb deleted file mode 100644 index a8021c6f9..000000000 --- a/lib/plaid/models/identity_default_update_webhook.rb +++ /dev/null @@ -1,319 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class IdentityDefaultUpdateWebhook - # `IDENTITY` - attr_accessor :webhook_type - - # `DEFAULT_UPDATE` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - # An object with keys of `account_id`'s that are mapped to their respective identity attributes that changed. Example: `{ \"XMBvvyMGQ1UoLbKByoMqH3nXMj84ALSdE5B58\": [\"PHONES\"] }` - attr_accessor :account_ids_with_updated_identity - - attr_accessor :error - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'account_ids_with_updated_identity' => :'account_ids_with_updated_identity', - :'error' => :'error', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'account_ids_with_updated_identity' => :'Hash>', - :'error' => :'PlaidError', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityDefaultUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityDefaultUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'account_ids_with_updated_identity') - if (value = attributes[:'account_ids_with_updated_identity']).is_a?(Hash) - self.account_ids_with_updated_identity = value - end - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @account_ids_with_updated_identity.nil? - invalid_properties.push('invalid value for "account_ids_with_updated_identity", account_ids_with_updated_identity cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @account_ids_with_updated_identity.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - account_ids_with_updated_identity == o.account_ids_with_updated_identity && - error == o.error && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, account_ids_with_updated_identity, error, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_document.rb b/lib/plaid/models/identity_document.rb deleted file mode 100644 index e5f063b94..000000000 --- a/lib/plaid/models/identity_document.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Document object with metadata of the document uploaded - class IdentityDocument - attr_accessor :metadata - - attr_accessor :document_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'metadata' => :'metadata', - :'document_id' => :'document_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'metadata' => :'IdentityDocumentMetadata', - :'document_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityDocument` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityDocument`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'metadata') - self.metadata = attributes[:'metadata'] - end - - if attributes.key?(:'document_id') - self.document_id = attributes[:'document_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - metadata == o.metadata && - document_id == o.document_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [metadata, document_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_document_metadata.rb b/lib/plaid/models/identity_document_metadata.rb deleted file mode 100644 index 681a5245e..000000000 --- a/lib/plaid/models/identity_document_metadata.rb +++ /dev/null @@ -1,239 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # In closed beta. Object representing metadata pertaining to the document. - class IdentityDocumentMetadata - # Boolean field indicating if the uploaded document's account number matches the account number we have on file - attr_accessor :is_account_number_match - - attr_accessor :last_updated - - attr_accessor :uploaded_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'is_account_number_match' => :'is_account_number_match', - :'last_updated' => :'last_updated', - :'uploaded_at' => :'uploaded_at' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'is_account_number_match' => :'Boolean', - :'last_updated' => :'Time', - :'uploaded_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityDocumentMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityDocumentMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'is_account_number_match') - self.is_account_number_match = attributes[:'is_account_number_match'] - end - - if attributes.key?(:'last_updated') - self.last_updated = attributes[:'last_updated'] - end - - if attributes.key?(:'uploaded_at') - self.uploaded_at = attributes[:'uploaded_at'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - is_account_number_match == o.is_account_number_match && - last_updated == o.last_updated && - uploaded_at == o.uploaded_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [is_account_number_match, last_updated, uploaded_at].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_get_request.rb b/lib/plaid/models/identity_get_request.rb deleted file mode 100644 index d514da624..000000000 --- a/lib/plaid/models/identity_get_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # IdentityGetRequest defines the request schema for `/identity/get` - class IdentityGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'options' => :'IdentityGetRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_get_request_options.rb b/lib/plaid/models/identity_get_request_options.rb deleted file mode 100644 index 19573fe7d..000000000 --- a/lib/plaid/models/identity_get_request_options.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to filter `/identity/get` results. - class IdentityGetRequestOptions - # 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. - attr_accessor :account_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_ids' => :'account_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_ids') - if (value = attributes[:'account_ids']).is_a?(Array) - self.account_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_ids == o.account_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_get_response.rb b/lib/plaid/models/identity_get_response.rb deleted file mode 100644 index 6c131b295..000000000 --- a/lib/plaid/models/identity_get_response.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # IdentityGetResponse defines the response schema for `/identity/get` - class IdentityGetResponse - # The accounts for which Identity data has been requested - attr_accessor :accounts - - attr_accessor :item - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'accounts' => :'accounts', - :'item' => :'item', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'accounts' => :'Array', - :'item' => :'Item', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - - if attributes.key?(:'item') - self.item = attributes[:'item'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @accounts.nil? - invalid_properties.push('invalid value for "accounts", accounts cannot be nil.') - end - - if @item.nil? - invalid_properties.push('invalid value for "item", item cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @accounts.nil? - return false if @item.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - accounts == o.accounts && - item == o.item && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [accounts, item, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_match_request.rb b/lib/plaid/models/identity_match_request.rb deleted file mode 100644 index 405b54dbe..000000000 --- a/lib/plaid/models/identity_match_request.rb +++ /dev/null @@ -1,264 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # IdentityMatchRequest defines the request schema for `/identity/match` - class IdentityMatchRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - attr_accessor :user - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'user' => :'user', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'user' => :'IdentityMatchUser', - :'options' => :'IdentityMatchRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityMatchRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityMatchRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - user == o.user && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, user, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_match_request_options.rb b/lib/plaid/models/identity_match_request_options.rb deleted file mode 100644 index 1cbe5d726..000000000 --- a/lib/plaid/models/identity_match_request_options.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to filter /identity/match results - class IdentityMatchRequestOptions - # An array of `account_ids` to perform fuzzy match - attr_accessor :account_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_ids' => :'account_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityMatchRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityMatchRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_ids') - if (value = attributes[:'account_ids']).is_a?(Array) - self.account_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_ids == o.account_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_match_response.rb b/lib/plaid/models/identity_match_response.rb deleted file mode 100644 index e13893893..000000000 --- a/lib/plaid/models/identity_match_response.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # IdentityMatchResponse defines the response schema for `/identity/match` - class IdentityMatchResponse - # The accounts for which Identity match has been requested - attr_accessor :accounts - - attr_accessor :item - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'accounts' => :'accounts', - :'item' => :'item', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'accounts' => :'Array', - :'item' => :'Item', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityMatchResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityMatchResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - - if attributes.key?(:'item') - self.item = attributes[:'item'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @accounts.nil? - invalid_properties.push('invalid value for "accounts", accounts cannot be nil.') - end - - if @item.nil? - invalid_properties.push('invalid value for "item", item cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @accounts.nil? - return false if @item.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - accounts == o.accounts && - item == o.item && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [accounts, item, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_match_user.rb b/lib/plaid/models/identity_match_user.rb deleted file mode 100644 index 5f20db41e..000000000 --- a/lib/plaid/models/identity_match_user.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The user's legal name, phone number, email address and address used to perform fuzzy match. If Financial Account Matching is enabled in the Identity Verification product, leave this field empty to automatically match against PII collected from the Identity Verification checks. - class IdentityMatchUser - # The user's full legal name. - attr_accessor :legal_name - - # 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. - attr_accessor :phone_number - - # The user's email address. - attr_accessor :email_address - - attr_accessor :address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'legal_name' => :'legal_name', - :'phone_number' => :'phone_number', - :'email_address' => :'email_address', - :'address' => :'address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'legal_name' => :'String', - :'phone_number' => :'String', - :'email_address' => :'String', - :'address' => :'AddressDataNullableNoRequiredFields' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'legal_name', - :'phone_number', - :'email_address', - :'address' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityMatchUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityMatchUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - legal_name == o.legal_name && - phone_number == o.phone_number && - email_address == o.email_address && - address == o.address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [legal_name, phone_number, email_address, address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_refresh_request.rb b/lib/plaid/models/identity_refresh_request.rb deleted file mode 100644 index b5228821d..000000000 --- a/lib/plaid/models/identity_refresh_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # IdentityRefreshRequest defines the request schema for `/identity/refresh` - class IdentityRefreshRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'access_token' => :'access_token', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'access_token' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityRefreshRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityRefreshRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - access_token == o.access_token && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, access_token, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_refresh_response.rb b/lib/plaid/models/identity_refresh_response.rb deleted file mode 100644 index e786c0dcd..000000000 --- a/lib/plaid/models/identity_refresh_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # IdentityRefreshResponse defines the response schema for `/identity/refresh` - class IdentityRefreshResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityRefreshResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityRefreshResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_update_types.rb b/lib/plaid/models/identity_update_types.rb deleted file mode 100644 index 146d2cafd..000000000 --- a/lib/plaid/models/identity_update_types.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class IdentityUpdateTypes - PHONES = "PHONES".freeze - ADDRESSES = "ADDRESSES".freeze - EMAILS = "EMAILS".freeze - NAMES = "NAMES".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/identity_verification.rb b/lib/plaid/models/identity_verification.rb deleted file mode 100644 index c544f39dd..000000000 --- a/lib/plaid/models/identity_verification.rb +++ /dev/null @@ -1,450 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class IdentityVerification - # ID of the associated Identity Verification attempt. - attr_accessor :id - - # 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`. - attr_accessor :client_user_id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - # An ISO8601 formatted timestamp. - attr_accessor :completed_at - - # 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. - attr_accessor :previous_attempt_id - - # A shareable URL that can be sent directly to the user to complete verification - attr_accessor :shareable_url - - attr_accessor :template - - attr_accessor :user - - attr_accessor :status - - attr_accessor :steps - - attr_accessor :documentary_verification - - attr_accessor :selfie_check - - attr_accessor :kyc_check - - attr_accessor :risk_check - - # ID of the associated screening. - attr_accessor :watchlist_screening_id - - # An ISO8601 formatted timestamp. - attr_accessor :redacted_at - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'client_user_id' => :'client_user_id', - :'created_at' => :'created_at', - :'completed_at' => :'completed_at', - :'previous_attempt_id' => :'previous_attempt_id', - :'shareable_url' => :'shareable_url', - :'template' => :'template', - :'user' => :'user', - :'status' => :'status', - :'steps' => :'steps', - :'documentary_verification' => :'documentary_verification', - :'selfie_check' => :'selfie_check', - :'kyc_check' => :'kyc_check', - :'risk_check' => :'risk_check', - :'watchlist_screening_id' => :'watchlist_screening_id', - :'redacted_at' => :'redacted_at' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'client_user_id' => :'String', - :'created_at' => :'Time', - :'completed_at' => :'Time', - :'previous_attempt_id' => :'String', - :'shareable_url' => :'String', - :'template' => :'IdentityVerificationTemplateReference', - :'user' => :'IdentityVerificationUserData', - :'status' => :'IdentityVerificationStatus', - :'steps' => :'IdentityVerificationStepSummary', - :'documentary_verification' => :'DocumentaryVerification', - :'selfie_check' => :'SelfieCheck', - :'kyc_check' => :'KYCCheckDetails', - :'risk_check' => :'RiskCheckDetails', - :'watchlist_screening_id' => :'String', - :'redacted_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'completed_at', - :'previous_attempt_id', - :'shareable_url', - :'documentary_verification', - :'selfie_check', - :'kyc_check', - :'risk_check', - :'watchlist_screening_id', - :'redacted_at' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'completed_at') - self.completed_at = attributes[:'completed_at'] - end - - if attributes.key?(:'previous_attempt_id') - self.previous_attempt_id = attributes[:'previous_attempt_id'] - end - - if attributes.key?(:'shareable_url') - self.shareable_url = attributes[:'shareable_url'] - end - - if attributes.key?(:'template') - self.template = attributes[:'template'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'steps') - self.steps = attributes[:'steps'] - end - - if attributes.key?(:'documentary_verification') - self.documentary_verification = attributes[:'documentary_verification'] - end - - if attributes.key?(:'selfie_check') - self.selfie_check = attributes[:'selfie_check'] - end - - if attributes.key?(:'kyc_check') - self.kyc_check = attributes[:'kyc_check'] - end - - if attributes.key?(:'risk_check') - self.risk_check = attributes[:'risk_check'] - end - - if attributes.key?(:'watchlist_screening_id') - self.watchlist_screening_id = attributes[:'watchlist_screening_id'] - end - - if attributes.key?(:'redacted_at') - self.redacted_at = attributes[:'redacted_at'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @client_user_id.nil? - invalid_properties.push('invalid value for "client_user_id", client_user_id cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @template.nil? - invalid_properties.push('invalid value for "template", template cannot be nil.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @steps.nil? - invalid_properties.push('invalid value for "steps", steps cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @client_user_id.nil? - return false if @client_user_id.to_s.length < 1 - return false if @created_at.nil? - return false if @template.nil? - return false if @user.nil? - return false if @status.nil? - return false if @steps.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.nil? - fail ArgumentError, 'client_user_id cannot be nil' - end - - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - client_user_id == o.client_user_id && - created_at == o.created_at && - completed_at == o.completed_at && - previous_attempt_id == o.previous_attempt_id && - shareable_url == o.shareable_url && - template == o.template && - user == o.user && - status == o.status && - steps == o.steps && - documentary_verification == o.documentary_verification && - selfie_check == o.selfie_check && - kyc_check == o.kyc_check && - risk_check == o.risk_check && - watchlist_screening_id == o.watchlist_screening_id && - redacted_at == o.redacted_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, client_user_id, created_at, completed_at, previous_attempt_id, shareable_url, template, user, status, steps, documentary_verification, selfie_check, kyc_check, risk_check, watchlist_screening_id, redacted_at].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_autofill_address.rb b/lib/plaid/models/identity_verification_autofill_address.rb deleted file mode 100644 index fe2da9e11..000000000 --- a/lib/plaid/models/identity_verification_autofill_address.rb +++ /dev/null @@ -1,356 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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 - class IdentityVerificationAutofillAddress - # The primary street portion of an address. If an address is provided, this field will always be filled. - attr_accessor :street - - # Extra street information, like an apartment or suite number. - attr_accessor :street2 - - # City from the end user's address - attr_accessor :city - - # An ISO 3166-2 subdivision code. Related terms would be \"state\", \"province\", \"prefecture\", \"zone\", \"subdivision\", etc. - attr_accessor :region - - # The postal code for the associated address. Between 2 and 10 alphanumeric characters. For US-based addresses this must be 5 numeric digits. - attr_accessor :postal_code - - # Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :country - - attr_accessor :po_box - - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'street' => :'street', - :'street2' => :'street2', - :'city' => :'city', - :'region' => :'region', - :'postal_code' => :'postal_code', - :'country' => :'country', - :'po_box' => :'po_box', - :'type' => :'type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'street' => :'String', - :'street2' => :'String', - :'city' => :'String', - :'region' => :'String', - :'postal_code' => :'String', - :'country' => :'String', - :'po_box' => :'POBoxStatus', - :'type' => :'AddressPurposeLabel' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'street2', - :'city', - :'region', - :'postal_code', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationAutofillAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationAutofillAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'street2') - self.street2 = attributes[:'street2'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - - if attributes.key?(:'po_box') - self.po_box = attributes[:'po_box'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @street.nil? - invalid_properties.push('invalid value for "street", street cannot be nil.') - end - - if @country.nil? - invalid_properties.push('invalid value for "country", country cannot be nil.') - end - - if @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - if @po_box.nil? - invalid_properties.push('invalid value for "po_box", po_box cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @street.nil? - return false if @country.nil? - return false if @country.to_s.length < 2 - return false if @po_box.nil? - return false if @type.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if country.nil? - fail ArgumentError, 'country cannot be nil' - end - - if country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - street == o.street && - street2 == o.street2 && - city == o.city && - region == o.region && - postal_code == o.postal_code && - country == o.country && - po_box == o.po_box && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [street, street2, city, region, postal_code, country, po_box, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_autofill_create_request.rb b/lib/plaid/models/identity_verification_autofill_create_request.rb deleted file mode 100644 index 2d1d5763b..000000000 --- a/lib/plaid/models/identity_verification_autofill_create_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input to autofill an Identity Verification - class IdentityVerificationAutofillCreateRequest - # ID of the associated Identity Verification attempt. - attr_accessor :identity_verification_id - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'identity_verification_id' => :'identity_verification_id', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'identity_verification_id' => :'String', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationAutofillCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationAutofillCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'identity_verification_id') - self.identity_verification_id = attributes[:'identity_verification_id'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @identity_verification_id.nil? - invalid_properties.push('invalid value for "identity_verification_id", identity_verification_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @identity_verification_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - identity_verification_id == o.identity_verification_id && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [identity_verification_id, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_autofill_create_response.rb b/lib/plaid/models/identity_verification_autofill_create_response.rb deleted file mode 100644 index e4498ab16..000000000 --- a/lib/plaid/models/identity_verification_autofill_create_response.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Autofill represents unverified customer information. This needs to be confirmed by the customer before using. - class IdentityVerificationAutofillCreateResponse - attr_accessor :status - - attr_accessor :user - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'user' => :'user', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'IdentityVerificationAutofillStatus', - :'user' => :'IdentityVerificationAutofillUserData', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'user', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationAutofillCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationAutofillCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @status.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - user == o.user && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, user, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_autofill_status.rb b/lib/plaid/models/identity_verification_autofill_status.rb deleted file mode 100644 index da2507320..000000000 --- a/lib/plaid/models/identity_verification_autofill_status.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class IdentityVerificationAutofillStatus - SUCCESS = "success".freeze - FAILED = "failed".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/identity_verification_autofill_user_data.rb b/lib/plaid/models/identity_verification_autofill_user_data.rb deleted file mode 100644 index 138936f0f..000000000 --- a/lib/plaid/models/identity_verification_autofill_user_data.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # User information that was autofilled. All this information should be confirmed by the user before using. - class IdentityVerificationAutofillUserData - attr_accessor :name - - attr_accessor :address - - attr_accessor :id_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'address' => :'address', - :'id_number' => :'id_number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'IdentityVerificationResponseUserName', - :'address' => :'IdentityVerificationAutofillAddress', - :'id_number' => :'UserIDNumber' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'address', - :'id_number' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationAutofillUserData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationAutofillUserData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'id_number') - self.id_number = attributes[:'id_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address == o.address && - id_number == o.id_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address, id_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_create_request.rb b/lib/plaid/models/identity_verification_create_request.rb deleted file mode 100644 index 1005c8110..000000000 --- a/lib/plaid/models/identity_verification_create_request.rb +++ /dev/null @@ -1,326 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request schema for '/identity_verification/create' - class IdentityVerificationCreateRequest - # 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`. - attr_accessor :client_user_id - - # A flag specifying whether you would like Plaid to expose a shareable URL for the verification being created. - attr_accessor :is_shareable - - # ID of the associated Identity Verification template. - attr_accessor :template_id - - # A flag specifying whether the end user has already agreed to a privacy policy specifying that their data will be shared with Plaid for verification purposes. If `gave_consent` is set to `true`, the `accept_tos` step will be marked as `skipped` and the end user's session will start at the next step requirement. - attr_accessor :gave_consent - - attr_accessor :user - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # An optional flag specifying how you would like Plaid to handle attempts to create an Identity Verification when an Identity Verification already exists for the provided `client_user_id` and `template_id`. If idempotency is enabled, Plaid will return the existing Identity Verification. If idempotency is disabled, Plaid will reject the request with a `400 Bad Request` status code if an Identity Verification already exists for the supplied `client_user_id` and `template_id`. - attr_accessor :is_idempotent - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_user_id' => :'client_user_id', - :'is_shareable' => :'is_shareable', - :'template_id' => :'template_id', - :'gave_consent' => :'gave_consent', - :'user' => :'user', - :'client_id' => :'client_id', - :'secret' => :'secret', - :'is_idempotent' => :'is_idempotent' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_user_id' => :'String', - :'is_shareable' => :'Boolean', - :'template_id' => :'String', - :'gave_consent' => :'Boolean', - :'user' => :'IdentityVerificationCreateRequestUser', - :'client_id' => :'String', - :'secret' => :'String', - :'is_idempotent' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'user', - :'is_idempotent' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'is_shareable') - self.is_shareable = attributes[:'is_shareable'] - end - - if attributes.key?(:'template_id') - self.template_id = attributes[:'template_id'] - end - - if attributes.key?(:'gave_consent') - self.gave_consent = attributes[:'gave_consent'] - else - self.gave_consent = false - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'is_idempotent') - self.is_idempotent = attributes[:'is_idempotent'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @is_shareable.nil? - invalid_properties.push('invalid value for "is_shareable", is_shareable cannot be nil.') - end - - if @template_id.nil? - invalid_properties.push('invalid value for "template_id", template_id cannot be nil.') - end - - if @gave_consent.nil? - invalid_properties.push('invalid value for "gave_consent", gave_consent cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - return false if @is_shareable.nil? - return false if @template_id.nil? - return false if @gave_consent.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if !client_user_id.nil? && client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_user_id == o.client_user_id && - is_shareable == o.is_shareable && - template_id == o.template_id && - gave_consent == o.gave_consent && - user == o.user && - client_id == o.client_id && - secret == o.secret && - is_idempotent == o.is_idempotent - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_user_id, is_shareable, template_id, gave_consent, user, client_id, secret, is_idempotent].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_create_request_user.rb b/lib/plaid/models/identity_verification_create_request_user.rb deleted file mode 100644 index db6451585..000000000 --- a/lib/plaid/models/identity_verification_create_request_user.rb +++ /dev/null @@ -1,300 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # User information collected outside of Link, most likely via your own onboarding process. Each of the following identity fields are optional: `email_address` `phone_number` `date_of_birth` `name` `address` `id_number` 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. - class IdentityVerificationCreateRequestUser - # A valid email address. - attr_accessor :email_address - - # A phone number in E.164 format. - attr_accessor :phone_number - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :date_of_birth - - attr_accessor :name - - attr_accessor :address - - attr_accessor :id_number - - # Specifying `user.client_user_id` is deprecated. Please provide `client_user_id` at the root level instead. - attr_accessor :client_user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'email_address' => :'email_address', - :'phone_number' => :'phone_number', - :'date_of_birth' => :'date_of_birth', - :'name' => :'name', - :'address' => :'address', - :'id_number' => :'id_number', - :'client_user_id' => :'client_user_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'email_address' => :'String', - :'phone_number' => :'String', - :'date_of_birth' => :'Date', - :'name' => :'IdentityVerificationRequestUserName', - :'address' => :'UserAddress', - :'id_number' => :'UserIDNumber', - :'client_user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'phone_number', - :'name', - :'address', - :'id_number', - :'client_user_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationCreateRequestUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationCreateRequestUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'id_number') - self.id_number = attributes[:'id_number'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if !client_user_id.nil? && client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - email_address == o.email_address && - phone_number == o.phone_number && - date_of_birth == o.date_of_birth && - name == o.name && - address == o.address && - id_number == o.id_number && - client_user_id == o.client_user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [email_address, phone_number, date_of_birth, name, address, id_number, client_user_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_create_response.rb b/lib/plaid/models/identity_verification_create_response.rb deleted file mode 100644 index e005eefff..000000000 --- a/lib/plaid/models/identity_verification_create_response.rb +++ /dev/null @@ -1,465 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class IdentityVerificationCreateResponse - # ID of the associated Identity Verification attempt. - attr_accessor :id - - # 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`. - attr_accessor :client_user_id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - # An ISO8601 formatted timestamp. - attr_accessor :completed_at - - # 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. - attr_accessor :previous_attempt_id - - # A shareable URL that can be sent directly to the user to complete verification - attr_accessor :shareable_url - - attr_accessor :template - - attr_accessor :user - - attr_accessor :status - - attr_accessor :steps - - attr_accessor :documentary_verification - - attr_accessor :selfie_check - - attr_accessor :kyc_check - - attr_accessor :risk_check - - # ID of the associated screening. - attr_accessor :watchlist_screening_id - - # An ISO8601 formatted timestamp. - attr_accessor :redacted_at - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'client_user_id' => :'client_user_id', - :'created_at' => :'created_at', - :'completed_at' => :'completed_at', - :'previous_attempt_id' => :'previous_attempt_id', - :'shareable_url' => :'shareable_url', - :'template' => :'template', - :'user' => :'user', - :'status' => :'status', - :'steps' => :'steps', - :'documentary_verification' => :'documentary_verification', - :'selfie_check' => :'selfie_check', - :'kyc_check' => :'kyc_check', - :'risk_check' => :'risk_check', - :'watchlist_screening_id' => :'watchlist_screening_id', - :'redacted_at' => :'redacted_at', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'client_user_id' => :'String', - :'created_at' => :'Time', - :'completed_at' => :'Time', - :'previous_attempt_id' => :'String', - :'shareable_url' => :'String', - :'template' => :'IdentityVerificationTemplateReference', - :'user' => :'IdentityVerificationUserData', - :'status' => :'IdentityVerificationStatus', - :'steps' => :'IdentityVerificationStepSummary', - :'documentary_verification' => :'DocumentaryVerification', - :'selfie_check' => :'SelfieCheck', - :'kyc_check' => :'KYCCheckDetails', - :'risk_check' => :'RiskCheckDetails', - :'watchlist_screening_id' => :'String', - :'redacted_at' => :'Time', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'completed_at', - :'previous_attempt_id', - :'shareable_url', - :'documentary_verification', - :'selfie_check', - :'kyc_check', - :'risk_check', - :'watchlist_screening_id', - :'redacted_at', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'completed_at') - self.completed_at = attributes[:'completed_at'] - end - - if attributes.key?(:'previous_attempt_id') - self.previous_attempt_id = attributes[:'previous_attempt_id'] - end - - if attributes.key?(:'shareable_url') - self.shareable_url = attributes[:'shareable_url'] - end - - if attributes.key?(:'template') - self.template = attributes[:'template'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'steps') - self.steps = attributes[:'steps'] - end - - if attributes.key?(:'documentary_verification') - self.documentary_verification = attributes[:'documentary_verification'] - end - - if attributes.key?(:'selfie_check') - self.selfie_check = attributes[:'selfie_check'] - end - - if attributes.key?(:'kyc_check') - self.kyc_check = attributes[:'kyc_check'] - end - - if attributes.key?(:'risk_check') - self.risk_check = attributes[:'risk_check'] - end - - if attributes.key?(:'watchlist_screening_id') - self.watchlist_screening_id = attributes[:'watchlist_screening_id'] - end - - if attributes.key?(:'redacted_at') - self.redacted_at = attributes[:'redacted_at'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @client_user_id.nil? - invalid_properties.push('invalid value for "client_user_id", client_user_id cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @template.nil? - invalid_properties.push('invalid value for "template", template cannot be nil.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @steps.nil? - invalid_properties.push('invalid value for "steps", steps cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @client_user_id.nil? - return false if @client_user_id.to_s.length < 1 - return false if @created_at.nil? - return false if @template.nil? - return false if @user.nil? - return false if @status.nil? - return false if @steps.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.nil? - fail ArgumentError, 'client_user_id cannot be nil' - end - - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - client_user_id == o.client_user_id && - created_at == o.created_at && - completed_at == o.completed_at && - previous_attempt_id == o.previous_attempt_id && - shareable_url == o.shareable_url && - template == o.template && - user == o.user && - status == o.status && - steps == o.steps && - documentary_verification == o.documentary_verification && - selfie_check == o.selfie_check && - kyc_check == o.kyc_check && - risk_check == o.risk_check && - watchlist_screening_id == o.watchlist_screening_id && - redacted_at == o.redacted_at && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, client_user_id, created_at, completed_at, previous_attempt_id, shareable_url, template, user, status, steps, documentary_verification, selfie_check, kyc_check, risk_check, watchlist_screening_id, redacted_at, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_document_address_response.rb b/lib/plaid/models/identity_verification_document_address_response.rb deleted file mode 100644 index e2a600656..000000000 --- a/lib/plaid/models/identity_verification_document_address_response.rb +++ /dev/null @@ -1,299 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. `region`, and `postal_code` may be null based on the addressing system. For example: Addresses from the United Kingdom will not include a region Addresses from Hong Kong will not include postal code Note: Optical Character Recognition (OCR) technology may sometimes extract incorrect data from a document. - class IdentityVerificationDocumentAddressResponse - # The full street address extracted from the document. - attr_accessor :street - - # City extracted from the document. - attr_accessor :city - - # An ISO 3166-2 subdivision code extracted from the document. Related terms would be \"state\", \"province\", \"prefecture\", \"zone\", \"subdivision\", etc. - attr_accessor :region - - # The postal code extracted from the document. Between 2 and 10 alphanumeric characters. For US-based addresses this must be 5 numeric digits. - attr_accessor :postal_code - - # Valid, capitalized, two-letter ISO code representing the country extracted from the document. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'street' => :'street', - :'city' => :'city', - :'region' => :'region', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'street' => :'String', - :'city' => :'String', - :'region' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'region', - :'postal_code', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationDocumentAddressResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationDocumentAddressResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @street.nil? - invalid_properties.push('invalid value for "street", street cannot be nil.') - end - - if @city.nil? - invalid_properties.push('invalid value for "city", city cannot be nil.') - end - - if @country.nil? - invalid_properties.push('invalid value for "country", country cannot be nil.') - end - - if @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @street.nil? - return false if @city.nil? - return false if @country.nil? - return false if @country.to_s.length < 2 - true - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if country.nil? - fail ArgumentError, 'country cannot be nil' - end - - if country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - street == o.street && - city == o.city && - region == o.region && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [street, city, region, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_get_request.rb b/lib/plaid/models/identity_verification_get_request.rb deleted file mode 100644 index b1a2ab410..000000000 --- a/lib/plaid/models/identity_verification_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for fetching an Identity Verification - class IdentityVerificationGetRequest - # ID of the associated Identity Verification attempt. - attr_accessor :identity_verification_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'identity_verification_id' => :'identity_verification_id', - :'secret' => :'secret', - :'client_id' => :'client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'identity_verification_id' => :'String', - :'secret' => :'String', - :'client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'identity_verification_id') - self.identity_verification_id = attributes[:'identity_verification_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @identity_verification_id.nil? - invalid_properties.push('invalid value for "identity_verification_id", identity_verification_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @identity_verification_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - identity_verification_id == o.identity_verification_id && - secret == o.secret && - client_id == o.client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [identity_verification_id, secret, client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_get_response.rb b/lib/plaid/models/identity_verification_get_response.rb deleted file mode 100644 index fc36e622f..000000000 --- a/lib/plaid/models/identity_verification_get_response.rb +++ /dev/null @@ -1,465 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class IdentityVerificationGetResponse - # ID of the associated Identity Verification attempt. - attr_accessor :id - - # 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`. - attr_accessor :client_user_id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - # An ISO8601 formatted timestamp. - attr_accessor :completed_at - - # 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. - attr_accessor :previous_attempt_id - - # A shareable URL that can be sent directly to the user to complete verification - attr_accessor :shareable_url - - attr_accessor :template - - attr_accessor :user - - attr_accessor :status - - attr_accessor :steps - - attr_accessor :documentary_verification - - attr_accessor :selfie_check - - attr_accessor :kyc_check - - attr_accessor :risk_check - - # ID of the associated screening. - attr_accessor :watchlist_screening_id - - # An ISO8601 formatted timestamp. - attr_accessor :redacted_at - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'client_user_id' => :'client_user_id', - :'created_at' => :'created_at', - :'completed_at' => :'completed_at', - :'previous_attempt_id' => :'previous_attempt_id', - :'shareable_url' => :'shareable_url', - :'template' => :'template', - :'user' => :'user', - :'status' => :'status', - :'steps' => :'steps', - :'documentary_verification' => :'documentary_verification', - :'selfie_check' => :'selfie_check', - :'kyc_check' => :'kyc_check', - :'risk_check' => :'risk_check', - :'watchlist_screening_id' => :'watchlist_screening_id', - :'redacted_at' => :'redacted_at', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'client_user_id' => :'String', - :'created_at' => :'Time', - :'completed_at' => :'Time', - :'previous_attempt_id' => :'String', - :'shareable_url' => :'String', - :'template' => :'IdentityVerificationTemplateReference', - :'user' => :'IdentityVerificationUserData', - :'status' => :'IdentityVerificationStatus', - :'steps' => :'IdentityVerificationStepSummary', - :'documentary_verification' => :'DocumentaryVerification', - :'selfie_check' => :'SelfieCheck', - :'kyc_check' => :'KYCCheckDetails', - :'risk_check' => :'RiskCheckDetails', - :'watchlist_screening_id' => :'String', - :'redacted_at' => :'Time', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'completed_at', - :'previous_attempt_id', - :'shareable_url', - :'documentary_verification', - :'selfie_check', - :'kyc_check', - :'risk_check', - :'watchlist_screening_id', - :'redacted_at', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'completed_at') - self.completed_at = attributes[:'completed_at'] - end - - if attributes.key?(:'previous_attempt_id') - self.previous_attempt_id = attributes[:'previous_attempt_id'] - end - - if attributes.key?(:'shareable_url') - self.shareable_url = attributes[:'shareable_url'] - end - - if attributes.key?(:'template') - self.template = attributes[:'template'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'steps') - self.steps = attributes[:'steps'] - end - - if attributes.key?(:'documentary_verification') - self.documentary_verification = attributes[:'documentary_verification'] - end - - if attributes.key?(:'selfie_check') - self.selfie_check = attributes[:'selfie_check'] - end - - if attributes.key?(:'kyc_check') - self.kyc_check = attributes[:'kyc_check'] - end - - if attributes.key?(:'risk_check') - self.risk_check = attributes[:'risk_check'] - end - - if attributes.key?(:'watchlist_screening_id') - self.watchlist_screening_id = attributes[:'watchlist_screening_id'] - end - - if attributes.key?(:'redacted_at') - self.redacted_at = attributes[:'redacted_at'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @client_user_id.nil? - invalid_properties.push('invalid value for "client_user_id", client_user_id cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @template.nil? - invalid_properties.push('invalid value for "template", template cannot be nil.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @steps.nil? - invalid_properties.push('invalid value for "steps", steps cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @client_user_id.nil? - return false if @client_user_id.to_s.length < 1 - return false if @created_at.nil? - return false if @template.nil? - return false if @user.nil? - return false if @status.nil? - return false if @steps.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.nil? - fail ArgumentError, 'client_user_id cannot be nil' - end - - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - client_user_id == o.client_user_id && - created_at == o.created_at && - completed_at == o.completed_at && - previous_attempt_id == o.previous_attempt_id && - shareable_url == o.shareable_url && - template == o.template && - user == o.user && - status == o.status && - steps == o.steps && - documentary_verification == o.documentary_verification && - selfie_check == o.selfie_check && - kyc_check == o.kyc_check && - risk_check == o.risk_check && - watchlist_screening_id == o.watchlist_screening_id && - redacted_at == o.redacted_at && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, client_user_id, created_at, completed_at, previous_attempt_id, shareable_url, template, user, status, steps, documentary_verification, selfie_check, kyc_check, risk_check, watchlist_screening_id, redacted_at, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_list_request.rb b/lib/plaid/models/identity_verification_list_request.rb deleted file mode 100644 index 4f9b88b14..000000000 --- a/lib/plaid/models/identity_verification_list_request.rb +++ /dev/null @@ -1,293 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for listing Identity Verifications - class IdentityVerificationListRequest - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # ID of the associated Identity Verification template. - attr_accessor :template_id - - # 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`. - attr_accessor :client_user_id - - # An identifier that determines which page of results you receive. - attr_accessor :cursor - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'secret' => :'secret', - :'client_id' => :'client_id', - :'template_id' => :'template_id', - :'client_user_id' => :'client_user_id', - :'cursor' => :'cursor' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'secret' => :'String', - :'client_id' => :'String', - :'template_id' => :'String', - :'client_user_id' => :'String', - :'cursor' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'cursor' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'template_id') - self.template_id = attributes[:'template_id'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @template_id.nil? - invalid_properties.push('invalid value for "template_id", template_id cannot be nil.') - end - - if @client_user_id.nil? - invalid_properties.push('invalid value for "client_user_id", client_user_id cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @template_id.nil? - return false if @client_user_id.nil? - return false if @client_user_id.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.nil? - fail ArgumentError, 'client_user_id cannot be nil' - end - - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - secret == o.secret && - client_id == o.client_id && - template_id == o.template_id && - client_user_id == o.client_user_id && - cursor == o.cursor - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [secret, client_id, template_id, client_user_id, cursor].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_list_response.rb b/lib/plaid/models/identity_verification_list_response.rb deleted file mode 100644 index d9a95b5a5..000000000 --- a/lib/plaid/models/identity_verification_list_response.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Paginated list of Plaid sessions. - class IdentityVerificationListResponse - # List of Plaid sessions - attr_accessor :identity_verifications - - # An identifier that determines which page of results you receive. - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'identity_verifications' => :'identity_verifications', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'identity_verifications' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'identity_verifications') - if (value = attributes[:'identity_verifications']).is_a?(Array) - self.identity_verifications = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @identity_verifications.nil? - invalid_properties.push('invalid value for "identity_verifications", identity_verifications cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @identity_verifications.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - identity_verifications == o.identity_verifications && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [identity_verifications, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_request_user.rb b/lib/plaid/models/identity_verification_request_user.rb deleted file mode 100644 index 0758b6d27..000000000 --- a/lib/plaid/models/identity_verification_request_user.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # User information collected outside of Link, most likely via your own onboarding process. Each of the following identity fields are optional: `email_address` `phone_number` `date_of_birth` `name` `address` `id_number` 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. - class IdentityVerificationRequestUser - # A valid email address. - attr_accessor :email_address - - # A phone number in E.164 format. - attr_accessor :phone_number - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :date_of_birth - - attr_accessor :name - - attr_accessor :address - - attr_accessor :id_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'email_address' => :'email_address', - :'phone_number' => :'phone_number', - :'date_of_birth' => :'date_of_birth', - :'name' => :'name', - :'address' => :'address', - :'id_number' => :'id_number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'email_address' => :'String', - :'phone_number' => :'String', - :'date_of_birth' => :'Date', - :'name' => :'IdentityVerificationRequestUserName', - :'address' => :'UserAddress', - :'id_number' => :'UserIDNumber' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'phone_number', - :'name', - :'address', - :'id_number' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationRequestUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationRequestUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'id_number') - self.id_number = attributes[:'id_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - email_address == o.email_address && - phone_number == o.phone_number && - date_of_birth == o.date_of_birth && - name == o.name && - address == o.address && - id_number == o.id_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [email_address, phone_number, date_of_birth, name, address, id_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_request_user_name.rb b/lib/plaid/models/identity_verification_request_user_name.rb deleted file mode 100644 index 7a74f3d31..000000000 --- a/lib/plaid/models/identity_verification_request_user_name.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module 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. - class IdentityVerificationRequestUserName - # A string with at least one non-whitespace character, with a max length of 100 characters. - attr_accessor :given_name - - # A string with at least one non-whitespace character, with a max length of 100 characters. - attr_accessor :family_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'given_name', - :'family_name' => :'family_name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationRequestUserName` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationRequestUserName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @given_name.nil? - invalid_properties.push('invalid value for "given_name", given_name cannot be nil.') - end - - if @family_name.nil? - invalid_properties.push('invalid value for "family_name", family_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @given_name.nil? - return false if @family_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_response_user_name.rb b/lib/plaid/models/identity_verification_response_user_name.rb deleted file mode 100644 index deeb67297..000000000 --- a/lib/plaid/models/identity_verification_response_user_name.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class IdentityVerificationResponseUserName - # A string with at least one non-whitespace character, with a max length of 100 characters. - attr_accessor :given_name - - # A string with at least one non-whitespace character, with a max length of 100 characters. - attr_accessor :family_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'given_name', - :'family_name' => :'family_name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationResponseUserName` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationResponseUserName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @given_name.nil? - invalid_properties.push('invalid value for "given_name", given_name cannot be nil.') - end - - if @family_name.nil? - invalid_properties.push('invalid value for "family_name", family_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @given_name.nil? - return false if @family_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_retried_webhook.rb b/lib/plaid/models/identity_verification_retried_webhook.rb deleted file mode 100644 index 9f7df1537..000000000 --- a/lib/plaid/models/identity_verification_retried_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when identity verification has been retried, which can be triggered via the dashboard or the API. - class IdentityVerificationRetriedWebhook - # `IDENTITY_VERIFICATION` - attr_accessor :webhook_type - - # `RETRIED` - attr_accessor :webhook_code - - # The ID of the associated Identity Verification attempt. - attr_accessor :identity_verification_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'identity_verification_id' => :'identity_verification_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'identity_verification_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationRetriedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationRetriedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'identity_verification_id') - self.identity_verification_id = attributes[:'identity_verification_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @identity_verification_id.nil? - invalid_properties.push('invalid value for "identity_verification_id", identity_verification_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @identity_verification_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - identity_verification_id == o.identity_verification_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, identity_verification_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_retry_request.rb b/lib/plaid/models/identity_verification_retry_request.rb deleted file mode 100644 index ee4cf6ec0..000000000 --- a/lib/plaid/models/identity_verification_retry_request.rb +++ /dev/null @@ -1,338 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for retrying an identity verification attempt - class IdentityVerificationRetryRequest - # 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`. - attr_accessor :client_user_id - - # ID of the associated Identity Verification template. - attr_accessor :template_id - - attr_accessor :strategy - - attr_accessor :user - - attr_accessor :steps - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_user_id' => :'client_user_id', - :'template_id' => :'template_id', - :'strategy' => :'strategy', - :'user' => :'user', - :'steps' => :'steps', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_user_id' => :'String', - :'template_id' => :'String', - :'strategy' => :'Strategy', - :'user' => :'IdentityVerificationRequestUser', - :'steps' => :'IdentityVerificationRetryRequestStepsObject', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'user', - :'steps', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationRetryRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationRetryRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'template_id') - self.template_id = attributes[:'template_id'] - end - - if attributes.key?(:'strategy') - self.strategy = attributes[:'strategy'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'steps') - self.steps = attributes[:'steps'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @client_user_id.nil? - invalid_properties.push('invalid value for "client_user_id", client_user_id cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @template_id.nil? - invalid_properties.push('invalid value for "template_id", template_id cannot be nil.') - end - - if @strategy.nil? - invalid_properties.push('invalid value for "strategy", strategy cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @client_user_id.nil? - return false if @client_user_id.to_s.length < 1 - return false if @template_id.nil? - return false if @strategy.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.nil? - fail ArgumentError, 'client_user_id cannot be nil' - end - - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_user_id == o.client_user_id && - template_id == o.template_id && - strategy == o.strategy && - user == o.user && - steps == o.steps && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_user_id, template_id, strategy, user, steps, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_retry_request_steps_object.rb b/lib/plaid/models/identity_verification_retry_request_steps_object.rb deleted file mode 100644 index d6c9c1f91..000000000 --- a/lib/plaid/models/identity_verification_retry_request_steps_object.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Instructions for the `custom` retry strategy specifying which steps should be required or skipped. Note: This field must be provided when the retry strategy is `custom` and must be omitted otherwise. Custom retries override settings in your Plaid Template. For example, if your Plaid Template has `verify_sms` disabled, a custom retry with `verify_sms` enabled will still require the step. The `selfie_check` step is currently not supported on the sandbox server. Sandbox requests will silently disable the `selfie_check` step when provided. - class IdentityVerificationRetryRequestStepsObject - # A boolean field specifying whether the new session should require or skip the `verify_sms` step. - attr_accessor :verify_sms - - # A boolean field specifying whether the new session should require or skip the `kyc_check` step. - attr_accessor :kyc_check - - # A boolean field specifying whether the new session should require or skip the `documentary_verification` step. - attr_accessor :documentary_verification - - # A boolean field specifying whether the new session should require or skip the `selfie_check` step. - attr_accessor :selfie_check - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verify_sms' => :'verify_sms', - :'kyc_check' => :'kyc_check', - :'documentary_verification' => :'documentary_verification', - :'selfie_check' => :'selfie_check' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verify_sms' => :'Boolean', - :'kyc_check' => :'Boolean', - :'documentary_verification' => :'Boolean', - :'selfie_check' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationRetryRequestStepsObject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationRetryRequestStepsObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verify_sms') - self.verify_sms = attributes[:'verify_sms'] - end - - if attributes.key?(:'kyc_check') - self.kyc_check = attributes[:'kyc_check'] - end - - if attributes.key?(:'documentary_verification') - self.documentary_verification = attributes[:'documentary_verification'] - end - - if attributes.key?(:'selfie_check') - self.selfie_check = attributes[:'selfie_check'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @verify_sms.nil? - invalid_properties.push('invalid value for "verify_sms", verify_sms cannot be nil.') - end - - if @kyc_check.nil? - invalid_properties.push('invalid value for "kyc_check", kyc_check cannot be nil.') - end - - if @documentary_verification.nil? - invalid_properties.push('invalid value for "documentary_verification", documentary_verification cannot be nil.') - end - - if @selfie_check.nil? - invalid_properties.push('invalid value for "selfie_check", selfie_check cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @verify_sms.nil? - return false if @kyc_check.nil? - return false if @documentary_verification.nil? - return false if @selfie_check.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verify_sms == o.verify_sms && - kyc_check == o.kyc_check && - documentary_verification == o.documentary_verification && - selfie_check == o.selfie_check - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verify_sms, kyc_check, documentary_verification, selfie_check].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_retry_response.rb b/lib/plaid/models/identity_verification_retry_response.rb deleted file mode 100644 index ff7732315..000000000 --- a/lib/plaid/models/identity_verification_retry_response.rb +++ /dev/null @@ -1,465 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class IdentityVerificationRetryResponse - # ID of the associated Identity Verification attempt. - attr_accessor :id - - # 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`. - attr_accessor :client_user_id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - # An ISO8601 formatted timestamp. - attr_accessor :completed_at - - # 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. - attr_accessor :previous_attempt_id - - # A shareable URL that can be sent directly to the user to complete verification - attr_accessor :shareable_url - - attr_accessor :template - - attr_accessor :user - - attr_accessor :status - - attr_accessor :steps - - attr_accessor :documentary_verification - - attr_accessor :selfie_check - - attr_accessor :kyc_check - - attr_accessor :risk_check - - # ID of the associated screening. - attr_accessor :watchlist_screening_id - - # An ISO8601 formatted timestamp. - attr_accessor :redacted_at - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'client_user_id' => :'client_user_id', - :'created_at' => :'created_at', - :'completed_at' => :'completed_at', - :'previous_attempt_id' => :'previous_attempt_id', - :'shareable_url' => :'shareable_url', - :'template' => :'template', - :'user' => :'user', - :'status' => :'status', - :'steps' => :'steps', - :'documentary_verification' => :'documentary_verification', - :'selfie_check' => :'selfie_check', - :'kyc_check' => :'kyc_check', - :'risk_check' => :'risk_check', - :'watchlist_screening_id' => :'watchlist_screening_id', - :'redacted_at' => :'redacted_at', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'client_user_id' => :'String', - :'created_at' => :'Time', - :'completed_at' => :'Time', - :'previous_attempt_id' => :'String', - :'shareable_url' => :'String', - :'template' => :'IdentityVerificationTemplateReference', - :'user' => :'IdentityVerificationUserData', - :'status' => :'IdentityVerificationStatus', - :'steps' => :'IdentityVerificationStepSummary', - :'documentary_verification' => :'DocumentaryVerification', - :'selfie_check' => :'SelfieCheck', - :'kyc_check' => :'KYCCheckDetails', - :'risk_check' => :'RiskCheckDetails', - :'watchlist_screening_id' => :'String', - :'redacted_at' => :'Time', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'completed_at', - :'previous_attempt_id', - :'shareable_url', - :'documentary_verification', - :'selfie_check', - :'kyc_check', - :'risk_check', - :'watchlist_screening_id', - :'redacted_at', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationRetryResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationRetryResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'completed_at') - self.completed_at = attributes[:'completed_at'] - end - - if attributes.key?(:'previous_attempt_id') - self.previous_attempt_id = attributes[:'previous_attempt_id'] - end - - if attributes.key?(:'shareable_url') - self.shareable_url = attributes[:'shareable_url'] - end - - if attributes.key?(:'template') - self.template = attributes[:'template'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'steps') - self.steps = attributes[:'steps'] - end - - if attributes.key?(:'documentary_verification') - self.documentary_verification = attributes[:'documentary_verification'] - end - - if attributes.key?(:'selfie_check') - self.selfie_check = attributes[:'selfie_check'] - end - - if attributes.key?(:'kyc_check') - self.kyc_check = attributes[:'kyc_check'] - end - - if attributes.key?(:'risk_check') - self.risk_check = attributes[:'risk_check'] - end - - if attributes.key?(:'watchlist_screening_id') - self.watchlist_screening_id = attributes[:'watchlist_screening_id'] - end - - if attributes.key?(:'redacted_at') - self.redacted_at = attributes[:'redacted_at'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @client_user_id.nil? - invalid_properties.push('invalid value for "client_user_id", client_user_id cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @template.nil? - invalid_properties.push('invalid value for "template", template cannot be nil.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @steps.nil? - invalid_properties.push('invalid value for "steps", steps cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @client_user_id.nil? - return false if @client_user_id.to_s.length < 1 - return false if @created_at.nil? - return false if @template.nil? - return false if @user.nil? - return false if @status.nil? - return false if @steps.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.nil? - fail ArgumentError, 'client_user_id cannot be nil' - end - - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - client_user_id == o.client_user_id && - created_at == o.created_at && - completed_at == o.completed_at && - previous_attempt_id == o.previous_attempt_id && - shareable_url == o.shareable_url && - template == o.template && - user == o.user && - status == o.status && - steps == o.steps && - documentary_verification == o.documentary_verification && - selfie_check == o.selfie_check && - kyc_check == o.kyc_check && - risk_check == o.risk_check && - watchlist_screening_id == o.watchlist_screening_id && - redacted_at == o.redacted_at && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, client_user_id, created_at, completed_at, previous_attempt_id, shareable_url, template, user, status, steps, documentary_verification, selfie_check, kyc_check, risk_check, watchlist_screening_id, redacted_at, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_status.rb b/lib/plaid/models/identity_verification_status.rb deleted file mode 100644 index e3fb1b356..000000000 --- a/lib/plaid/models/identity_verification_status.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class IdentityVerificationStatus - ACTIVE = "active".freeze - SUCCESS = "success".freeze - FAILED = "failed".freeze - EXPIRED = "expired".freeze - CANCELED = "canceled".freeze - PENDING_REVIEW = "pending_review".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/identity_verification_status_updated_webhook.rb b/lib/plaid/models/identity_verification_status_updated_webhook.rb deleted file mode 100644 index afdcd4bd1..000000000 --- a/lib/plaid/models/identity_verification_status_updated_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when the status of an identity verification has been updated, which can be triggered via the dashboard or the API. - class IdentityVerificationStatusUpdatedWebhook - # `IDENTITY_VERIFICATION` - attr_accessor :webhook_type - - # `STATUS_UPDATED` - attr_accessor :webhook_code - - # The ID of the associated Identity Verification attempt. - attr_accessor :identity_verification_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'identity_verification_id' => :'identity_verification_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'identity_verification_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationStatusUpdatedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationStatusUpdatedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'identity_verification_id') - self.identity_verification_id = attributes[:'identity_verification_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @identity_verification_id.nil? - invalid_properties.push('invalid value for "identity_verification_id", identity_verification_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @identity_verification_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - identity_verification_id == o.identity_verification_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, identity_verification_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_step_status.rb b/lib/plaid/models/identity_verification_step_status.rb deleted file mode 100644 index 34ea8951f..000000000 --- a/lib/plaid/models/identity_verification_step_status.rb +++ /dev/null @@ -1,48 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class IdentityVerificationStepStatus - SUCCESS = "success".freeze - ACTIVE = "active".freeze - FAILED = "failed".freeze - WAITING_FOR_PREREQUISITE = "waiting_for_prerequisite".freeze - NOT_APPLICABLE = "not_applicable".freeze - SKIPPED = "skipped".freeze - EXPIRED = "expired".freeze - CANCELED = "canceled".freeze - PENDING_REVIEW = "pending_review".freeze - MANUALLY_APPROVED = "manually_approved".freeze - MANUALLY_REJECTED = "manually_rejected".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/identity_verification_step_summary.rb b/lib/plaid/models/identity_verification_step_summary.rb deleted file mode 100644 index 49a976ce4..000000000 --- a/lib/plaid/models/identity_verification_step_summary.rb +++ /dev/null @@ -1,331 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Each step will be one of the following values: `active` - This step is the user's current step. They are either in the process of completing this step, or they recently closed their Identity Verification attempt while in the middle of this step. Only one step will be marked as `active` at any given point. `success` - The Identity Verification attempt has completed this step. `failed` - The user failed this step. This can either call the user to fail the session as a whole, or cause them to fallback to another step depending on how the Identity Verification template is configured. A failed step does not imply a failed session. `waiting_for_prerequisite` - The user needs to complete another step first, before they progress to this step. This step may never run, depending on if the user fails an earlier step or if the step is only run as a fallback. `not_applicable` - This step will not be run for this session. `skipped` - The retry instructions that created this Identity Verification attempt specified that this step should be skipped. `expired` - This step had not yet been completed when the Identity Verification attempt as a whole expired. `canceled` - The Identity Verification attempt was canceled before the user completed this step. `pending_review` - The Identity Verification attempt template was configured to perform a screening that had one or more hits needing review. `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. - class IdentityVerificationStepSummary - attr_accessor :accept_tos - - attr_accessor :verify_sms - - attr_accessor :kyc_check - - attr_accessor :documentary_verification - - attr_accessor :selfie_check - - attr_accessor :watchlist_screening - - attr_accessor :risk_check - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'accept_tos' => :'accept_tos', - :'verify_sms' => :'verify_sms', - :'kyc_check' => :'kyc_check', - :'documentary_verification' => :'documentary_verification', - :'selfie_check' => :'selfie_check', - :'watchlist_screening' => :'watchlist_screening', - :'risk_check' => :'risk_check' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'accept_tos' => :'IdentityVerificationStepStatus', - :'verify_sms' => :'IdentityVerificationStepStatus', - :'kyc_check' => :'IdentityVerificationStepStatus', - :'documentary_verification' => :'IdentityVerificationStepStatus', - :'selfie_check' => :'IdentityVerificationStepStatus', - :'watchlist_screening' => :'IdentityVerificationStepStatus', - :'risk_check' => :'IdentityVerificationStepStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationStepSummary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationStepSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'accept_tos') - self.accept_tos = attributes[:'accept_tos'] - end - - if attributes.key?(:'verify_sms') - self.verify_sms = attributes[:'verify_sms'] - end - - if attributes.key?(:'kyc_check') - self.kyc_check = attributes[:'kyc_check'] - end - - if attributes.key?(:'documentary_verification') - self.documentary_verification = attributes[:'documentary_verification'] - end - - if attributes.key?(:'selfie_check') - self.selfie_check = attributes[:'selfie_check'] - end - - if attributes.key?(:'watchlist_screening') - self.watchlist_screening = attributes[:'watchlist_screening'] - end - - if attributes.key?(:'risk_check') - self.risk_check = attributes[:'risk_check'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @accept_tos.nil? - invalid_properties.push('invalid value for "accept_tos", accept_tos cannot be nil.') - end - - if @verify_sms.nil? - invalid_properties.push('invalid value for "verify_sms", verify_sms cannot be nil.') - end - - if @kyc_check.nil? - invalid_properties.push('invalid value for "kyc_check", kyc_check cannot be nil.') - end - - if @documentary_verification.nil? - invalid_properties.push('invalid value for "documentary_verification", documentary_verification cannot be nil.') - end - - if @selfie_check.nil? - invalid_properties.push('invalid value for "selfie_check", selfie_check cannot be nil.') - end - - if @watchlist_screening.nil? - invalid_properties.push('invalid value for "watchlist_screening", watchlist_screening cannot be nil.') - end - - if @risk_check.nil? - invalid_properties.push('invalid value for "risk_check", risk_check cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @accept_tos.nil? - return false if @verify_sms.nil? - return false if @kyc_check.nil? - return false if @documentary_verification.nil? - return false if @selfie_check.nil? - return false if @watchlist_screening.nil? - return false if @risk_check.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - accept_tos == o.accept_tos && - verify_sms == o.verify_sms && - kyc_check == o.kyc_check && - documentary_verification == o.documentary_verification && - selfie_check == o.selfie_check && - watchlist_screening == o.watchlist_screening && - risk_check == o.risk_check - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [accept_tos, verify_sms, kyc_check, documentary_verification, selfie_check, watchlist_screening, risk_check].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_step_updated_webhook.rb b/lib/plaid/models/identity_verification_step_updated_webhook.rb deleted file mode 100644 index a71f1bfc3..000000000 --- a/lib/plaid/models/identity_verification_step_updated_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when an end user has completed a step of the Identity Verification process. - class IdentityVerificationStepUpdatedWebhook - # `IDENTITY_VERIFICATION` - attr_accessor :webhook_type - - # `STEP_UPDATED` - attr_accessor :webhook_code - - # The ID of the associated Identity Verification attempt. - attr_accessor :identity_verification_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'identity_verification_id' => :'identity_verification_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'identity_verification_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationStepUpdatedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationStepUpdatedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'identity_verification_id') - self.identity_verification_id = attributes[:'identity_verification_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @identity_verification_id.nil? - invalid_properties.push('invalid value for "identity_verification_id", identity_verification_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @identity_verification_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - identity_verification_id == o.identity_verification_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, identity_verification_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_template_reference.rb b/lib/plaid/models/identity_verification_template_reference.rb deleted file mode 100644 index 4f5bd1233..000000000 --- a/lib/plaid/models/identity_verification_template_reference.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The resource ID and version number of the template configuring the behavior of a given Identity Verification. - class IdentityVerificationTemplateReference - # ID of the associated Identity Verification template. - attr_accessor :id - - # Version of the associated Identity Verification template. - attr_accessor :version - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'version' => :'version' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'version' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationTemplateReference` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationTemplateReference`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @version.nil? - invalid_properties.push('invalid value for "version", version cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @version.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - version == o.version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, version].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_user_address.rb b/lib/plaid/models/identity_verification_user_address.rb deleted file mode 100644 index 748f46994..000000000 --- a/lib/plaid/models/identity_verification_user_address.rb +++ /dev/null @@ -1,302 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Even if an address has been collected, 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 - class IdentityVerificationUserAddress - # The primary street portion of an address. If an address is provided, this field will always be filled. - attr_accessor :street - - # Extra street information, like an apartment or suite number. - attr_accessor :street2 - - # City from the end user's address - attr_accessor :city - - # An ISO 3166-2 subdivision code. Related terms would be \"state\", \"province\", \"prefecture\", \"zone\", \"subdivision\", etc. - attr_accessor :region - - # The postal code for the associated address. Between 2 and 10 alphanumeric characters. For US-based addresses this must be 5 numeric digits. - attr_accessor :postal_code - - # Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'street' => :'street', - :'street2' => :'street2', - :'city' => :'city', - :'region' => :'region', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'street' => :'String', - :'street2' => :'String', - :'city' => :'String', - :'region' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'street', - :'street2', - :'city', - :'region', - :'postal_code', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationUserAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationUserAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'street2') - self.street2 = attributes[:'street2'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @country.nil? - invalid_properties.push('invalid value for "country", country cannot be nil.') - end - - if @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @country.nil? - return false if @country.to_s.length < 2 - true - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if country.nil? - fail ArgumentError, 'country cannot be nil' - end - - if country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - street == o.street && - street2 == o.street2 && - city == o.city && - region == o.region && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [street, street2, city, region, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/identity_verification_user_data.rb b/lib/plaid/models/identity_verification_user_data.rb deleted file mode 100644 index a89c9b162..000000000 --- a/lib/plaid/models/identity_verification_user_data.rb +++ /dev/null @@ -1,285 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The identity data that was either collected from the user or provided via API in order to perform an Identity Verification. - class IdentityVerificationUserData - # A phone number in E.164 format. - attr_accessor :phone_number - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :date_of_birth - - # An IPv4 or IPV6 address. - attr_accessor :ip_address - - # A valid email address. - attr_accessor :email_address - - attr_accessor :name - - attr_accessor :address - - attr_accessor :id_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'phone_number' => :'phone_number', - :'date_of_birth' => :'date_of_birth', - :'ip_address' => :'ip_address', - :'email_address' => :'email_address', - :'name' => :'name', - :'address' => :'address', - :'id_number' => :'id_number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'phone_number' => :'String', - :'date_of_birth' => :'Date', - :'ip_address' => :'String', - :'email_address' => :'String', - :'name' => :'IdentityVerificationResponseUserName', - :'address' => :'IdentityVerificationUserAddress', - :'id_number' => :'UserIDNumber' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'phone_number', - :'date_of_birth', - :'ip_address', - :'email_address', - :'name', - :'address', - :'id_number' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IdentityVerificationUserData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IdentityVerificationUserData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'ip_address') - self.ip_address = attributes[:'ip_address'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'id_number') - self.id_number = attributes[:'id_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - phone_number == o.phone_number && - date_of_birth == o.date_of_birth && - ip_address == o.ip_address && - email_address == o.email_address && - name == o.name && - address == o.address && - id_number == o.id_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [phone_number, date_of_birth, ip_address, email_address, name, address, id_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/image_quality.rb b/lib/plaid/models/image_quality.rb deleted file mode 100644 index 106174645..000000000 --- a/lib/plaid/models/image_quality.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class ImageQuality - HIGH = "high".freeze - MEDIUM = "medium".freeze - LOW = "low".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/incident_update.rb b/lib/plaid/models/incident_update.rb deleted file mode 100644 index d70de4c8a..000000000 --- a/lib/plaid/models/incident_update.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An update on the health incident - class IncidentUpdate - # The content of the update. - attr_accessor :description - - # The status of the incident. - attr_accessor :status - - # The date when the update was published, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format, e.g. `\"2020-10-30T15:26:48Z\"`. - attr_accessor :updated_date - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'description' => :'description', - :'status' => :'status', - :'updated_date' => :'updated_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'description' => :'String', - :'status' => :'String', - :'updated_date' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncidentUpdate` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncidentUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'updated_date') - self.updated_date = attributes[:'updated_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - status_validator = EnumAttributeValidator.new('String', ["INVESTIGATING", "IDENTIFIED", "SCHEDULED", "RESOLVED", "UNKNOWN"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["INVESTIGATING", "IDENTIFIED", "SCHEDULED", "RESOLVED", "UNKNOWN"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - description == o.description && - status == o.status && - updated_date == o.updated_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [description, status, updated_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_breakdown.rb b/lib/plaid/models/income_breakdown.rb deleted file mode 100644 index 498aa0b39..000000000 --- a/lib/plaid/models/income_breakdown.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing a breakdown of the different income types on the paystub. - class IncomeBreakdown - attr_accessor :type - - # The hourly rate at which the income is paid. - attr_accessor :rate - - # The number of hours logged for this income for this pay period. - attr_accessor :hours - - # The total pay for this pay period. - attr_accessor :total - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'rate' => :'rate', - :'hours' => :'hours', - :'total' => :'total' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'IncomeBreakdownType', - :'rate' => :'Float', - :'hours' => :'Float', - :'total' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'type', - :'rate', - :'hours', - :'total' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeBreakdown` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeBreakdown`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'rate') - self.rate = attributes[:'rate'] - end - - if attributes.key?(:'hours') - self.hours = attributes[:'hours'] - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - rate == o.rate && - hours == o.hours && - total == o.total - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, rate, hours, total].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_breakdown_type.rb b/lib/plaid/models/income_breakdown_type.rb deleted file mode 100644 index 8b30f40c6..000000000 --- a/lib/plaid/models/income_breakdown_type.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class IncomeBreakdownType - BONUS = "bonus".freeze - OVERTIME = "overtime".freeze - REGULAR = "regular".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/income_override.rb b/lib/plaid/models/income_override.rb deleted file mode 100644 index 3ac2737e8..000000000 --- a/lib/plaid/models/income_override.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specify payroll data on the account. - class IncomeOverride - # A list of paystubs associated with the account. - attr_accessor :paystubs - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'paystubs' => :'paystubs' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'paystubs' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeOverride` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeOverride`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'paystubs') - if (value = attributes[:'paystubs']).is_a?(Array) - self.paystubs = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - paystubs == o.paystubs - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [paystubs].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_summary.rb b/lib/plaid/models/income_summary.rb deleted file mode 100644 index b77b98151..000000000 --- a/lib/plaid/models/income_summary.rb +++ /dev/null @@ -1,301 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The verified fields from a paystub verification. All fields are provided as reported on the paystub. - class IncomeSummary - attr_accessor :employer_name - - attr_accessor :employee_name - - attr_accessor :ytd_gross_income - - attr_accessor :ytd_net_income - - attr_accessor :pay_frequency - - attr_accessor :projected_wage - - attr_accessor :verified_transaction - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'employer_name' => :'employer_name', - :'employee_name' => :'employee_name', - :'ytd_gross_income' => :'ytd_gross_income', - :'ytd_net_income' => :'ytd_net_income', - :'pay_frequency' => :'pay_frequency', - :'projected_wage' => :'projected_wage', - :'verified_transaction' => :'verified_transaction' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'employer_name' => :'EmployerIncomeSummaryFieldString', - :'employee_name' => :'EmployeeIncomeSummaryFieldString', - :'ytd_gross_income' => :'YTDGrossIncomeSummaryFieldNumber', - :'ytd_net_income' => :'YTDNetIncomeSummaryFieldNumber', - :'pay_frequency' => :'PayFrequency', - :'projected_wage' => :'ProjectedIncomeSummaryFieldNumber', - :'verified_transaction' => :'TransactionData' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'pay_frequency', - :'verified_transaction' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeSummary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'employer_name') - self.employer_name = attributes[:'employer_name'] - end - - if attributes.key?(:'employee_name') - self.employee_name = attributes[:'employee_name'] - end - - if attributes.key?(:'ytd_gross_income') - self.ytd_gross_income = attributes[:'ytd_gross_income'] - end - - if attributes.key?(:'ytd_net_income') - self.ytd_net_income = attributes[:'ytd_net_income'] - end - - if attributes.key?(:'pay_frequency') - self.pay_frequency = attributes[:'pay_frequency'] - end - - if attributes.key?(:'projected_wage') - self.projected_wage = attributes[:'projected_wage'] - end - - if attributes.key?(:'verified_transaction') - self.verified_transaction = attributes[:'verified_transaction'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @employer_name.nil? - invalid_properties.push('invalid value for "employer_name", employer_name cannot be nil.') - end - - if @employee_name.nil? - invalid_properties.push('invalid value for "employee_name", employee_name cannot be nil.') - end - - if @ytd_gross_income.nil? - invalid_properties.push('invalid value for "ytd_gross_income", ytd_gross_income cannot be nil.') - end - - if @ytd_net_income.nil? - invalid_properties.push('invalid value for "ytd_net_income", ytd_net_income cannot be nil.') - end - - if @projected_wage.nil? - invalid_properties.push('invalid value for "projected_wage", projected_wage cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @employer_name.nil? - return false if @employee_name.nil? - return false if @ytd_gross_income.nil? - return false if @ytd_net_income.nil? - return false if @projected_wage.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - employer_name == o.employer_name && - employee_name == o.employee_name && - ytd_gross_income == o.ytd_gross_income && - ytd_net_income == o.ytd_net_income && - pay_frequency == o.pay_frequency && - projected_wage == o.projected_wage && - verified_transaction == o.verified_transaction - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [employer_name, employee_name, ytd_gross_income, ytd_net_income, pay_frequency, projected_wage, verified_transaction].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_summary_field_number.rb b/lib/plaid/models/income_summary_field_number.rb deleted file mode 100644 index 89ae7bdb8..000000000 --- a/lib/plaid/models/income_summary_field_number.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Field number for income summary - class IncomeSummaryFieldNumber - # The value of the field. - attr_accessor :value - - attr_accessor :verification_status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'verification_status' => :'verification_status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'Float', - :'verification_status' => :'VerificationStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeSummaryFieldNumber` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeSummaryFieldNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @verification_status.nil? - invalid_properties.push('invalid value for "verification_status", verification_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @value.nil? - return false if @verification_status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - verification_status == o.verification_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, verification_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_summary_field_string.rb b/lib/plaid/models/income_summary_field_string.rb deleted file mode 100644 index fe6b46706..000000000 --- a/lib/plaid/models/income_summary_field_string.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data about the income summary - class IncomeSummaryFieldString - # The value of the field. - attr_accessor :value - - attr_accessor :verification_status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'verification_status' => :'verification_status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'String', - :'verification_status' => :'VerificationStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeSummaryFieldString` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeSummaryFieldString`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @verification_status.nil? - invalid_properties.push('invalid value for "verification_status", verification_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @value.nil? - return false if @verification_status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - verification_status == o.verification_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, verification_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_create_request.rb b/lib/plaid/models/income_verification_create_request.rb deleted file mode 100644 index de9878365..000000000 --- a/lib/plaid/models/income_verification_create_request.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # IncomeVerificationCreateRequest defines the request schema for `/income/verification/create` - class IncomeVerificationCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The URL endpoint to which Plaid should send webhooks related to the progress of the income verification process. - attr_accessor :webhook - - # The ID of a precheck created with `/income/verification/precheck`. Will be used to improve conversion of the income verification flow. - attr_accessor :precheck_id - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'webhook' => :'webhook', - :'precheck_id' => :'precheck_id', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'webhook' => :'String', - :'precheck_id' => :'String', - :'options' => :'IncomeVerificationCreateRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - - if attributes.key?(:'precheck_id') - self.precheck_id = attributes[:'precheck_id'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook.nil? - invalid_properties.push('invalid value for "webhook", webhook cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - webhook == o.webhook && - precheck_id == o.precheck_id && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, webhook, precheck_id, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_create_request_options.rb b/lib/plaid/models/income_verification_create_request_options.rb deleted file mode 100644 index 3ee977430..000000000 --- a/lib/plaid/models/income_verification_create_request_options.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Optional arguments for `/income/verification/create` - class IncomeVerificationCreateRequestOptions - # An array of access tokens corresponding to the Items that will be cross-referenced with the product data. Plaid will attempt to correlate transaction history from these Items with data from the user's paystub, such as date and amount. If the `transactions` product was not initialized for the Items during Link, it will be initialized after this Link session. - attr_accessor :access_tokens - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'access_tokens' => :'access_tokens' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'access_tokens' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationCreateRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationCreateRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'access_tokens') - if (value = attributes[:'access_tokens']).is_a?(Array) - self.access_tokens = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - access_tokens == o.access_tokens - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [access_tokens].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_create_response.rb b/lib/plaid/models/income_verification_create_response.rb deleted file mode 100644 index 62ea40380..000000000 --- a/lib/plaid/models/income_verification_create_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # IncomeVerificationCreateResponse defines the response schema for `/income/verification/create`. - class IncomeVerificationCreateResponse - # ID of the verification. This ID is persisted throughout the lifetime of the verification. - attr_accessor :income_verification_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'income_verification_id' => :'income_verification_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'income_verification_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'income_verification_id') - self.income_verification_id = attributes[:'income_verification_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @income_verification_id.nil? - invalid_properties.push('invalid value for "income_verification_id", income_verification_id cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @income_verification_id.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - income_verification_id == o.income_verification_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [income_verification_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_doc_parsing_config.rb b/lib/plaid/models/income_verification_doc_parsing_config.rb deleted file mode 100644 index 5cdd58a35..000000000 --- a/lib/plaid/models/income_verification_doc_parsing_config.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class IncomeVerificationDocParsingConfig - OCR = "ocr".freeze - RISK_SIGNALS = "risk_signals".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/income_verification_documents_download_request.rb b/lib/plaid/models/income_verification_documents_download_request.rb deleted file mode 100644 index 2dd1cb05c..000000000 --- a/lib/plaid/models/income_verification_documents_download_request.rb +++ /dev/null @@ -1,264 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # IncomeVerificationDocumentsDownloadRequest defines the request schema for `/income/verification/documents/download`. - class IncomeVerificationDocumentsDownloadRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the verification. - attr_accessor :income_verification_id - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # The document ID to download. If passed, a single document will be returned in the resulting zip file, rather than all document - attr_accessor :document_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'income_verification_id' => :'income_verification_id', - :'access_token' => :'access_token', - :'document_id' => :'document_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'income_verification_id' => :'String', - :'access_token' => :'String', - :'document_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'income_verification_id', - :'access_token', - :'document_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationDocumentsDownloadRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationDocumentsDownloadRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'income_verification_id') - self.income_verification_id = attributes[:'income_verification_id'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'document_id') - self.document_id = attributes[:'document_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - income_verification_id == o.income_verification_id && - access_token == o.access_token && - document_id == o.document_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, income_verification_id, access_token, document_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_payroll_flow_type.rb b/lib/plaid/models/income_verification_payroll_flow_type.rb deleted file mode 100644 index a4e88f473..000000000 --- a/lib/plaid/models/income_verification_payroll_flow_type.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class IncomeVerificationPayrollFlowType - DIGITAL_INCOME = "payroll_digital_income".freeze - DOCUMENT_INCOME = "payroll_document_income".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/income_verification_paystubs_get_request.rb b/lib/plaid/models/income_verification_paystubs_get_request.rb deleted file mode 100644 index d1c9ff76e..000000000 --- a/lib/plaid/models/income_verification_paystubs_get_request.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # IncomeVerificationPaystubsGetRequest defines the request schema for `/income/verification/paystubs/get`. - class IncomeVerificationPaystubsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the verification for which to get paystub information. - attr_accessor :income_verification_id - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'income_verification_id' => :'income_verification_id', - :'access_token' => :'access_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'income_verification_id' => :'String', - :'access_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'income_verification_id', - :'access_token' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationPaystubsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationPaystubsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'income_verification_id') - self.income_verification_id = attributes[:'income_verification_id'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - income_verification_id == o.income_verification_id && - access_token == o.access_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, income_verification_id, access_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_paystubs_get_response.rb b/lib/plaid/models/income_verification_paystubs_get_response.rb deleted file mode 100644 index 9601d415a..000000000 --- a/lib/plaid/models/income_verification_paystubs_get_response.rb +++ /dev/null @@ -1,264 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # IncomeVerificationPaystubsGetResponse defines the response schema for `/income/verification/paystubs/get`. - class IncomeVerificationPaystubsGetResponse - # Metadata for an income document. - attr_accessor :document_metadata - - attr_accessor :paystubs - - attr_accessor :error - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'document_metadata' => :'document_metadata', - :'paystubs' => :'paystubs', - :'error' => :'error', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'document_metadata' => :'Array', - :'paystubs' => :'Array', - :'error' => :'PlaidError', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationPaystubsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationPaystubsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'document_metadata') - if (value = attributes[:'document_metadata']).is_a?(Array) - self.document_metadata = value - end - end - - if attributes.key?(:'paystubs') - if (value = attributes[:'paystubs']).is_a?(Array) - self.paystubs = value - end - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @paystubs.nil? - invalid_properties.push('invalid value for "paystubs", paystubs cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @paystubs.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - document_metadata == o.document_metadata && - paystubs == o.paystubs && - error == o.error && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [document_metadata, paystubs, error, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_precheck_confidence.rb b/lib/plaid/models/income_verification_precheck_confidence.rb deleted file mode 100644 index dbec60168..000000000 --- a/lib/plaid/models/income_verification_precheck_confidence.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class IncomeVerificationPrecheckConfidence - HIGH = "HIGH".freeze - LOW = "LOW".freeze - UNKNOWN = "UNKNOWN".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/income_verification_precheck_employer.rb b/lib/plaid/models/income_verification_precheck_employer.rb deleted file mode 100644 index 76b91b0a7..000000000 --- a/lib/plaid/models/income_verification_precheck_employer.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the end user's employer - class IncomeVerificationPrecheckEmployer - # The employer's name - attr_accessor :name - - attr_accessor :address - - # The employer's tax id - attr_accessor :tax_id - - # The URL for the employer's public website - attr_accessor :url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'address' => :'address', - :'tax_id' => :'tax_id', - :'url' => :'url' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'address' => :'IncomeVerificationPrecheckEmployerAddress', - :'tax_id' => :'String', - :'url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'address', - :'tax_id', - :'url' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationPrecheckEmployer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationPrecheckEmployer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'tax_id') - self.tax_id = attributes[:'tax_id'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address == o.address && - tax_id == o.tax_id && - url == o.url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address, tax_id, url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_precheck_employer_address.rb b/lib/plaid/models/income_verification_precheck_employer_address.rb deleted file mode 100644 index 3c3f59038..000000000 --- a/lib/plaid/models/income_verification_precheck_employer_address.rb +++ /dev/null @@ -1,268 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The address of the employer - class IncomeVerificationPrecheckEmployerAddress - # The full city name - attr_accessor :city - - # The ISO 3166-1 alpha-2 country code - attr_accessor :country - - # The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`. - attr_accessor :postal_code - - # The region or state. In API versions 2018-05-22 and earlier, this field is called `state`. Example: `\"NC\"` - attr_accessor :region - - # The full street address Example: `\"564 Main Street, APT 15\"` - attr_accessor :street - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'country' => :'country', - :'postal_code' => :'postal_code', - :'region' => :'region', - :'street' => :'street' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'country' => :'String', - :'postal_code' => :'String', - :'region' => :'String', - :'street' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'IncomeVerificationPrecheckEmployerAddressData' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationPrecheckEmployerAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationPrecheckEmployerAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - country == o.country && - postal_code == o.postal_code && - region == o.region && - street == o.street - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, country, postal_code, region, street].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_precheck_employer_address_data.rb b/lib/plaid/models/income_verification_precheck_employer_address_data.rb deleted file mode 100644 index 765ae853b..000000000 --- a/lib/plaid/models/income_verification_precheck_employer_address_data.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data about the components comprising an address. - class IncomeVerificationPrecheckEmployerAddressData - # The full city name - attr_accessor :city - - # The ISO 3166-1 alpha-2 country code - attr_accessor :country - - # The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`. - attr_accessor :postal_code - - # The region or state. In API versions 2018-05-22 and earlier, this field is called `state`. Example: `\"NC\"` - attr_accessor :region - - # The full street address Example: `\"564 Main Street, APT 15\"` - attr_accessor :street - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'country' => :'country', - :'postal_code' => :'postal_code', - :'region' => :'region', - :'street' => :'street' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'country' => :'String', - :'postal_code' => :'String', - :'region' => :'String', - :'street' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationPrecheckEmployerAddressData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationPrecheckEmployerAddressData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - country == o.country && - postal_code == o.postal_code && - region == o.region && - street == o.street - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, country, postal_code, region, street].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_precheck_military_info.rb b/lib/plaid/models/income_verification_precheck_military_info.rb deleted file mode 100644 index ab87f1160..000000000 --- a/lib/plaid/models/income_verification_precheck_military_info.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data about military info in the income verification precheck. - class IncomeVerificationPrecheckMilitaryInfo - # Is the user currently active duty in the US military - attr_accessor :is_active_duty - - # If the user is currently serving in the US military, the branch of the military in which they are serving Valid values: 'AIR FORCE', 'ARMY', 'COAST GUARD', 'MARINES', 'NAVY', 'UNKNOWN' - attr_accessor :branch - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'is_active_duty' => :'is_active_duty', - :'branch' => :'branch' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'is_active_duty' => :'Boolean', - :'branch' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'is_active_duty', - :'branch' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationPrecheckMilitaryInfo` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationPrecheckMilitaryInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'is_active_duty') - self.is_active_duty = attributes[:'is_active_duty'] - end - - if attributes.key?(:'branch') - self.branch = attributes[:'branch'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - is_active_duty == o.is_active_duty && - branch == o.branch - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [is_active_duty, branch].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_precheck_payroll_institution.rb b/lib/plaid/models/income_verification_precheck_payroll_institution.rb deleted file mode 100644 index 89d095db1..000000000 --- a/lib/plaid/models/income_verification_precheck_payroll_institution.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the end user's payroll institution - class IncomeVerificationPrecheckPayrollInstitution - # The name of payroll institution - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationPrecheckPayrollInstitution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationPrecheckPayrollInstitution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_precheck_request.rb b/lib/plaid/models/income_verification_precheck_request.rb deleted file mode 100644 index 4ea587c02..000000000 --- a/lib/plaid/models/income_verification_precheck_request.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # IncomeVerificationPrecheckRequest defines the request schema for `/income/verification/precheck` - class IncomeVerificationPrecheckRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - attr_accessor :user - - attr_accessor :employer - - attr_accessor :payroll_institution - - attr_accessor :transactions_access_token - - # An array of access tokens corresponding to Items belonging to the user whose eligibility is being checked. Note that if the Items specified here are not already initialized with `transactions`, providing them in this field will cause these Items to be initialized with (and billed for) the Transactions product. - attr_accessor :transactions_access_tokens - - attr_accessor :us_military_info - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user' => :'user', - :'employer' => :'employer', - :'payroll_institution' => :'payroll_institution', - :'transactions_access_token' => :'transactions_access_token', - :'transactions_access_tokens' => :'transactions_access_tokens', - :'us_military_info' => :'us_military_info' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user' => :'IncomeVerificationPrecheckUser', - :'employer' => :'IncomeVerificationPrecheckEmployer', - :'payroll_institution' => :'IncomeVerificationPrecheckPayrollInstitution', - :'transactions_access_token' => :'String', - :'transactions_access_tokens' => :'Array', - :'us_military_info' => :'IncomeVerificationPrecheckMilitaryInfo' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'user', - :'employer', - :'payroll_institution', - :'us_military_info' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationPrecheckRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationPrecheckRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'employer') - self.employer = attributes[:'employer'] - end - - if attributes.key?(:'payroll_institution') - self.payroll_institution = attributes[:'payroll_institution'] - end - - if attributes.key?(:'transactions_access_token') - self.transactions_access_token = attributes[:'transactions_access_token'] - end - - if attributes.key?(:'transactions_access_tokens') - if (value = attributes[:'transactions_access_tokens']).is_a?(Array) - self.transactions_access_tokens = value - end - end - - if attributes.key?(:'us_military_info') - self.us_military_info = attributes[:'us_military_info'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user == o.user && - employer == o.employer && - payroll_institution == o.payroll_institution && - transactions_access_token == o.transactions_access_token && - transactions_access_tokens == o.transactions_access_tokens && - us_military_info == o.us_military_info - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user, employer, payroll_institution, transactions_access_token, transactions_access_tokens, us_military_info].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_precheck_response.rb b/lib/plaid/models/income_verification_precheck_response.rb deleted file mode 100644 index 0f290a172..000000000 --- a/lib/plaid/models/income_verification_precheck_response.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # IncomeVerificationPrecheckResponse defines the response schema for `/income/verification/precheck`. - class IncomeVerificationPrecheckResponse - # ID of the precheck. Provide this value when calling `/link/token/create` in order to optimize Link conversion. - attr_accessor :precheck_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - attr_accessor :confidence - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'precheck_id' => :'precheck_id', - :'request_id' => :'request_id', - :'confidence' => :'confidence' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'precheck_id' => :'String', - :'request_id' => :'String', - :'confidence' => :'IncomeVerificationPrecheckConfidence' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationPrecheckResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationPrecheckResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'precheck_id') - self.precheck_id = attributes[:'precheck_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'confidence') - self.confidence = attributes[:'confidence'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @precheck_id.nil? - invalid_properties.push('invalid value for "precheck_id", precheck_id cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - if @confidence.nil? - invalid_properties.push('invalid value for "confidence", confidence cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @precheck_id.nil? - return false if @request_id.nil? - return false if @confidence.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - precheck_id == o.precheck_id && - request_id == o.request_id && - confidence == o.confidence - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [precheck_id, request_id, confidence].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_precheck_user.rb b/lib/plaid/models/income_verification_precheck_user.rb deleted file mode 100644 index 5b4f70140..000000000 --- a/lib/plaid/models/income_verification_precheck_user.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the user whose eligibility is being evaluated. - class IncomeVerificationPrecheckUser - # The user's first name - attr_accessor :first_name - - # The user's last name - attr_accessor :last_name - - # The user's email address - attr_accessor :email_address - - attr_accessor :home_address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'first_name' => :'first_name', - :'last_name' => :'last_name', - :'email_address' => :'email_address', - :'home_address' => :'home_address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'first_name' => :'String', - :'last_name' => :'String', - :'email_address' => :'String', - :'home_address' => :'SignalAddressData' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'first_name', - :'last_name', - :'email_address', - :'home_address' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationPrecheckUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationPrecheckUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - end - - if attributes.key?(:'last_name') - self.last_name = attributes[:'last_name'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'home_address') - self.home_address = attributes[:'home_address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - first_name == o.first_name && - last_name == o.last_name && - email_address == o.email_address && - home_address == o.home_address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [first_name, last_name, email_address, home_address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_refresh_reconnect_needed_webhook.rb b/lib/plaid/models/income_verification_refresh_reconnect_needed_webhook.rb deleted file mode 100644 index cbdef1450..000000000 --- a/lib/plaid/models/income_verification_refresh_reconnect_needed_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class IncomeVerificationRefreshReconnectNeededWebhook - # `INCOME` - attr_accessor :webhook_type - - # `INCOME_VERIFICATION_REFRESH_RECONNECT_NEEDED` - attr_accessor :webhook_code - - # The `user_id` corresponding to the user the webhook has fired for. - attr_accessor :user_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'user_id' => :'user_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'user_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationRefreshReconnectNeededWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationRefreshReconnectNeededWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @user_id.nil? - invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @user_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - user_id == o.user_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, user_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_risk_signals_status_webhook.rb b/lib/plaid/models/income_verification_risk_signals_status_webhook.rb deleted file mode 100644 index 951fb08b5..000000000 --- a/lib/plaid/models/income_verification_risk_signals_status_webhook.rb +++ /dev/null @@ -1,312 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class IncomeVerificationRiskSignalsStatusWebhook - # `\"INCOME\"` - attr_accessor :webhook_type - - # `INCOME_VERIFICATION_RISK_SIGNALS` - attr_accessor :webhook_code - - # The Item ID associated with the verification. - attr_accessor :item_id - - # The Plaid `user_id` of the User associated with this webhook, warning, or error. - attr_accessor :user_id - - # `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. - attr_accessor :risk_signals_status - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'user_id' => :'user_id', - :'risk_signals_status' => :'risk_signals_status', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'user_id' => :'String', - :'risk_signals_status' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationRiskSignalsStatusWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationRiskSignalsStatusWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'risk_signals_status') - self.risk_signals_status = attributes[:'risk_signals_status'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - user_id == o.user_id && - risk_signals_status == o.risk_signals_status && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, user_id, risk_signals_status, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_source_type.rb b/lib/plaid/models/income_verification_source_type.rb deleted file mode 100644 index c5236e282..000000000 --- a/lib/plaid/models/income_verification_source_type.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class IncomeVerificationSourceType - BANK = "bank".freeze - PAYROLL = "payroll".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/income_verification_status_webhook.rb b/lib/plaid/models/income_verification_status_webhook.rb deleted file mode 100644 index 0eadd590e..000000000 --- a/lib/plaid/models/income_verification_status_webhook.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class IncomeVerificationStatusWebhook - # `\"INCOME\"` - attr_accessor :webhook_type - - # `INCOME_VERIFICATION` - attr_accessor :webhook_code - - # The Item ID associated with the verification. - attr_accessor :item_id - - # The Plaid `user_id` of the User associated with this webhook, warning, or error. - attr_accessor :user_id - - # `VERIFICATION_STATUS_PROCESSING_COMPLETE`: The income verification processing has completed. This indicates that the documents have been parsed successfully or that the documents were not parsable. If the user uploaded multiple documents, this webhook will fire when all documents have finished processing. Call the `/credit/payroll_income/get` endpoint and check the document metadata to see which documents were successfully parsed. `VERIFICATION_STATUS_PROCESSING_FAILED`: An unexpected internal error occurred when attempting to process the verification documentation. `VERIFICATION_STATUS_PENDING_APPROVAL`: (deprecated) The income verification has been sent to the user for review. - attr_accessor :verification_status - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'user_id' => :'user_id', - :'verification_status' => :'verification_status', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'user_id' => :'String', - :'verification_status' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationStatusWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationStatusWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @verification_status.nil? - invalid_properties.push('invalid value for "verification_status", verification_status cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @verification_status.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - user_id == o.user_id && - verification_status == o.verification_status && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, user_id, verification_status, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_taxforms_get_request.rb b/lib/plaid/models/income_verification_taxforms_get_request.rb deleted file mode 100644 index b97332d6e..000000000 --- a/lib/plaid/models/income_verification_taxforms_get_request.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # IncomeVerificationTaxformsGetRequest defines the request schema for `/income/verification/taxforms/get` - class IncomeVerificationTaxformsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the verification. - attr_accessor :income_verification_id - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'income_verification_id' => :'income_verification_id', - :'access_token' => :'access_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'income_verification_id' => :'String', - :'access_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'income_verification_id', - :'access_token' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationTaxformsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationTaxformsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'income_verification_id') - self.income_verification_id = attributes[:'income_verification_id'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - income_verification_id == o.income_verification_id && - access_token == o.access_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, income_verification_id, access_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_taxforms_get_response.rb b/lib/plaid/models/income_verification_taxforms_get_response.rb deleted file mode 100644 index 780b9c5b9..000000000 --- a/lib/plaid/models/income_verification_taxforms_get_response.rb +++ /dev/null @@ -1,264 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # IncomeVerificationTaxformsGetResponse defines the response schema for `/income/verification/taxforms/get` - class IncomeVerificationTaxformsGetResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - attr_accessor :document_metadata - - # A list of forms. - attr_accessor :taxforms - - attr_accessor :error - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id', - :'document_metadata' => :'document_metadata', - :'taxforms' => :'taxforms', - :'error' => :'error' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String', - :'document_metadata' => :'Array', - :'taxforms' => :'Array', - :'error' => :'PlaidError' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationTaxformsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationTaxformsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'document_metadata') - if (value = attributes[:'document_metadata']).is_a?(Array) - self.document_metadata = value - end - end - - if attributes.key?(:'taxforms') - if (value = attributes[:'taxforms']).is_a?(Array) - self.taxforms = value - end - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @document_metadata.nil? - invalid_properties.push('invalid value for "document_metadata", document_metadata cannot be nil.') - end - - if @taxforms.nil? - invalid_properties.push('invalid value for "taxforms", taxforms cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @document_metadata.nil? - return false if @taxforms.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id && - document_metadata == o.document_metadata && - taxforms == o.taxforms && - error == o.error - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id, document_metadata, taxforms, error].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/income_verification_webhook_status.rb b/lib/plaid/models/income_verification_webhook_status.rb deleted file mode 100644 index 67c6c1a6d..000000000 --- a/lib/plaid/models/income_verification_webhook_status.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Status of the income verification webhook - class IncomeVerificationWebhookStatus - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IncomeVerificationWebhookStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IncomeVerificationWebhookStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/individual_name.rb b/lib/plaid/models/individual_name.rb deleted file mode 100644 index 0c070484b..000000000 --- a/lib/plaid/models/individual_name.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Parent container for name that allows for choice group between parsed and unparsed containers.Parent container for name that allows for choice group between parsed and unparsed containers. - class IndividualName - # The first name of the individual represented by the parent object. - attr_accessor :first_name - - # The last name of the individual represented by the parent object. - attr_accessor :last_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'first_name' => :'FirstName', - :'last_name' => :'LastName' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'first_name' => :'String', - :'last_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IndividualName` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IndividualName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - end - - if attributes.key?(:'last_name') - self.last_name = attributes[:'last_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @first_name.nil? - invalid_properties.push('invalid value for "first_name", first_name cannot be nil.') - end - - if @last_name.nil? - invalid_properties.push('invalid value for "last_name", last_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @first_name.nil? - return false if @last_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - first_name == o.first_name && - last_name == o.last_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [first_name, last_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/individual_screening_hit_names.rb b/lib/plaid/models/individual_screening_hit_names.rb deleted file mode 100644 index 67db7006f..000000000 --- a/lib/plaid/models/individual_screening_hit_names.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Name information for the associated individual watchlist hit - class IndividualScreeningHitNames - # The full name of the individual, including all parts. - attr_accessor :full - - # Primary names are those most commonly used to refer to this person. Only one name will ever be marked as primary. - attr_accessor :is_primary - - attr_accessor :weak_alias_determination - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'full' => :'full', - :'is_primary' => :'is_primary', - :'weak_alias_determination' => :'weak_alias_determination' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'full' => :'String', - :'is_primary' => :'Boolean', - :'weak_alias_determination' => :'WeakAliasDetermination' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IndividualScreeningHitNames` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IndividualScreeningHitNames`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'full') - self.full = attributes[:'full'] - end - - if attributes.key?(:'is_primary') - self.is_primary = attributes[:'is_primary'] - end - - if attributes.key?(:'weak_alias_determination') - self.weak_alias_determination = attributes[:'weak_alias_determination'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @full.nil? - invalid_properties.push('invalid value for "full", full cannot be nil.') - end - - if @is_primary.nil? - invalid_properties.push('invalid value for "is_primary", is_primary cannot be nil.') - end - - if @weak_alias_determination.nil? - invalid_properties.push('invalid value for "weak_alias_determination", weak_alias_determination cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @full.nil? - return false if @is_primary.nil? - return false if @weak_alias_determination.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - full == o.full && - is_primary == o.is_primary && - weak_alias_determination == o.weak_alias_determination - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [full, is_primary, weak_alias_determination].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/individual_watchlist_code.rb b/lib/plaid/models/individual_watchlist_code.rb deleted file mode 100644 index 28135cb25..000000000 --- a/lib/plaid/models/individual_watchlist_code.rb +++ /dev/null @@ -1,61 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class IndividualWatchlistCode - AU_CON = "AU_CON".freeze - CA_CON = "CA_CON".freeze - EU_CON = "EU_CON".freeze - IZ_CIA = "IZ_CIA".freeze - IZ_IPL = "IZ_IPL".freeze - IZ_PEP = "IZ_PEP".freeze - IZ_UNC = "IZ_UNC".freeze - IZ_WBK = "IZ_WBK".freeze - UK_HMC = "UK_HMC".freeze - US_DPL = "US_DPL".freeze - US_DTC = "US_DTC".freeze - US_FBI = "US_FBI".freeze - US_FSE = "US_FSE".freeze - US_ISN = "US_ISN".freeze - US_MBS = "US_MBS".freeze - US_PLC = "US_PLC".freeze - US_SDN = "US_SDN".freeze - US_SSI = "US_SSI".freeze - SG_SOF = "SG_SOF".freeze - TR_TWL = "TR_TWL".freeze - TR_DFD = "TR_DFD".freeze - TR_FOR = "TR_FOR".freeze - TR_WMD = "TR_WMD".freeze - TR_CMB = "TR_CMB".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/individual_watchlist_program.rb b/lib/plaid/models/individual_watchlist_program.rb deleted file mode 100644 index cd8592866..000000000 --- a/lib/plaid/models/individual_watchlist_program.rb +++ /dev/null @@ -1,386 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A program that configures the active lists, search parameters, and other behavior for initial and ongoing screening of individuals. - class IndividualWatchlistProgram - # ID of the associated program. - attr_accessor :id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - # Indicator specifying whether the program is enabled and will perform daily rescans. - attr_accessor :is_rescanning_enabled - - # Watchlists enabled for the associated program - attr_accessor :lists_enabled - - # A name for the program to define its purpose. For example, \"High Risk Individuals\", \"US Cardholders\", or \"Applicants\". - attr_accessor :name - - attr_accessor :name_sensitivity - - attr_accessor :audit_trail - - # Archived programs are read-only and cannot screen new customers nor participate in ongoing monitoring. - attr_accessor :is_archived - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'created_at' => :'created_at', - :'is_rescanning_enabled' => :'is_rescanning_enabled', - :'lists_enabled' => :'lists_enabled', - :'name' => :'name', - :'name_sensitivity' => :'name_sensitivity', - :'audit_trail' => :'audit_trail', - :'is_archived' => :'is_archived' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'created_at' => :'Time', - :'is_rescanning_enabled' => :'Boolean', - :'lists_enabled' => :'Array', - :'name' => :'String', - :'name_sensitivity' => :'ProgramNameSensitivity', - :'audit_trail' => :'WatchlistScreeningAuditTrail', - :'is_archived' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::IndividualWatchlistProgram` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::IndividualWatchlistProgram`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'is_rescanning_enabled') - self.is_rescanning_enabled = attributes[:'is_rescanning_enabled'] - end - - if attributes.key?(:'lists_enabled') - if (value = attributes[:'lists_enabled']).is_a?(Array) - self.lists_enabled = value - end - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'name_sensitivity') - self.name_sensitivity = attributes[:'name_sensitivity'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'is_archived') - self.is_archived = attributes[:'is_archived'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @is_rescanning_enabled.nil? - invalid_properties.push('invalid value for "is_rescanning_enabled", is_rescanning_enabled cannot be nil.') - end - - if @lists_enabled.nil? - invalid_properties.push('invalid value for "lists_enabled", lists_enabled cannot be nil.') - end - - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @name.to_s.length < 1 - invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') - end - - - if @name_sensitivity.nil? - invalid_properties.push('invalid value for "name_sensitivity", name_sensitivity cannot be nil.') - end - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @is_archived.nil? - invalid_properties.push('invalid value for "is_archived", is_archived cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @created_at.nil? - return false if @is_rescanning_enabled.nil? - return false if @lists_enabled.nil? - return false if @name.nil? - return false if @name.to_s.length < 1 - return false if @name_sensitivity.nil? - return false if @audit_trail.nil? - return false if @is_archived.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] lists_enabled Value to be assigned - def lists_enabled=(lists_enabled) - if lists_enabled.nil? - fail ArgumentError, 'lists_enabled cannot be nil' - end - - - @lists_enabled = lists_enabled - end - - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if name.nil? - fail ArgumentError, 'name cannot be nil' - end - - if name.to_s.length < 1 - fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' - end - - - @name = name - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - created_at == o.created_at && - is_rescanning_enabled == o.is_rescanning_enabled && - lists_enabled == o.lists_enabled && - name == o.name && - name_sensitivity == o.name_sensitivity && - audit_trail == o.audit_trail && - is_archived == o.is_archived - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, created_at, is_rescanning_enabled, lists_enabled, name, name_sensitivity, audit_trail, is_archived].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/inflow_model.rb b/lib/plaid/models/inflow_model.rb deleted file mode 100644 index 540492151..000000000 --- a/lib/plaid/models/inflow_model.rb +++ /dev/null @@ -1,286 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The `inflow_model` allows you to model a test account that receives regular income or make regular payments on a loan. Any transactions generated by the `inflow_model` will appear in addition to randomly generated test data or transactions specified by `override_accounts`. - class InflowModel - # Inflow model. One of the following: `none`: No income `monthly-income`: Income occurs once per month `monthly-balance-payment`: Pays off the balance on a liability account at the given statement day of month. `monthly-interest-only-payment`: Makes an interest-only payment on a liability account at the given statement day of month. Note that account types supported by Liabilities will accrue interest in the Sandbox. The types impacted are account type `credit` with subtype `credit` or `paypal`, and account type `loan` with subtype `student` or `mortgage`. - attr_accessor :type - - # Amount of income per month. This value is required if `type` is `monthly-income`. - attr_accessor :income_amount - - # Number between 1 and 28, or `last` meaning the last day of the month. The day of the month on which the income transaction will appear. The name of the income transaction. This field is required if `type` is `monthly-income`, `monthly-balance-payment` or `monthly-interest-only-payment`. - attr_accessor :payment_day_of_month - - # The name of the income transaction. This field is required if `type` is `monthly-income`, `monthly-balance-payment` or `monthly-interest-only-payment`. - attr_accessor :transaction_name - - # Number between 1 and 28, or `last` meaning the last day of the month. The day of the month on which the balance is calculated for the next payment. The name of the income transaction. This field is required if `type` is `monthly-balance-payment` or `monthly-interest-only-payment`. - attr_accessor :statement_day_of_month - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'income_amount' => :'income_amount', - :'payment_day_of_month' => :'payment_day_of_month', - :'transaction_name' => :'transaction_name', - :'statement_day_of_month' => :'statement_day_of_month' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'income_amount' => :'Float', - :'payment_day_of_month' => :'Float', - :'transaction_name' => :'String', - :'statement_day_of_month' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InflowModel` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InflowModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'income_amount') - self.income_amount = attributes[:'income_amount'] - end - - if attributes.key?(:'payment_day_of_month') - self.payment_day_of_month = attributes[:'payment_day_of_month'] - end - - if attributes.key?(:'transaction_name') - self.transaction_name = attributes[:'transaction_name'] - end - - if attributes.key?(:'statement_day_of_month') - self.statement_day_of_month = attributes[:'statement_day_of_month'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @income_amount.nil? - invalid_properties.push('invalid value for "income_amount", income_amount cannot be nil.') - end - - if @payment_day_of_month.nil? - invalid_properties.push('invalid value for "payment_day_of_month", payment_day_of_month cannot be nil.') - end - - if @transaction_name.nil? - invalid_properties.push('invalid value for "transaction_name", transaction_name cannot be nil.') - end - - if @statement_day_of_month.nil? - invalid_properties.push('invalid value for "statement_day_of_month", statement_day_of_month cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - return false if @income_amount.nil? - return false if @payment_day_of_month.nil? - return false if @transaction_name.nil? - return false if @statement_day_of_month.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - income_amount == o.income_amount && - payment_day_of_month == o.payment_day_of_month && - transaction_name == o.transaction_name && - statement_day_of_month == o.statement_day_of_month - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, income_amount, payment_day_of_month, transaction_name, statement_day_of_month].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/initial_update_webhook.rb b/lib/plaid/models/initial_update_webhook.rb deleted file mode 100644 index d99be1e82..000000000 --- a/lib/plaid/models/initial_update_webhook.rb +++ /dev/null @@ -1,318 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. 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. - class InitialUpdateWebhook - # `TRANSACTIONS` - attr_accessor :webhook_type - - # `INITIAL_UPDATE` - attr_accessor :webhook_code - - # The error code associated with the webhook. - attr_accessor :error - - # The number of new, unfetched transactions available. - attr_accessor :new_transactions - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'error' => :'error', - :'new_transactions' => :'new_transactions', - :'item_id' => :'item_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'error' => :'String', - :'new_transactions' => :'Float', - :'item_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InitialUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InitialUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'new_transactions') - self.new_transactions = attributes[:'new_transactions'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @new_transactions.nil? - invalid_properties.push('invalid value for "new_transactions", new_transactions cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @new_transactions.nil? - return false if @item_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - error == o.error && - new_transactions == o.new_transactions && - item_id == o.item_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, error, new_transactions, item_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/institution.rb b/lib/plaid/models/institution.rb deleted file mode 100644 index cb5e4e45e..000000000 --- a/lib/plaid/models/institution.rb +++ /dev/null @@ -1,382 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Details relating to a specific financial institution - class Institution - # Unique identifier for the institution. Note that the same institution may have multiple records, each with different institution IDs; for example, if the institution has migrated to OAuth, there may be separate `institution_id`s for the OAuth and non-OAuth versions of the institution. Institutions that operate in different countries or with multiple login portals may also have separate `institution_id`s for each country or portal. - attr_accessor :institution_id - - # The official name of the institution. - attr_accessor :name - - # 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/). - attr_accessor :products - - # A list of the country codes supported by the institution. - attr_accessor :country_codes - - # The URL for the institution's website - attr_accessor :url - - # Hexadecimal representation of the primary color used by the institution - attr_accessor :primary_color - - # Base64 encoded representation of the institution's logo, returned as a base64 encoded 152x152 PNG. Not all institutions' logos are available. - attr_accessor :logo - - # 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. - attr_accessor :routing_numbers - - # A partial list of DTC numbers associated with the institution. - attr_accessor :dtc_numbers - - # Indicates that the institution has an OAuth login flow. This will be `true` if OAuth is supported for any Items associated with the institution, even if the institution also supports non-OAuth connections. - attr_accessor :oauth - - attr_accessor :status - - attr_accessor :payment_initiation_metadata - - attr_accessor :auth_metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'institution_id' => :'institution_id', - :'name' => :'name', - :'products' => :'products', - :'country_codes' => :'country_codes', - :'url' => :'url', - :'primary_color' => :'primary_color', - :'logo' => :'logo', - :'routing_numbers' => :'routing_numbers', - :'dtc_numbers' => :'dtc_numbers', - :'oauth' => :'oauth', - :'status' => :'status', - :'payment_initiation_metadata' => :'payment_initiation_metadata', - :'auth_metadata' => :'auth_metadata' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'institution_id' => :'String', - :'name' => :'String', - :'products' => :'Array', - :'country_codes' => :'Array', - :'url' => :'String', - :'primary_color' => :'String', - :'logo' => :'String', - :'routing_numbers' => :'Array', - :'dtc_numbers' => :'Array', - :'oauth' => :'Boolean', - :'status' => :'InstitutionStatus', - :'payment_initiation_metadata' => :'PaymentInitiationMetadata', - :'auth_metadata' => :'AuthMetadata' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'url', - :'primary_color', - :'logo', - :'status', - :'payment_initiation_metadata', - :'auth_metadata' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Institution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Institution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'products') - if (value = attributes[:'products']).is_a?(Array) - self.products = value - end - end - - if attributes.key?(:'country_codes') - if (value = attributes[:'country_codes']).is_a?(Array) - self.country_codes = value - end - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'primary_color') - self.primary_color = attributes[:'primary_color'] - end - - if attributes.key?(:'logo') - self.logo = attributes[:'logo'] - end - - if attributes.key?(:'routing_numbers') - if (value = attributes[:'routing_numbers']).is_a?(Array) - self.routing_numbers = value - end - end - - if attributes.key?(:'dtc_numbers') - if (value = attributes[:'dtc_numbers']).is_a?(Array) - self.dtc_numbers = value - end - end - - if attributes.key?(:'oauth') - self.oauth = attributes[:'oauth'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'payment_initiation_metadata') - self.payment_initiation_metadata = attributes[:'payment_initiation_metadata'] - end - - if attributes.key?(:'auth_metadata') - self.auth_metadata = attributes[:'auth_metadata'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @institution_id.nil? - invalid_properties.push('invalid value for "institution_id", institution_id cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @products.nil? - invalid_properties.push('invalid value for "products", products cannot be nil.') - end - - if @country_codes.nil? - invalid_properties.push('invalid value for "country_codes", country_codes cannot be nil.') - end - - if @routing_numbers.nil? - invalid_properties.push('invalid value for "routing_numbers", routing_numbers cannot be nil.') - end - - if @oauth.nil? - invalid_properties.push('invalid value for "oauth", oauth cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @institution_id.nil? - return false if @name.nil? - return false if @products.nil? - return false if @country_codes.nil? - return false if @routing_numbers.nil? - return false if @oauth.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - institution_id == o.institution_id && - name == o.name && - products == o.products && - country_codes == o.country_codes && - url == o.url && - primary_color == o.primary_color && - logo == o.logo && - routing_numbers == o.routing_numbers && - dtc_numbers == o.dtc_numbers && - oauth == o.oauth && - status == o.status && - payment_initiation_metadata == o.payment_initiation_metadata && - auth_metadata == o.auth_metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [institution_id, name, products, country_codes, url, primary_color, logo, routing_numbers, dtc_numbers, oauth, status, payment_initiation_metadata, auth_metadata].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/institution_status.rb b/lib/plaid/models/institution_status.rb deleted file mode 100644 index 0fe10be1e..000000000 --- a/lib/plaid/models/institution_status.rb +++ /dev/null @@ -1,304 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. Institution status is accessible in the Dashboard and via the API using the `/institutions/get_by_id` endpoint with the `include_status` option set to true. Note that institution status is not available in the Sandbox environment. - class InstitutionStatus - attr_accessor :item_logins - - attr_accessor :transactions_updates - - attr_accessor :auth - - attr_accessor :identity - - attr_accessor :investments_updates - - attr_accessor :liabilities_updates - - attr_accessor :liabilities - - attr_accessor :investments - - # Details of recent health incidents associated with the institution. - attr_accessor :health_incidents - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_logins' => :'item_logins', - :'transactions_updates' => :'transactions_updates', - :'auth' => :'auth', - :'identity' => :'identity', - :'investments_updates' => :'investments_updates', - :'liabilities_updates' => :'liabilities_updates', - :'liabilities' => :'liabilities', - :'investments' => :'investments', - :'health_incidents' => :'health_incidents' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_logins' => :'ProductStatus', - :'transactions_updates' => :'ProductStatus', - :'auth' => :'ProductStatus', - :'identity' => :'ProductStatus', - :'investments_updates' => :'ProductStatus', - :'liabilities_updates' => :'ProductStatus', - :'liabilities' => :'ProductStatus', - :'investments' => :'ProductStatus', - :'health_incidents' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'item_logins', - :'transactions_updates', - :'auth', - :'identity', - :'investments_updates', - :'liabilities_updates', - :'liabilities', - :'investments', - :'health_incidents' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InstitutionStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InstitutionStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_logins') - self.item_logins = attributes[:'item_logins'] - end - - if attributes.key?(:'transactions_updates') - self.transactions_updates = attributes[:'transactions_updates'] - end - - if attributes.key?(:'auth') - self.auth = attributes[:'auth'] - end - - if attributes.key?(:'identity') - self.identity = attributes[:'identity'] - end - - if attributes.key?(:'investments_updates') - self.investments_updates = attributes[:'investments_updates'] - end - - if attributes.key?(:'liabilities_updates') - self.liabilities_updates = attributes[:'liabilities_updates'] - end - - if attributes.key?(:'liabilities') - self.liabilities = attributes[:'liabilities'] - end - - if attributes.key?(:'investments') - self.investments = attributes[:'investments'] - end - - if attributes.key?(:'health_incidents') - if (value = attributes[:'health_incidents']).is_a?(Array) - self.health_incidents = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_logins == o.item_logins && - transactions_updates == o.transactions_updates && - auth == o.auth && - identity == o.identity && - investments_updates == o.investments_updates && - liabilities_updates == o.liabilities_updates && - liabilities == o.liabilities && - investments == o.investments && - health_incidents == o.health_incidents - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_logins, transactions_updates, auth, identity, investments_updates, liabilities_updates, liabilities, investments, health_incidents].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/institution_status_alert_webhook.rb b/lib/plaid/models/institution_status_alert_webhook.rb deleted file mode 100644 index fa338e6df..000000000 --- a/lib/plaid/models/institution_status_alert_webhook.rb +++ /dev/null @@ -1,307 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when institution status meets the conditions configured in the developer dashboard. - class InstitutionStatusAlertWebhook - # `DASHBOARD_CONFIGURED_ALERT` - attr_accessor :webhook_type - - # `INSTITUTION_STATUS_ALERT_TRIGGERED` - attr_accessor :webhook_code - - # The ID of the associated institution. - attr_accessor :institution_id - - # The global success rate of the institution, calculated based on item add health. - attr_accessor :institution_overall_success_rate - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'institution_id' => :'institution_id', - :'institution_overall_success_rate' => :'institution_overall_success_rate', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'institution_id' => :'String', - :'institution_overall_success_rate' => :'Float', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InstitutionStatusAlertWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InstitutionStatusAlertWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'institution_overall_success_rate') - self.institution_overall_success_rate = attributes[:'institution_overall_success_rate'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @institution_id.nil? - invalid_properties.push('invalid value for "institution_id", institution_id cannot be nil.') - end - - if @institution_overall_success_rate.nil? - invalid_properties.push('invalid value for "institution_overall_success_rate", institution_overall_success_rate cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @institution_id.nil? - return false if @institution_overall_success_rate.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - institution_id == o.institution_id && - institution_overall_success_rate == o.institution_overall_success_rate && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, institution_id, institution_overall_success_rate, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/institution_supported_networks.rb b/lib/plaid/models/institution_supported_networks.rb deleted file mode 100644 index 2b3c05e07..000000000 --- a/lib/plaid/models/institution_supported_networks.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Contains the RTP network and types supported by the linked Item's institution. - class InstitutionSupportedNetworks - attr_accessor :rtp - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'rtp' => :'rtp' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'rtp' => :'TransferCapabilitiesGetRTP' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InstitutionSupportedNetworks` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InstitutionSupportedNetworks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'rtp') - self.rtp = attributes[:'rtp'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @rtp.nil? - invalid_properties.push('invalid value for "rtp", rtp cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @rtp.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - rtp == o.rtp - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [rtp].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/institutions_get_by_id_request.rb b/lib/plaid/models/institutions_get_by_id_request.rb deleted file mode 100644 index fcac44ba5..000000000 --- a/lib/plaid/models/institutions_get_by_id_request.rb +++ /dev/null @@ -1,293 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # InstitutionsGetByIdRequest defines the request schema for `/institutions/get_by_id` - class InstitutionsGetByIdRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the institution to get details about - attr_accessor :institution_id - - # Specify which country or countries to include institutions from, using the ISO-3166-1 alpha-2 country code standard. In API versions 2019-05-29 and earlier, the `country_codes` parameter is an optional parameter within the `options` object and will default to `[US]` if it is not supplied. - attr_accessor :country_codes - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'institution_id' => :'institution_id', - :'country_codes' => :'country_codes', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'institution_id' => :'String', - :'country_codes' => :'Array', - :'options' => :'InstitutionsGetByIdRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InstitutionsGetByIdRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InstitutionsGetByIdRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'country_codes') - if (value = attributes[:'country_codes']).is_a?(Array) - self.country_codes = value - end - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @institution_id.nil? - invalid_properties.push('invalid value for "institution_id", institution_id cannot be nil.') - end - - if @institution_id.to_s.length < 1 - invalid_properties.push('invalid value for "institution_id", the character length must be great than or equal to 1.') - end - - - if @country_codes.nil? - invalid_properties.push('invalid value for "country_codes", country_codes cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @institution_id.nil? - return false if @institution_id.to_s.length < 1 - return false if @country_codes.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] institution_id Value to be assigned - def institution_id=(institution_id) - if institution_id.nil? - fail ArgumentError, 'institution_id cannot be nil' - end - - if institution_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "institution_id", the character length must be great than or equal to 1.' - end - - - @institution_id = institution_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - institution_id == o.institution_id && - country_codes == o.country_codes && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, institution_id, country_codes, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/institutions_get_by_id_request_options.rb b/lib/plaid/models/institutions_get_by_id_request_options.rb deleted file mode 100644 index ae7500580..000000000 --- a/lib/plaid/models/institutions_get_by_id_request_options.rb +++ /dev/null @@ -1,259 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specifies optional parameters for `/institutions/get_by_id`. If provided, must not be `null`. - class InstitutionsGetByIdRequestOptions - # When `true`, return an institution's logo, brand color, and URL. When available, the bank's logo is returned as a base64 encoded 152x152 PNG, the brand color is in hexadecimal format. The default value is `false`. 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. - attr_accessor :include_optional_metadata - - # If `true`, the response will include status information about the institution. Default value is `false`. - attr_accessor :include_status - - # When `true`, returns metadata related to the Auth product indicating which auth methods are supported. - attr_accessor :include_auth_metadata - - # When `true`, returns metadata related to the Payment Initiation product indicating which payment configurations are supported. - attr_accessor :include_payment_initiation_metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'include_optional_metadata' => :'include_optional_metadata', - :'include_status' => :'include_status', - :'include_auth_metadata' => :'include_auth_metadata', - :'include_payment_initiation_metadata' => :'include_payment_initiation_metadata' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'include_optional_metadata' => :'Boolean', - :'include_status' => :'Boolean', - :'include_auth_metadata' => :'Boolean', - :'include_payment_initiation_metadata' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InstitutionsGetByIdRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InstitutionsGetByIdRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'include_optional_metadata') - self.include_optional_metadata = attributes[:'include_optional_metadata'] - else - self.include_optional_metadata = false - end - - if attributes.key?(:'include_status') - self.include_status = attributes[:'include_status'] - else - self.include_status = false - end - - if attributes.key?(:'include_auth_metadata') - self.include_auth_metadata = attributes[:'include_auth_metadata'] - else - self.include_auth_metadata = false - end - - if attributes.key?(:'include_payment_initiation_metadata') - self.include_payment_initiation_metadata = attributes[:'include_payment_initiation_metadata'] - else - self.include_payment_initiation_metadata = false - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - include_optional_metadata == o.include_optional_metadata && - include_status == o.include_status && - include_auth_metadata == o.include_auth_metadata && - include_payment_initiation_metadata == o.include_payment_initiation_metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [include_optional_metadata, include_status, include_auth_metadata, include_payment_initiation_metadata].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/institutions_get_by_id_response.rb b/lib/plaid/models/institutions_get_by_id_response.rb deleted file mode 100644 index b24a6c109..000000000 --- a/lib/plaid/models/institutions_get_by_id_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # InstitutionsGetByIdResponse defines the response schema for `/institutions/get_by_id` - class InstitutionsGetByIdResponse - attr_accessor :institution - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'institution' => :'institution', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'institution' => :'Institution', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InstitutionsGetByIdResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InstitutionsGetByIdResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'institution') - self.institution = attributes[:'institution'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @institution.nil? - invalid_properties.push('invalid value for "institution", institution cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @institution.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - institution == o.institution && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [institution, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/institutions_get_request.rb b/lib/plaid/models/institutions_get_request.rb deleted file mode 100644 index 10ea393a0..000000000 --- a/lib/plaid/models/institutions_get_request.rb +++ /dev/null @@ -1,359 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # InstitutionsGetRequest defines the request schema for `/institutions/get` - class InstitutionsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The total number of Institutions to return. - attr_accessor :count - - # The number of Institutions to skip. - attr_accessor :offset - - # Specify which country or countries to include institutions from, using the ISO-3166-1 alpha-2 country code standard. In API versions 2019-05-29 and earlier, the `country_codes` parameter is an optional parameter within the `options` object and will default to `[US]` if it is not supplied. - attr_accessor :country_codes - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'count' => :'count', - :'offset' => :'offset', - :'country_codes' => :'country_codes', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'count' => :'Integer', - :'offset' => :'Integer', - :'country_codes' => :'Array', - :'options' => :'InstitutionsGetRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InstitutionsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InstitutionsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - end - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - end - - if attributes.key?(:'country_codes') - if (value = attributes[:'country_codes']).is_a?(Array) - self.country_codes = value - end - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @count.nil? - invalid_properties.push('invalid value for "count", count cannot be nil.') - end - - if @count > 500 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 500.') - end - - if @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - if @offset.nil? - invalid_properties.push('invalid value for "offset", offset cannot be nil.') - end - - if @offset < 0 - invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.') - end - - - if @country_codes.nil? - invalid_properties.push('invalid value for "country_codes", country_codes cannot be nil.') - end - - - if @country_codes.length < 1 - invalid_properties.push('invalid value for "country_codes", number of items must be greater than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @count.nil? - return false if @count > 500 - return false if @count < 1 - return false if @offset.nil? - return false if @offset < 0 - return false if @country_codes.nil? - return false if @country_codes.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if count.nil? - fail ArgumentError, 'count cannot be nil' - end - - if count > 500 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 500.' - end - - if count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Custom attribute writer method with validation - # @param [Object] offset Value to be assigned - def offset=(offset) - if offset.nil? - fail ArgumentError, 'offset cannot be nil' - end - - if offset < 0 - fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.' - end - - - @offset = offset - end - - # Custom attribute writer method with validation - # @param [Object] country_codes Value to be assigned - def country_codes=(country_codes) - if country_codes.nil? - fail ArgumentError, 'country_codes cannot be nil' - end - - - if country_codes.length < 1 - fail ArgumentError, 'invalid value for "country_codes", number of items must be greater than or equal to 1.' - end - - @country_codes = country_codes - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - count == o.count && - offset == o.offset && - country_codes == o.country_codes && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, count, offset, country_codes, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/institutions_get_request_options.rb b/lib/plaid/models/institutions_get_request_options.rb deleted file mode 100644 index a827ee986..000000000 --- a/lib/plaid/models/institutions_get_request_options.rb +++ /dev/null @@ -1,299 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to filter `/institutions/get` results. - class InstitutionsGetRequestOptions - # Filter the Institutions based on which products they support. - attr_accessor :products - - # 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. - attr_accessor :routing_numbers - - # 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`. - attr_accessor :oauth - - # When `true`, return the institution's homepage URL, logo and primary brand color. 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. - attr_accessor :include_optional_metadata - - # When `true`, returns metadata related to the Auth product indicating which auth methods are supported. - attr_accessor :include_auth_metadata - - # When `true`, returns metadata related to the Payment Initiation product indicating which payment configurations are supported. - attr_accessor :include_payment_initiation_metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'products' => :'products', - :'routing_numbers' => :'routing_numbers', - :'oauth' => :'oauth', - :'include_optional_metadata' => :'include_optional_metadata', - :'include_auth_metadata' => :'include_auth_metadata', - :'include_payment_initiation_metadata' => :'include_payment_initiation_metadata' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'products' => :'Array', - :'routing_numbers' => :'Array', - :'oauth' => :'Boolean', - :'include_optional_metadata' => :'Boolean', - :'include_auth_metadata' => :'Boolean', - :'include_payment_initiation_metadata' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'products', - :'routing_numbers', - :'oauth', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InstitutionsGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InstitutionsGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'products') - if (value = attributes[:'products']).is_a?(Array) - self.products = value - end - end - - if attributes.key?(:'routing_numbers') - if (value = attributes[:'routing_numbers']).is_a?(Array) - self.routing_numbers = value - end - end - - if attributes.key?(:'oauth') - self.oauth = attributes[:'oauth'] - end - - if attributes.key?(:'include_optional_metadata') - self.include_optional_metadata = attributes[:'include_optional_metadata'] - end - - if attributes.key?(:'include_auth_metadata') - self.include_auth_metadata = attributes[:'include_auth_metadata'] - else - self.include_auth_metadata = false - end - - if attributes.key?(:'include_payment_initiation_metadata') - self.include_payment_initiation_metadata = attributes[:'include_payment_initiation_metadata'] - else - self.include_payment_initiation_metadata = false - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - - if !@products.nil? && @products.length < 1 - invalid_properties.push('invalid value for "products", number of items must be greater than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@products.nil? && @products.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] products Value to be assigned - def products=(products) - - if !products.nil? && products.length < 1 - fail ArgumentError, 'invalid value for "products", number of items must be greater than or equal to 1.' - end - - @products = products - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - products == o.products && - routing_numbers == o.routing_numbers && - oauth == o.oauth && - include_optional_metadata == o.include_optional_metadata && - include_auth_metadata == o.include_auth_metadata && - include_payment_initiation_metadata == o.include_payment_initiation_metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [products, routing_numbers, oauth, include_optional_metadata, include_auth_metadata, include_payment_initiation_metadata].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/institutions_get_response.rb b/lib/plaid/models/institutions_get_response.rb deleted file mode 100644 index 39aaed1f4..000000000 --- a/lib/plaid/models/institutions_get_response.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # InstitutionsGetResponse defines the response schema for `/institutions/get` - class InstitutionsGetResponse - # A list of Plaid institutions - attr_accessor :institutions - - # The total number of institutions available via this endpoint - attr_accessor :total - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'institutions' => :'institutions', - :'total' => :'total', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'institutions' => :'Array', - :'total' => :'Integer', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InstitutionsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InstitutionsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'institutions') - if (value = attributes[:'institutions']).is_a?(Array) - self.institutions = value - end - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @institutions.nil? - invalid_properties.push('invalid value for "institutions", institutions cannot be nil.') - end - - if @total.nil? - invalid_properties.push('invalid value for "total", total cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @institutions.nil? - return false if @total.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - institutions == o.institutions && - total == o.total && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [institutions, total, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/institutions_search_account_filter.rb b/lib/plaid/models/institutions_search_account_filter.rb deleted file mode 100644 index 246f8de29..000000000 --- a/lib/plaid/models/institutions_search_account_filter.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An account filter to apply to institutions search requests - class InstitutionsSearchAccountFilter - attr_accessor :loan - - attr_accessor :depository - - attr_accessor :credit - - attr_accessor :investment - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'loan' => :'loan', - :'depository' => :'depository', - :'credit' => :'credit', - :'investment' => :'investment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'loan' => :'Array', - :'depository' => :'Array', - :'credit' => :'Array', - :'investment' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InstitutionsSearchAccountFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InstitutionsSearchAccountFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'loan') - if (value = attributes[:'loan']).is_a?(Array) - self.loan = value - end - end - - if attributes.key?(:'depository') - if (value = attributes[:'depository']).is_a?(Array) - self.depository = value - end - end - - if attributes.key?(:'credit') - if (value = attributes[:'credit']).is_a?(Array) - self.credit = value - end - end - - if attributes.key?(:'investment') - if (value = attributes[:'investment']).is_a?(Array) - self.investment = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - loan == o.loan && - depository == o.depository && - credit == o.credit && - investment == o.investment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [loan, depository, credit, investment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/institutions_search_payment_initiation_options.rb b/lib/plaid/models/institutions_search_payment_initiation_options.rb deleted file mode 100644 index 742933a49..000000000 --- a/lib/plaid/models/institutions_search_payment_initiation_options.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Additional options that will be used to filter institutions by various Payment Initiation configurations. - class InstitutionsSearchPaymentInitiationOptions - # A unique ID identifying the payment - attr_accessor :payment_id - - # A unique ID identifying the payment consent - attr_accessor :consent_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payment_id' => :'payment_id', - :'consent_id' => :'consent_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'payment_id' => :'String', - :'consent_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'payment_id', - :'consent_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InstitutionsSearchPaymentInitiationOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InstitutionsSearchPaymentInitiationOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payment_id') - self.payment_id = attributes[:'payment_id'] - end - - if attributes.key?(:'consent_id') - self.consent_id = attributes[:'consent_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payment_id == o.payment_id && - consent_id == o.consent_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payment_id, consent_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/institutions_search_request.rb b/lib/plaid/models/institutions_search_request.rb deleted file mode 100644 index f20f3a909..000000000 --- a/lib/plaid/models/institutions_search_request.rb +++ /dev/null @@ -1,323 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # InstitutionsSearchRequest defines the request schema for `/institutions/search` - class InstitutionsSearchRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The search query. Institutions with names matching the query are returned - attr_accessor :query - - # Filter the Institutions based on whether they support all products listed in `products`. Provide `null` to get institutions regardless of supported products. Note that when `auth` is specified as a product, if you are enabled for Instant Match or Automated Micro-deposits, institutions that support those products will be returned even if `auth` is not present in their product array. - attr_accessor :products - - # Specify which country or countries to include institutions from, using the ISO-3166-1 alpha-2 country code standard. In API versions 2019-05-29 and earlier, the `country_codes` parameter is an optional parameter within the `options` object and will default to `[US]` if it is not supplied. - attr_accessor :country_codes - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'query' => :'query', - :'products' => :'products', - :'country_codes' => :'country_codes', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'query' => :'String', - :'products' => :'Array', - :'country_codes' => :'Array', - :'options' => :'InstitutionsSearchRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'products', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InstitutionsSearchRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InstitutionsSearchRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'query') - self.query = attributes[:'query'] - end - - if attributes.key?(:'products') - if (value = attributes[:'products']).is_a?(Array) - self.products = value - end - end - - if attributes.key?(:'country_codes') - if (value = attributes[:'country_codes']).is_a?(Array) - self.country_codes = value - end - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @query.nil? - invalid_properties.push('invalid value for "query", query cannot be nil.') - end - - if @query.to_s.length < 1 - invalid_properties.push('invalid value for "query", the character length must be great than or equal to 1.') - end - - - - if !@products.nil? && @products.length < 1 - invalid_properties.push('invalid value for "products", number of items must be greater than or equal to 1.') - end - - if @country_codes.nil? - invalid_properties.push('invalid value for "country_codes", country_codes cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @query.nil? - return false if @query.to_s.length < 1 - return false if !@products.nil? && @products.length < 1 - return false if @country_codes.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] query Value to be assigned - def query=(query) - if query.nil? - fail ArgumentError, 'query cannot be nil' - end - - if query.to_s.length < 1 - fail ArgumentError, 'invalid value for "query", the character length must be great than or equal to 1.' - end - - - @query = query - end - - # Custom attribute writer method with validation - # @param [Object] products Value to be assigned - def products=(products) - - if !products.nil? && products.length < 1 - fail ArgumentError, 'invalid value for "products", number of items must be greater than or equal to 1.' - end - - @products = products - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - query == o.query && - products == o.products && - country_codes == o.country_codes && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, query, products, country_codes, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/institutions_search_request_options.rb b/lib/plaid/models/institutions_search_request_options.rb deleted file mode 100644 index 821692d09..000000000 --- a/lib/plaid/models/institutions_search_request_options.rb +++ /dev/null @@ -1,268 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to filter `/institutions/search` results. - class InstitutionsSearchRequestOptions - # 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`. - attr_accessor :oauth - - # When true, return the institution's homepage URL, logo and primary brand color. - attr_accessor :include_optional_metadata - - # When `true`, returns metadata related to the Auth product indicating which auth methods are supported. - attr_accessor :include_auth_metadata - - # When `true`, returns metadata related to the Payment Initiation product indicating which payment configurations are supported. - attr_accessor :include_payment_initiation_metadata - - attr_accessor :payment_initiation - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'oauth' => :'oauth', - :'include_optional_metadata' => :'include_optional_metadata', - :'include_auth_metadata' => :'include_auth_metadata', - :'include_payment_initiation_metadata' => :'include_payment_initiation_metadata', - :'payment_initiation' => :'payment_initiation' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'oauth' => :'Boolean', - :'include_optional_metadata' => :'Boolean', - :'include_auth_metadata' => :'Boolean', - :'include_payment_initiation_metadata' => :'Boolean', - :'payment_initiation' => :'InstitutionsSearchPaymentInitiationOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'oauth', - :'include_auth_metadata', - :'include_payment_initiation_metadata', - :'payment_initiation' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InstitutionsSearchRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InstitutionsSearchRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'oauth') - self.oauth = attributes[:'oauth'] - end - - if attributes.key?(:'include_optional_metadata') - self.include_optional_metadata = attributes[:'include_optional_metadata'] - end - - if attributes.key?(:'include_auth_metadata') - self.include_auth_metadata = attributes[:'include_auth_metadata'] - else - self.include_auth_metadata = false - end - - if attributes.key?(:'include_payment_initiation_metadata') - self.include_payment_initiation_metadata = attributes[:'include_payment_initiation_metadata'] - else - self.include_payment_initiation_metadata = false - end - - if attributes.key?(:'payment_initiation') - self.payment_initiation = attributes[:'payment_initiation'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - oauth == o.oauth && - include_optional_metadata == o.include_optional_metadata && - include_auth_metadata == o.include_auth_metadata && - include_payment_initiation_metadata == o.include_payment_initiation_metadata && - payment_initiation == o.payment_initiation - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [oauth, include_optional_metadata, include_auth_metadata, include_payment_initiation_metadata, payment_initiation].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/institutions_search_response.rb b/lib/plaid/models/institutions_search_response.rb deleted file mode 100644 index d24e52e24..000000000 --- a/lib/plaid/models/institutions_search_response.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # InstitutionsSearchResponse defines the response schema for `/institutions/search` - class InstitutionsSearchResponse - # An array of institutions matching the search criteria - attr_accessor :institutions - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'institutions' => :'institutions', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'institutions' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InstitutionsSearchResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InstitutionsSearchResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'institutions') - if (value = attributes[:'institutions']).is_a?(Array) - self.institutions = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @institutions.nil? - invalid_properties.push('invalid value for "institutions", institutions cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @institutions.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - institutions == o.institutions && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [institutions, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investment_account_subtype.rb b/lib/plaid/models/investment_account_subtype.rb deleted file mode 100644 index d2f86d06c..000000000 --- a/lib/plaid/models/investment_account_subtype.rb +++ /dev/null @@ -1,87 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class InvestmentAccountSubtype - N529 = "529".freeze - N401A = "401a".freeze - N401K = "401k".freeze - N403_B = "403B".freeze - N457B = "457b".freeze - BROKERAGE = "brokerage".freeze - CASH_ISA = "cash isa".freeze - CRYPTO_EXCHANGE = "crypto exchange".freeze - EDUCATION_SAVINGS_ACCOUNT = "education savings account".freeze - FIXED_ANNUITY = "fixed annuity".freeze - GIC = "gic".freeze - HEALTH_REIMBURSEMENT_ARRANGEMENT = "health reimbursement arrangement".freeze - HSA = "hsa".freeze - IRA = "ira".freeze - ISA = "isa".freeze - KEOGH = "keogh".freeze - LIF = "lif".freeze - LIFE_INSURANCE = "life insurance".freeze - LIRA = "lira".freeze - LRIF = "lrif".freeze - LRSP = "lrsp".freeze - MUTUAL_FUND = "mutual fund".freeze - NON_CUSTODIAL_WALLET = "non-custodial wallet".freeze - NON_TAXABLE_BROKERAGE_ACCOUNT = "non-taxable brokerage account".freeze - OTHER = "other".freeze - OTHER_ANNUITY = "other annuity".freeze - OTHER_INSURANCE = "other insurance".freeze - PENSION = "pension".freeze - PRIF = "prif".freeze - PROFIT_SHARING_PLAN = "profit sharing plan".freeze - QSHR = "qshr".freeze - RDSP = "rdsp".freeze - RESP = "resp".freeze - RETIREMENT = "retirement".freeze - RLIF = "rlif".freeze - ROTH = "roth".freeze - ROTH_401K = "roth 401k".freeze - RRIF = "rrif".freeze - RRSP = "rrsp".freeze - SARSEP = "sarsep".freeze - SEP_IRA = "sep ira".freeze - SIMPLE_IRA = "simple ira".freeze - SIPP = "sipp".freeze - STOCK_PLAN = "stock plan".freeze - TFSA = "tfsa".freeze - TRUST = "trust".freeze - UGMA = "ugma".freeze - UTMA = "utma".freeze - VARIABLE_ANNUITY = "variable annuity".freeze - ALL = "all".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/investment_filter.rb b/lib/plaid/models/investment_filter.rb deleted file mode 100644 index 4d6a6724e..000000000 --- a/lib/plaid/models/investment_filter.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A filter to apply to `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier). - class 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). - attr_accessor :account_subtypes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_subtypes' => :'account_subtypes' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_subtypes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_subtypes') - if (value = attributes[:'account_subtypes']).is_a?(Array) - self.account_subtypes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_subtypes.nil? - invalid_properties.push('invalid value for "account_subtypes", account_subtypes cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_subtypes.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_subtypes == o.account_subtypes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_subtypes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investment_holdings_get_request_options.rb b/lib/plaid/models/investment_holdings_get_request_options.rb deleted file mode 100644 index e2df61b97..000000000 --- a/lib/plaid/models/investment_holdings_get_request_options.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to filter `/investments/holdings/get` results. If provided, must not be `null`. - class InvestmentHoldingsGetRequestOptions - # An array of `account_id`s to retrieve for the Item. An error will be returned if a provided `account_id` is not associated with the Item. - attr_accessor :account_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_ids' => :'account_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentHoldingsGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentHoldingsGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_ids') - if (value = attributes[:'account_ids']).is_a?(Array) - self.account_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_ids == o.account_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investment_transaction.rb b/lib/plaid/models/investment_transaction.rb deleted file mode 100644 index 923ef8129..000000000 --- a/lib/plaid/models/investment_transaction.rb +++ /dev/null @@ -1,421 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A transaction within an investment account. - class InvestmentTransaction - # The ID of the Investment transaction, unique across all Plaid transactions. Like all Plaid identifiers, the `investment_transaction_id` is case sensitive. - attr_accessor :investment_transaction_id - - # A legacy field formerly used internally by Plaid to identify certain canceled transactions. - attr_accessor :cancel_transaction_id - - # The `account_id` of the account against which this transaction posted. - attr_accessor :account_id - - # The `security_id` to which this transaction is related. - attr_accessor :security_id - - # The [ISO 8601](https://wikipedia.org/wiki/ISO_8601) posting date for the transaction. - attr_accessor :date - - # The institution’s description of the transaction. - attr_accessor :name - - # The number of units of the security involved in this transaction. Positive for buy transactions; negative for sell transactions. - attr_accessor :quantity - - # The complete value of the transaction. Positive values when cash is debited, e.g. purchases of stock; negative values when cash is credited, e.g. sales of stock. Treatment remains the same for cash-only movements unassociated with securities. - attr_accessor :amount - - # The price of the security at which this transaction occurred. - attr_accessor :price - - # The combined value of all fees applied to this transaction - attr_accessor :fees - - attr_accessor :type - - attr_accessor :subtype - - # The ISO-4217 currency code of the transaction. Always `null` if `unofficial_currency_code` is non-`null`. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'investment_transaction_id' => :'investment_transaction_id', - :'cancel_transaction_id' => :'cancel_transaction_id', - :'account_id' => :'account_id', - :'security_id' => :'security_id', - :'date' => :'date', - :'name' => :'name', - :'quantity' => :'quantity', - :'amount' => :'amount', - :'price' => :'price', - :'fees' => :'fees', - :'type' => :'type', - :'subtype' => :'subtype', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'investment_transaction_id' => :'String', - :'cancel_transaction_id' => :'String', - :'account_id' => :'String', - :'security_id' => :'String', - :'date' => :'Date', - :'name' => :'String', - :'quantity' => :'Float', - :'amount' => :'Float', - :'price' => :'Float', - :'fees' => :'Float', - :'type' => :'InvestmentTransactionType', - :'subtype' => :'InvestmentTransactionSubtype', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'cancel_transaction_id', - :'security_id', - :'fees', - :'iso_currency_code', - :'unofficial_currency_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'investment_transaction_id') - self.investment_transaction_id = attributes[:'investment_transaction_id'] - end - - if attributes.key?(:'cancel_transaction_id') - self.cancel_transaction_id = attributes[:'cancel_transaction_id'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'security_id') - self.security_id = attributes[:'security_id'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'price') - self.price = attributes[:'price'] - end - - if attributes.key?(:'fees') - self.fees = attributes[:'fees'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'subtype') - self.subtype = attributes[:'subtype'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @investment_transaction_id.nil? - invalid_properties.push('invalid value for "investment_transaction_id", investment_transaction_id cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @date.nil? - invalid_properties.push('invalid value for "date", date cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @price.nil? - invalid_properties.push('invalid value for "price", price cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @subtype.nil? - invalid_properties.push('invalid value for "subtype", subtype cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @investment_transaction_id.nil? - return false if @account_id.nil? - return false if @date.nil? - return false if @name.nil? - return false if @quantity.nil? - return false if @amount.nil? - return false if @price.nil? - return false if @type.nil? - return false if @subtype.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - investment_transaction_id == o.investment_transaction_id && - cancel_transaction_id == o.cancel_transaction_id && - account_id == o.account_id && - security_id == o.security_id && - date == o.date && - name == o.name && - quantity == o.quantity && - amount == o.amount && - price == o.price && - fees == o.fees && - type == o.type && - subtype == o.subtype && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [investment_transaction_id, cancel_transaction_id, account_id, security_id, date, name, quantity, amount, price, fees, type, subtype, iso_currency_code, unofficial_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investment_transaction_subtype.rb b/lib/plaid/models/investment_transaction_subtype.rb deleted file mode 100644 index 6a88957cb..000000000 --- a/lib/plaid/models/investment_transaction_subtype.rb +++ /dev/null @@ -1,85 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class InvestmentTransactionSubtype - ACCOUNT_FEE = "account fee".freeze - ADJUSTMENT = "adjustment".freeze - ASSIGNMENT = "assignment".freeze - BUY = "buy".freeze - BUY_TO_COVER = "buy to cover".freeze - CONTRIBUTION = "contribution".freeze - DEPOSIT = "deposit".freeze - DISTRIBUTION = "distribution".freeze - DIVIDEND = "dividend".freeze - DIVIDEND_REINVESTMENT = "dividend reinvestment".freeze - EXERCISE = "exercise".freeze - EXPIRE = "expire".freeze - FUND_FEE = "fund fee".freeze - INTEREST = "interest".freeze - INTEREST_RECEIVABLE = "interest receivable".freeze - INTEREST_REINVESTMENT = "interest reinvestment".freeze - LEGAL_FEE = "legal fee".freeze - LOAN_PAYMENT = "loan payment".freeze - LONG_TERM_CAPITAL_GAIN = "long-term capital gain".freeze - LONG_TERM_CAPITAL_GAIN_REINVESTMENT = "long-term capital gain reinvestment".freeze - MANAGEMENT_FEE = "management fee".freeze - MARGIN_EXPENSE = "margin expense".freeze - MERGER = "merger".freeze - MISCELLANEOUS_FEE = "miscellaneous fee".freeze - NON_QUALIFIED_DIVIDEND = "non-qualified dividend".freeze - NON_RESIDENT_TAX = "non-resident tax".freeze - PENDING_CREDIT = "pending credit".freeze - PENDING_DEBIT = "pending debit".freeze - QUALIFIED_DIVIDEND = "qualified dividend".freeze - REBALANCE = "rebalance".freeze - RETURN_OF_PRINCIPAL = "return of principal".freeze - REQUEST = "request".freeze - SELL = "sell".freeze - SELL_SHORT = "sell short".freeze - SEND = "send".freeze - SHORT_TERM_CAPITAL_GAIN = "short-term capital gain".freeze - SHORT_TERM_CAPITAL_GAIN_REINVESTMENT = "short-term capital gain reinvestment".freeze - SPIN_OFF = "spin off".freeze - SPLIT = "split".freeze - STOCK_DISTRIBUTION = "stock distribution".freeze - TAX = "tax".freeze - TAX_WITHHELD = "tax withheld".freeze - TRADE = "trade".freeze - TRANSFER = "transfer".freeze - TRANSFER_FEE = "transfer fee".freeze - TRUST_FEE = "trust fee".freeze - UNQUALIFIED_GAIN = "unqualified gain".freeze - WITHDRAWAL = "withdrawal".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/investment_transaction_type.rb b/lib/plaid/models/investment_transaction_type.rb deleted file mode 100644 index c31142fd0..000000000 --- a/lib/plaid/models/investment_transaction_type.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class InvestmentTransactionType - BUY = "buy".freeze - SELL = "sell".freeze - CANCEL = "cancel".freeze - CASH = "cash".freeze - FEE = "fee".freeze - TRANSFER = "transfer".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/investments_auth_get_numbers.rb b/lib/plaid/models/investments_auth_get_numbers.rb deleted file mode 100644 index f71814942..000000000 --- a/lib/plaid/models/investments_auth_get_numbers.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Identifying information for transferring holdings to an investments account. - class InvestmentsAuthGetNumbers - attr_accessor :acats - - attr_accessor :aton - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'acats' => :'acats', - :'aton' => :'aton' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'acats' => :'Array', - :'aton' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentsAuthGetNumbers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentsAuthGetNumbers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'acats') - if (value = attributes[:'acats']).is_a?(Array) - self.acats = value - end - end - - if attributes.key?(:'aton') - if (value = attributes[:'aton']).is_a?(Array) - self.aton = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - acats == o.acats && - aton == o.aton - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [acats, aton].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investments_auth_get_request.rb b/lib/plaid/models/investments_auth_get_request.rb deleted file mode 100644 index 27071dc01..000000000 --- a/lib/plaid/models/investments_auth_get_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # InvestmentsAuthGetRequest defines the request schema for `/investments/auth/get` - class InvestmentsAuthGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'options' => :'InvestmentsAuthGetRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentsAuthGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentsAuthGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investments_auth_get_request_options.rb b/lib/plaid/models/investments_auth_get_request_options.rb deleted file mode 100644 index 9fa3284a6..000000000 --- a/lib/plaid/models/investments_auth_get_request_options.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to filter `/investments/auth/get` results. - class InvestmentsAuthGetRequestOptions - # An array of `account_id`s to retrieve for the Item. An error will be returned if a provided `account_id` is not associated with the Item. - attr_accessor :account_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_ids' => :'account_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentsAuthGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentsAuthGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_ids') - if (value = attributes[:'account_ids']).is_a?(Array) - self.account_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_ids == o.account_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investments_auth_get_response.rb b/lib/plaid/models/investments_auth_get_response.rb deleted file mode 100644 index 940e77bba..000000000 --- a/lib/plaid/models/investments_auth_get_response.rb +++ /dev/null @@ -1,322 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # InvestmentsAuthGetResponse defines the response schema for `/investments/auth/get` - class InvestmentsAuthGetResponse - # The accounts for which data is being retrieved - attr_accessor :accounts - - # The holdings belonging to investment accounts associated with the Item. Details of the securities in the holdings are provided in the `securities` field. - attr_accessor :holdings - - # Objects describing the securities held in the accounts associated with the Item. - attr_accessor :securities - - # Information about the account owners for the accounts associated with the Item. - attr_accessor :owners - - attr_accessor :numbers - - attr_accessor :item - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'accounts' => :'accounts', - :'holdings' => :'holdings', - :'securities' => :'securities', - :'owners' => :'owners', - :'numbers' => :'numbers', - :'item' => :'item', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'accounts' => :'Array', - :'holdings' => :'Array', - :'securities' => :'Array', - :'owners' => :'Array', - :'numbers' => :'InvestmentsAuthGetNumbers', - :'item' => :'Item', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentsAuthGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentsAuthGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - - if attributes.key?(:'holdings') - if (value = attributes[:'holdings']).is_a?(Array) - self.holdings = value - end - end - - if attributes.key?(:'securities') - if (value = attributes[:'securities']).is_a?(Array) - self.securities = value - end - end - - if attributes.key?(:'owners') - if (value = attributes[:'owners']).is_a?(Array) - self.owners = value - end - end - - if attributes.key?(:'numbers') - self.numbers = attributes[:'numbers'] - end - - if attributes.key?(:'item') - self.item = attributes[:'item'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @accounts.nil? - invalid_properties.push('invalid value for "accounts", accounts cannot be nil.') - end - - if @holdings.nil? - invalid_properties.push('invalid value for "holdings", holdings cannot be nil.') - end - - if @securities.nil? - invalid_properties.push('invalid value for "securities", securities cannot be nil.') - end - - if @owners.nil? - invalid_properties.push('invalid value for "owners", owners cannot be nil.') - end - - if @numbers.nil? - invalid_properties.push('invalid value for "numbers", numbers cannot be nil.') - end - - if @item.nil? - invalid_properties.push('invalid value for "item", item cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @accounts.nil? - return false if @holdings.nil? - return false if @securities.nil? - return false if @owners.nil? - return false if @numbers.nil? - return false if @item.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - accounts == o.accounts && - holdings == o.holdings && - securities == o.securities && - owners == o.owners && - numbers == o.numbers && - item == o.item && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [accounts, holdings, securities, owners, numbers, item, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investments_auth_owner.rb b/lib/plaid/models/investments_auth_owner.rb deleted file mode 100644 index 2419b6b3b..000000000 --- a/lib/plaid/models/investments_auth_owner.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information on the ownership of an investments account - class InvestmentsAuthOwner - # The ID of the account that this identity information pertains to - attr_accessor :account_id - - # A list of names associated with the account by the financial institution. In the case of a joint account, Plaid will make a best effort to report the names of all account holders. If an Item contains multiple accounts with different owner names, some institutions will report all names associated with the Item in each account's `names` array. - attr_accessor :names - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'names' => :'names' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'names' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentsAuthOwner` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentsAuthOwner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'names') - if (value = attributes[:'names']).is_a?(Array) - self.names = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - names == o.names - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, names].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investments_default_update_webhook.rb b/lib/plaid/models/investments_default_update_webhook.rb deleted file mode 100644 index f1d7954ae..000000000 --- a/lib/plaid/models/investments_default_update_webhook.rb +++ /dev/null @@ -1,332 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when new transactions have been detected on an investment account. - class InvestmentsDefaultUpdateWebhook - # `INVESTMENTS_TRANSACTIONS` - attr_accessor :webhook_type - - # `DEFAULT_UPDATE` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :error - - # The number of new transactions reported since the last time this webhook was fired. - attr_accessor :new_investments_transactions - - # The number of canceled transactions reported since the last time this webhook was fired. - attr_accessor :canceled_investments_transactions - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'error' => :'error', - :'new_investments_transactions' => :'new_investments_transactions', - :'canceled_investments_transactions' => :'canceled_investments_transactions', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'error' => :'PlaidError', - :'new_investments_transactions' => :'Float', - :'canceled_investments_transactions' => :'Float', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentsDefaultUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentsDefaultUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'new_investments_transactions') - self.new_investments_transactions = attributes[:'new_investments_transactions'] - end - - if attributes.key?(:'canceled_investments_transactions') - self.canceled_investments_transactions = attributes[:'canceled_investments_transactions'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @new_investments_transactions.nil? - invalid_properties.push('invalid value for "new_investments_transactions", new_investments_transactions cannot be nil.') - end - - if @canceled_investments_transactions.nil? - invalid_properties.push('invalid value for "canceled_investments_transactions", canceled_investments_transactions cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @new_investments_transactions.nil? - return false if @canceled_investments_transactions.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - error == o.error && - new_investments_transactions == o.new_investments_transactions && - canceled_investments_transactions == o.canceled_investments_transactions && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, error, new_investments_transactions, canceled_investments_transactions, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investments_historical_update_webhook.rb b/lib/plaid/models/investments_historical_update_webhook.rb deleted file mode 100644 index 6718a3f41..000000000 --- a/lib/plaid/models/investments_historical_update_webhook.rb +++ /dev/null @@ -1,332 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired after an asynchronous extraction on an investments account. - class InvestmentsHistoricalUpdateWebhook - # `INVESTMENTS_TRANSACTIONS` - attr_accessor :webhook_type - - # `HISTORICAL_UPDATE` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :error - - # The number of new transactions reported since the last time this webhook was fired. - attr_accessor :new_investments_transactions - - # The number of canceled transactions reported since the last time this webhook was fired. - attr_accessor :canceled_investments_transactions - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'error' => :'error', - :'new_investments_transactions' => :'new_investments_transactions', - :'canceled_investments_transactions' => :'canceled_investments_transactions', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'error' => :'PlaidError', - :'new_investments_transactions' => :'Float', - :'canceled_investments_transactions' => :'Float', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentsHistoricalUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentsHistoricalUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'new_investments_transactions') - self.new_investments_transactions = attributes[:'new_investments_transactions'] - end - - if attributes.key?(:'canceled_investments_transactions') - self.canceled_investments_transactions = attributes[:'canceled_investments_transactions'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @new_investments_transactions.nil? - invalid_properties.push('invalid value for "new_investments_transactions", new_investments_transactions cannot be nil.') - end - - if @canceled_investments_transactions.nil? - invalid_properties.push('invalid value for "canceled_investments_transactions", canceled_investments_transactions cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @new_investments_transactions.nil? - return false if @canceled_investments_transactions.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - error == o.error && - new_investments_transactions == o.new_investments_transactions && - canceled_investments_transactions == o.canceled_investments_transactions && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, error, new_investments_transactions, canceled_investments_transactions, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investments_holdings_get_request.rb b/lib/plaid/models/investments_holdings_get_request.rb deleted file mode 100644 index 1f5cc6e95..000000000 --- a/lib/plaid/models/investments_holdings_get_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # InvestmentsHoldingsGetRequest defines the request schema for `/investments/holdings/get` - class InvestmentsHoldingsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'options' => :'InvestmentHoldingsGetRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentsHoldingsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentsHoldingsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investments_holdings_get_response.rb b/lib/plaid/models/investments_holdings_get_response.rb deleted file mode 100644 index 0b59d4a63..000000000 --- a/lib/plaid/models/investments_holdings_get_response.rb +++ /dev/null @@ -1,301 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # InvestmentsHoldingsGetResponse defines the response schema for `/investments/holdings/get` - class InvestmentsHoldingsGetResponse - # The accounts associated with the Item - attr_accessor :accounts - - # The holdings belonging to investment accounts associated with the Item. Details of the securities in the holdings are provided in the `securities` field. - attr_accessor :holdings - - # Objects describing the securities held in the accounts associated with the Item. - attr_accessor :securities - - attr_accessor :item - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # When true, this field indicates that the Item's portfolio was manually created with the Investments Fallback flow. - attr_accessor :is_investments_fallback_item - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'accounts' => :'accounts', - :'holdings' => :'holdings', - :'securities' => :'securities', - :'item' => :'item', - :'request_id' => :'request_id', - :'is_investments_fallback_item' => :'is_investments_fallback_item' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'accounts' => :'Array', - :'holdings' => :'Array', - :'securities' => :'Array', - :'item' => :'Item', - :'request_id' => :'String', - :'is_investments_fallback_item' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentsHoldingsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentsHoldingsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - - if attributes.key?(:'holdings') - if (value = attributes[:'holdings']).is_a?(Array) - self.holdings = value - end - end - - if attributes.key?(:'securities') - if (value = attributes[:'securities']).is_a?(Array) - self.securities = value - end - end - - if attributes.key?(:'item') - self.item = attributes[:'item'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'is_investments_fallback_item') - self.is_investments_fallback_item = attributes[:'is_investments_fallback_item'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @accounts.nil? - invalid_properties.push('invalid value for "accounts", accounts cannot be nil.') - end - - if @holdings.nil? - invalid_properties.push('invalid value for "holdings", holdings cannot be nil.') - end - - if @securities.nil? - invalid_properties.push('invalid value for "securities", securities cannot be nil.') - end - - if @item.nil? - invalid_properties.push('invalid value for "item", item cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @accounts.nil? - return false if @holdings.nil? - return false if @securities.nil? - return false if @item.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - accounts == o.accounts && - holdings == o.holdings && - securities == o.securities && - item == o.item && - request_id == o.request_id && - is_investments_fallback_item == o.is_investments_fallback_item - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [accounts, holdings, securities, item, request_id, is_investments_fallback_item].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investments_refresh_request.rb b/lib/plaid/models/investments_refresh_request.rb deleted file mode 100644 index f33fa3660..000000000 --- a/lib/plaid/models/investments_refresh_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # InvestmentsRefreshRequest defines the request schema for `/investments/refresh` - class InvestmentsRefreshRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'access_token' => :'access_token', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'access_token' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentsRefreshRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentsRefreshRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - access_token == o.access_token && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, access_token, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investments_refresh_response.rb b/lib/plaid/models/investments_refresh_response.rb deleted file mode 100644 index 6e0840ce8..000000000 --- a/lib/plaid/models/investments_refresh_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # InvestmentsRefreshResponse defines the response schema for `/investments/refresh` - class InvestmentsRefreshResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentsRefreshResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentsRefreshResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investments_transactions_get_request.rb b/lib/plaid/models/investments_transactions_get_request.rb deleted file mode 100644 index 2042602fb..000000000 --- a/lib/plaid/models/investments_transactions_get_request.rb +++ /dev/null @@ -1,285 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # InvestmentsTransactionsGetRequest defines the request schema for `/investments/transactions/get` - class InvestmentsTransactionsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # The earliest date for which to fetch transaction history. Dates should be formatted as YYYY-MM-DD. - attr_accessor :start_date - - # The most recent date for which to fetch transaction history. Dates should be formatted as YYYY-MM-DD. - attr_accessor :end_date - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'start_date' => :'Date', - :'end_date' => :'Date', - :'options' => :'InvestmentsTransactionsGetRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentsTransactionsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentsTransactionsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @start_date.nil? - invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') - end - - if @end_date.nil? - invalid_properties.push('invalid value for "end_date", end_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @start_date.nil? - return false if @end_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - start_date == o.start_date && - end_date == o.end_date && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, start_date, end_date, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investments_transactions_get_request_options.rb b/lib/plaid/models/investments_transactions_get_request_options.rb deleted file mode 100644 index db256a979..000000000 --- a/lib/plaid/models/investments_transactions_get_request_options.rb +++ /dev/null @@ -1,302 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to filter `/investments/transactions/get` results. If provided, must be non-`null`. - class InvestmentsTransactionsGetRequestOptions - # An array of `account_ids` to retrieve for the Item. - attr_accessor :account_ids - - # The number of transactions to fetch. - attr_accessor :count - - # The number of transactions to skip when fetching transaction history - attr_accessor :offset - - # 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. - attr_accessor :async_update - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_ids' => :'account_ids', - :'count' => :'count', - :'offset' => :'offset', - :'async_update' => :'async_update' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_ids' => :'Array', - :'count' => :'Integer', - :'offset' => :'Integer', - :'async_update' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentsTransactionsGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentsTransactionsGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_ids') - if (value = attributes[:'account_ids']).is_a?(Array) - self.account_ids = value - end - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 100 - end - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - else - self.offset = 0 - end - - if attributes.key?(:'async_update') - self.async_update = attributes[:'async_update'] - else - self.async_update = false - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@count.nil? && @count > 500 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 500.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - if !@offset.nil? && @offset < 0 - invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@count.nil? && @count > 500 - return false if !@count.nil? && @count < 1 - return false if !@offset.nil? && @offset < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 500 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 500.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Custom attribute writer method with validation - # @param [Object] offset Value to be assigned - def offset=(offset) - if !offset.nil? && offset < 0 - fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.' - end - - - @offset = offset - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_ids == o.account_ids && - count == o.count && - offset == o.offset && - async_update == o.async_update - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_ids, count, offset, async_update].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investments_transactions_get_response.rb b/lib/plaid/models/investments_transactions_get_response.rb deleted file mode 100644 index f13bed69f..000000000 --- a/lib/plaid/models/investments_transactions_get_response.rb +++ /dev/null @@ -1,316 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # InvestmentsTransactionsGetResponse defines the response schema for `/investments/transactions/get` - class InvestmentsTransactionsGetResponse - attr_accessor :item - - # The accounts for which transaction history is being fetched. - attr_accessor :accounts - - # All securities for which there is a corresponding transaction being fetched. - attr_accessor :securities - - # The transactions being fetched - attr_accessor :investment_transactions - - # The total number of transactions available within the date range specified. If `total_investment_transactions` is larger than the size of the `transactions` array, more transactions are available and can be fetched via manipulating the `offset` parameter. - attr_accessor :total_investment_transactions - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # When true, this field indicates that the Item's portfolio was manually created with the Investments Fallback flow. - attr_accessor :is_investments_fallback_item - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item' => :'item', - :'accounts' => :'accounts', - :'securities' => :'securities', - :'investment_transactions' => :'investment_transactions', - :'total_investment_transactions' => :'total_investment_transactions', - :'request_id' => :'request_id', - :'is_investments_fallback_item' => :'is_investments_fallback_item' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item' => :'Item', - :'accounts' => :'Array', - :'securities' => :'Array', - :'investment_transactions' => :'Array', - :'total_investment_transactions' => :'Integer', - :'request_id' => :'String', - :'is_investments_fallback_item' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentsTransactionsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentsTransactionsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item') - self.item = attributes[:'item'] - end - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - - if attributes.key?(:'securities') - if (value = attributes[:'securities']).is_a?(Array) - self.securities = value - end - end - - if attributes.key?(:'investment_transactions') - if (value = attributes[:'investment_transactions']).is_a?(Array) - self.investment_transactions = value - end - end - - if attributes.key?(:'total_investment_transactions') - self.total_investment_transactions = attributes[:'total_investment_transactions'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'is_investments_fallback_item') - self.is_investments_fallback_item = attributes[:'is_investments_fallback_item'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item.nil? - invalid_properties.push('invalid value for "item", item cannot be nil.') - end - - if @accounts.nil? - invalid_properties.push('invalid value for "accounts", accounts cannot be nil.') - end - - if @securities.nil? - invalid_properties.push('invalid value for "securities", securities cannot be nil.') - end - - if @investment_transactions.nil? - invalid_properties.push('invalid value for "investment_transactions", investment_transactions cannot be nil.') - end - - if @total_investment_transactions.nil? - invalid_properties.push('invalid value for "total_investment_transactions", total_investment_transactions cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item.nil? - return false if @accounts.nil? - return false if @securities.nil? - return false if @investment_transactions.nil? - return false if @total_investment_transactions.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item == o.item && - accounts == o.accounts && - securities == o.securities && - investment_transactions == o.investment_transactions && - total_investment_transactions == o.total_investment_transactions && - request_id == o.request_id && - is_investments_fallback_item == o.is_investments_fallback_item - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item, accounts, securities, investment_transactions, total_investment_transactions, request_id, is_investments_fallback_item].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/investments_transactions_override.rb b/lib/plaid/models/investments_transactions_override.rb deleted file mode 100644 index 9c9f91d55..000000000 --- a/lib/plaid/models/investments_transactions_override.rb +++ /dev/null @@ -1,320 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specify the list of investments transactions on the account. - class InvestmentsTransactionsOverride - # Posting date for the transaction. Must be formatted as an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) date. - attr_accessor :date - - # The institution's description of the transaction. - attr_accessor :name - - # The number of units of the security involved in this transaction. Must be positive if the type is a buy and negative if the type is a sell. - attr_accessor :quantity - - # The price of the security at which this transaction occurred. - attr_accessor :price - - # The combined value of all fees applied to this transaction. - attr_accessor :fees - - # The type of the investment transaction. Possible values are: `buy`: Buying an investment `sell`: Selling an investment `cash`: Activity that modifies a cash position `fee`: A fee on the account `transfer`: Activity that modifies a position, but not through buy/sell activity e.g. options exercise, portfolio transfer - attr_accessor :type - - # Either a valid `iso_currency_code` or `unofficial_currency_code` - attr_accessor :currency - - attr_accessor :security - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'date' => :'date', - :'name' => :'name', - :'quantity' => :'quantity', - :'price' => :'price', - :'fees' => :'fees', - :'type' => :'type', - :'currency' => :'currency', - :'security' => :'security' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'date' => :'Date', - :'name' => :'String', - :'quantity' => :'Float', - :'price' => :'Float', - :'fees' => :'Float', - :'type' => :'String', - :'currency' => :'String', - :'security' => :'SecurityOverride' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::InvestmentsTransactionsOverride` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::InvestmentsTransactionsOverride`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'price') - self.price = attributes[:'price'] - end - - if attributes.key?(:'fees') - self.fees = attributes[:'fees'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'currency') - self.currency = attributes[:'currency'] - end - - if attributes.key?(:'security') - self.security = attributes[:'security'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @date.nil? - invalid_properties.push('invalid value for "date", date cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @quantity.nil? - invalid_properties.push('invalid value for "quantity", quantity cannot be nil.') - end - - if @price.nil? - invalid_properties.push('invalid value for "price", price cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @currency.nil? - invalid_properties.push('invalid value for "currency", currency cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @date.nil? - return false if @name.nil? - return false if @quantity.nil? - return false if @price.nil? - return false if @type.nil? - return false if @currency.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - date == o.date && - name == o.name && - quantity == o.quantity && - price == o.price && - fees == o.fees && - type == o.type && - currency == o.currency && - security == o.security - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [date, name, quantity, price, fees, type, currency, security].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/iso_currency_code.rb b/lib/plaid/models/iso_currency_code.rb deleted file mode 100644 index 67520583d..000000000 --- a/lib/plaid/models/iso_currency_code.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class ISOCurrencyCode - USD = "USD".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/issuing_country.rb b/lib/plaid/models/issuing_country.rb deleted file mode 100644 index e36eafaf6..000000000 --- a/lib/plaid/models/issuing_country.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class IssuingCountry - MATCH = "match".freeze - NO_MATCH = "no_match".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/item.rb b/lib/plaid/models/item.rb deleted file mode 100644 index 01a9ed095..000000000 --- a/lib/plaid/models/item.rb +++ /dev/null @@ -1,376 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Metadata about the Item. - class Item - # 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. - attr_accessor :item_id - - # The Plaid Institution ID associated with the Item. Field is `null` for Items created via Same Day Micro-deposits. - attr_accessor :institution_id - - # The URL registered to receive webhooks for the Item. - attr_accessor :webhook - - attr_accessor :error - - # 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`. - attr_accessor :available_products - - # 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. - attr_accessor :billed_products - - # 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`. - attr_accessor :products - - # 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. - attr_accessor :consented_products - - # 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. - attr_accessor :consent_expiration_time - - # 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 `user_present_required` - Item requires user interaction to be updated - attr_accessor :update_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_id' => :'item_id', - :'institution_id' => :'institution_id', - :'webhook' => :'webhook', - :'error' => :'error', - :'available_products' => :'available_products', - :'billed_products' => :'billed_products', - :'products' => :'products', - :'consented_products' => :'consented_products', - :'consent_expiration_time' => :'consent_expiration_time', - :'update_type' => :'update_type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_id' => :'String', - :'institution_id' => :'String', - :'webhook' => :'String', - :'error' => :'PlaidError', - :'available_products' => :'Array', - :'billed_products' => :'Array', - :'products' => :'Array', - :'consented_products' => :'Array', - :'consent_expiration_time' => :'Time', - :'update_type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'institution_id', - :'webhook', - :'error', - :'consent_expiration_time', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Item` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Item`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'available_products') - if (value = attributes[:'available_products']).is_a?(Array) - self.available_products = value - end - end - - if attributes.key?(:'billed_products') - if (value = attributes[:'billed_products']).is_a?(Array) - self.billed_products = value - end - end - - if attributes.key?(:'products') - if (value = attributes[:'products']).is_a?(Array) - self.products = value - end - end - - if attributes.key?(:'consented_products') - if (value = attributes[:'consented_products']).is_a?(Array) - self.consented_products = value - end - end - - if attributes.key?(:'consent_expiration_time') - self.consent_expiration_time = attributes[:'consent_expiration_time'] - end - - if attributes.key?(:'update_type') - self.update_type = attributes[:'update_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @available_products.nil? - invalid_properties.push('invalid value for "available_products", available_products cannot be nil.') - end - - if @billed_products.nil? - invalid_properties.push('invalid value for "billed_products", billed_products cannot be nil.') - end - - if @update_type.nil? - invalid_properties.push('invalid value for "update_type", update_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_id.nil? - return false if @available_products.nil? - return false if @billed_products.nil? - return false if @update_type.nil? - update_type_validator = EnumAttributeValidator.new('String', ["background", "user_present_required"]) - return false unless update_type_validator.valid?(@update_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] update_type Object to be assigned - def update_type=(update_type) - validator = EnumAttributeValidator.new('String', ["background", "user_present_required"]) - unless validator.valid?(update_type) - fail ArgumentError, "invalid value for \"update_type\", must be one of #{validator.allowable_values}." - end - @update_type = update_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_id == o.item_id && - institution_id == o.institution_id && - webhook == o.webhook && - error == o.error && - available_products == o.available_products && - billed_products == o.billed_products && - products == o.products && - consented_products == o.consented_products && - consent_expiration_time == o.consent_expiration_time && - update_type == o.update_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_id, institution_id, webhook, error, available_products, billed_products, products, consented_products, consent_expiration_time, update_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_access_token_invalidate_request.rb b/lib/plaid/models/item_access_token_invalidate_request.rb deleted file mode 100644 index 076f14acf..000000000 --- a/lib/plaid/models/item_access_token_invalidate_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemAccessTokenInvalidateRequest defines the request schema for `/item/access_token/invalidate` - class ItemAccessTokenInvalidateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemAccessTokenInvalidateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemAccessTokenInvalidateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_access_token_invalidate_response.rb b/lib/plaid/models/item_access_token_invalidate_response.rb deleted file mode 100644 index f9e3baf7a..000000000 --- a/lib/plaid/models/item_access_token_invalidate_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemAccessTokenInvalidateResponse defines the response schema for `/item/access_token/invalidate` - class ItemAccessTokenInvalidateResponse - # The access token associated with the Item data is being requested for. - attr_accessor :new_access_token - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'new_access_token' => :'new_access_token', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'new_access_token' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemAccessTokenInvalidateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemAccessTokenInvalidateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'new_access_token') - self.new_access_token = attributes[:'new_access_token'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @new_access_token.nil? - invalid_properties.push('invalid value for "new_access_token", new_access_token cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @new_access_token.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - new_access_token == o.new_access_token && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [new_access_token, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_activity_list_request.rb b/lib/plaid/models/item_activity_list_request.rb deleted file mode 100644 index 01b68f8d9..000000000 --- a/lib/plaid/models/item_activity_list_request.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request to list a historical log of user consent events. - class ItemActivityListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Cursor used for pagination. - attr_accessor :cursor - - attr_accessor :count - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'cursor' => :'cursor', - :'count' => :'count' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'cursor' => :'String', - :'count' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemActivityListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemActivityListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 50 - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@count.nil? && @count > 50 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 50.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@count.nil? && @count > 50 - return false if !@count.nil? && @count < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 50 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 50.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - cursor == o.cursor && - count == o.count - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, cursor, count].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_activity_list_response.rb b/lib/plaid/models/item_activity_list_response.rb deleted file mode 100644 index 52ede35fc..000000000 --- a/lib/plaid/models/item_activity_list_response.rb +++ /dev/null @@ -1,270 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Describes a historical log of user consent events. - class ItemActivityListResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # A list of activities. - attr_accessor :activities - - # An array of objects containing timestamps for the last time each data type was accessed per application. - attr_accessor :last_data_access_times - - # Cursor used for pagination. - attr_accessor :cursor - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id', - :'activities' => :'activities', - :'last_data_access_times' => :'last_data_access_times', - :'cursor' => :'cursor' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String', - :'activities' => :'Array', - :'last_data_access_times' => :'Array', - :'cursor' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemActivityListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemActivityListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'activities') - if (value = attributes[:'activities']).is_a?(Array) - self.activities = value - end - end - - if attributes.key?(:'last_data_access_times') - if (value = attributes[:'last_data_access_times']).is_a?(Array) - self.last_data_access_times = value - end - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - if @activities.nil? - invalid_properties.push('invalid value for "activities", activities cannot be nil.') - end - - if @last_data_access_times.nil? - invalid_properties.push('invalid value for "last_data_access_times", last_data_access_times cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - return false if @activities.nil? - return false if @last_data_access_times.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id && - activities == o.activities && - last_data_access_times == o.last_data_access_times && - cursor == o.cursor - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id, activities, last_data_access_times, cursor].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_application_list_request.rb b/lib/plaid/models/item_application_list_request.rb deleted file mode 100644 index a46db99fc..000000000 --- a/lib/plaid/models/item_application_list_request.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request to list connected applications for a user. - class ItemApplicationListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'access_token' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemApplicationListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemApplicationListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_application_list_response.rb b/lib/plaid/models/item_application_list_response.rb deleted file mode 100644 index f4df49714..000000000 --- a/lib/plaid/models/item_application_list_response.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Describes the connected application for a particular end user. - class ItemApplicationListResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # A list of connected applications. - attr_accessor :applications - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id', - :'applications' => :'applications' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String', - :'applications' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemApplicationListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemApplicationListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'applications') - if (value = attributes[:'applications']).is_a?(Array) - self.applications = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @applications.nil? - invalid_properties.push('invalid value for "applications", applications cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @applications.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id && - applications == o.applications - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id, applications].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_application_list_user_auth.rb b/lib/plaid/models/item_application_list_user_auth.rb deleted file mode 100644 index ed3d93330..000000000 --- a/lib/plaid/models/item_application_list_user_auth.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # User authentication parameters, for clients making a request without an `access_token`. This is only allowed for select clients and will not be supported in the future. Most clients should call /item/import to obtain an access token before making a request. - class ItemApplicationListUserAuth - # Account username. - attr_accessor :user_id - - # Account username hashed by FI. - attr_accessor :fi_username_hash - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'user_id', - :'fi_username_hash' => :'fi_username_hash' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'fi_username_hash' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'user_id', - :'fi_username_hash' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemApplicationListUserAuth` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemApplicationListUserAuth`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'fi_username_hash') - self.fi_username_hash = attributes[:'fi_username_hash'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - fi_username_hash == o.fi_username_hash - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, fi_username_hash].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_application_scopes_update_request.rb b/lib/plaid/models/item_application_scopes_update_request.rb deleted file mode 100644 index ed7f79712..000000000 --- a/lib/plaid/models/item_application_scopes_update_request.rb +++ /dev/null @@ -1,321 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemApplicationScopesUpdateRequest defines the request schema for `/item/application/scopes/update` - class ItemApplicationScopesUpdateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # This field will map to the application ID that is returned from /item/application/list, or provided to the institution in an oauth redirect. - attr_accessor :application_id - - attr_accessor :scopes - - # When scopes are updated during enrollment, this field must be populated with the state sent to the partner in the OAuth Login URI. This field is required when the context is `ENROLLMENT`. - attr_accessor :state - - attr_accessor :context - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'application_id' => :'application_id', - :'scopes' => :'scopes', - :'state' => :'state', - :'context' => :'context' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'application_id' => :'String', - :'scopes' => :'Scopes', - :'state' => :'String', - :'context' => :'ScopesContext' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemApplicationScopesUpdateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemApplicationScopesUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'scopes') - self.scopes = attributes[:'scopes'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'context') - self.context = attributes[:'context'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @application_id.nil? - invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') - end - - if @scopes.nil? - invalid_properties.push('invalid value for "scopes", scopes cannot be nil.') - end - - if @context.nil? - invalid_properties.push('invalid value for "context", context cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @application_id.nil? - return false if @scopes.nil? - return false if @context.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - application_id == o.application_id && - scopes == o.scopes && - state == o.state && - context == o.context - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, application_id, scopes, state, context].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_application_scopes_update_response.rb b/lib/plaid/models/item_application_scopes_update_response.rb deleted file mode 100644 index 9f843dcf0..000000000 --- a/lib/plaid/models/item_application_scopes_update_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemApplicationScopesUpdateResponse defines the response schema for `/item/application/scopes/update` - class ItemApplicationScopesUpdateResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemApplicationScopesUpdateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemApplicationScopesUpdateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_application_unlink_request.rb b/lib/plaid/models/item_application_unlink_request.rb deleted file mode 100644 index efb874a65..000000000 --- a/lib/plaid/models/item_application_unlink_request.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemApplicationUnlinkRequest defines the request schema for `/item/application/unlink/` - class ItemApplicationUnlinkRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # This field will map to the application ID that is returned from /item/application/list, or provided to the institution in an oauth redirect. - attr_accessor :application_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'application_id' => :'application_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'application_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemApplicationUnlinkRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemApplicationUnlinkRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @application_id.nil? - invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @application_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - application_id == o.application_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, application_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_application_unlink_response.rb b/lib/plaid/models/item_application_unlink_response.rb deleted file mode 100644 index fc9b993a7..000000000 --- a/lib/plaid/models/item_application_unlink_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemApplicationUnlinkResponse defines the response schema for `/item/application/unlink` - class ItemApplicationUnlinkResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemApplicationUnlinkResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemApplicationUnlinkResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_error_webhook.rb b/lib/plaid/models/item_error_webhook.rb deleted file mode 100644 index 4c47a9f7a..000000000 --- a/lib/plaid/models/item_error_webhook.rb +++ /dev/null @@ -1,302 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when an error is encountered with an Item. The error can be resolved by having the user go through Link’s update mode. - class ItemErrorWebhook - # `ITEM` - attr_accessor :webhook_type - - # `ERROR` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :error - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'error' => :'error', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'error' => :'PlaidError', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemErrorWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemErrorWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - error == o.error && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, error, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_get_request.rb b/lib/plaid/models/item_get_request.rb deleted file mode 100644 index b006124cf..000000000 --- a/lib/plaid/models/item_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemGetRequest defines the request schema for `/item/get` - class ItemGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_get_response.rb b/lib/plaid/models/item_get_response.rb deleted file mode 100644 index 08e540842..000000000 --- a/lib/plaid/models/item_get_response.rb +++ /dev/null @@ -1,250 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemGetResponse defines the response schema for `/item/get` and `/item/webhook/update` - class ItemGetResponse - attr_accessor :item - - attr_accessor :status - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item' => :'item', - :'status' => :'status', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item' => :'Item', - :'status' => :'ItemStatusNullable', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'status', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item') - self.item = attributes[:'item'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item.nil? - invalid_properties.push('invalid value for "item", item cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item == o.item && - status == o.status && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item, status, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_import_request.rb b/lib/plaid/models/item_import_request.rb deleted file mode 100644 index 888359e11..000000000 --- a/lib/plaid/models/item_import_request.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemImportRequest defines the request schema for `/item/import` - class ItemImportRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Array of product strings - attr_accessor :products - - attr_accessor :user_auth - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'products' => :'products', - :'user_auth' => :'user_auth', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'products' => :'Array', - :'user_auth' => :'ItemImportRequestUserAuth', - :'options' => :'ItemImportRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemImportRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemImportRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'products') - if (value = attributes[:'products']).is_a?(Array) - self.products = value - end - end - - if attributes.key?(:'user_auth') - self.user_auth = attributes[:'user_auth'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @products.nil? - invalid_properties.push('invalid value for "products", products cannot be nil.') - end - - - if @products.length < 1 - invalid_properties.push('invalid value for "products", number of items must be greater than or equal to 1.') - end - - if @user_auth.nil? - invalid_properties.push('invalid value for "user_auth", user_auth cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @products.nil? - return false if @products.length < 1 - return false if @user_auth.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] products Value to be assigned - def products=(products) - if products.nil? - fail ArgumentError, 'products cannot be nil' - end - - - if products.length < 1 - fail ArgumentError, 'invalid value for "products", number of items must be greater than or equal to 1.' - end - - @products = products - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - products == o.products && - user_auth == o.user_auth && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, products, user_auth, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_import_request_options.rb b/lib/plaid/models/item_import_request_options.rb deleted file mode 100644 index c09408b6c..000000000 --- a/lib/plaid/models/item_import_request_options.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to configure `/item/import` request. - class ItemImportRequestOptions - # Specifies a webhook URL to associate with an Item. Plaid fires a webhook if credentials fail. - attr_accessor :webhook - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook' => :'webhook' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemImportRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemImportRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook == o.webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_import_request_user_auth.rb b/lib/plaid/models/item_import_request_user_auth.rb deleted file mode 100644 index 9dbe80c3a..000000000 --- a/lib/plaid/models/item_import_request_user_auth.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Object of user ID and auth token pair, permitting Plaid to aggregate a user’s accounts - class ItemImportRequestUserAuth - # Opaque user identifier - attr_accessor :user_id - - # Authorization token Plaid will use to aggregate this user’s accounts - attr_accessor :auth_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'user_id', - :'auth_token' => :'auth_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'auth_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemImportRequestUserAuth` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemImportRequestUserAuth`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'auth_token') - self.auth_token = attributes[:'auth_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_id.nil? - invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') - end - - if @auth_token.nil? - invalid_properties.push('invalid value for "auth_token", auth_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_id.nil? - return false if @auth_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - auth_token == o.auth_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, auth_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_import_response.rb b/lib/plaid/models/item_import_response.rb deleted file mode 100644 index a82a5970a..000000000 --- a/lib/plaid/models/item_import_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemImportResponse defines the response schema for `/item/import` - class ItemImportResponse - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'access_token' => :'access_token', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'access_token' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemImportResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemImportResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - access_token == o.access_token && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [access_token, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_login_repaired_webhook.rb b/lib/plaid/models/item_login_repaired_webhook.rb deleted file mode 100644 index b06c1f91f..000000000 --- a/lib/plaid/models/item_login_repaired_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class ItemLoginRepairedWebhook - # `ITEM` - attr_accessor :webhook_type - - # `LOGIN_REPAIRED` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemLoginRepairedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemLoginRepairedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_product_ready_webhook.rb b/lib/plaid/models/item_product_ready_webhook.rb deleted file mode 100644 index 345b1c09a..000000000 --- a/lib/plaid/models/item_product_ready_webhook.rb +++ /dev/null @@ -1,302 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired once Plaid calculates income from an Item. - class ItemProductReadyWebhook - # `INCOME` - attr_accessor :webhook_type - - # `PRODUCT_READY` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :error - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'error' => :'error', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'error' => :'PlaidError', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemProductReadyWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemProductReadyWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - error == o.error && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, error, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_public_token_create_request.rb b/lib/plaid/models/item_public_token_create_request.rb deleted file mode 100644 index 55d65e7ee..000000000 --- a/lib/plaid/models/item_public_token_create_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemPublicTokenCreateRequest defines the request schema for `/item/public_token/create` - class ItemPublicTokenCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemPublicTokenCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemPublicTokenCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_public_token_create_response.rb b/lib/plaid/models/item_public_token_create_response.rb deleted file mode 100644 index 944987862..000000000 --- a/lib/plaid/models/item_public_token_create_response.rb +++ /dev/null @@ -1,250 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemPublicTokenCreateResponse defines the response schema for `/item/public_token/create` - class ItemPublicTokenCreateResponse - # A `public_token` for the particular Item corresponding to the specified `access_token` - attr_accessor :public_token - - attr_accessor :expiration - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'public_token' => :'public_token', - :'expiration' => :'expiration', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'public_token' => :'String', - :'expiration' => :'Time', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemPublicTokenCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemPublicTokenCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'public_token') - self.public_token = attributes[:'public_token'] - end - - if attributes.key?(:'expiration') - self.expiration = attributes[:'expiration'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @public_token.nil? - invalid_properties.push('invalid value for "public_token", public_token cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @public_token.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - public_token == o.public_token && - expiration == o.expiration && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [public_token, expiration, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_public_token_exchange_request.rb b/lib/plaid/models/item_public_token_exchange_request.rb deleted file mode 100644 index 19c31f38d..000000000 --- a/lib/plaid/models/item_public_token_exchange_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemPublicTokenExchangeRequest defines the request schema for `/item/public_token/exchange` - class ItemPublicTokenExchangeRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your `public_token`, obtained from the Link `onSuccess` callback or `/sandbox/item/public_token/create`. - attr_accessor :public_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'public_token' => :'public_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'public_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemPublicTokenExchangeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemPublicTokenExchangeRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'public_token') - self.public_token = attributes[:'public_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @public_token.nil? - invalid_properties.push('invalid value for "public_token", public_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @public_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - public_token == o.public_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, public_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_public_token_exchange_response.rb b/lib/plaid/models/item_public_token_exchange_response.rb deleted file mode 100644 index 90e88a032..000000000 --- a/lib/plaid/models/item_public_token_exchange_response.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemPublicTokenExchangeResponse defines the response schema for `/item/public_token/exchange` - class ItemPublicTokenExchangeResponse - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # The `item_id` value of the Item associated with the returned `access_token` - attr_accessor :item_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'access_token' => :'access_token', - :'item_id' => :'item_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'access_token' => :'String', - :'item_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemPublicTokenExchangeResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemPublicTokenExchangeResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @item_id.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - access_token == o.access_token && - item_id == o.item_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [access_token, item_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_remove_request.rb b/lib/plaid/models/item_remove_request.rb deleted file mode 100644 index fc86af261..000000000 --- a/lib/plaid/models/item_remove_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemRemoveRequest defines the request schema for `/item/remove` - class ItemRemoveRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemRemoveRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemRemoveRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_remove_response.rb b/lib/plaid/models/item_remove_response.rb deleted file mode 100644 index eb22a9bf1..000000000 --- a/lib/plaid/models/item_remove_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemRemoveResponse defines the response schema for `/item/remove` - class ItemRemoveResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemRemoveResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemRemoveResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_status.rb b/lib/plaid/models/item_status.rb deleted file mode 100644 index 1305445e5..000000000 --- a/lib/plaid/models/item_status.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object with information about the status of the Item. - class ItemStatus - attr_accessor :investments - - attr_accessor :transactions - - attr_accessor :last_webhook - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'investments' => :'investments', - :'transactions' => :'transactions', - :'last_webhook' => :'last_webhook' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'investments' => :'ItemStatusInvestments', - :'transactions' => :'ItemStatusTransactions', - :'last_webhook' => :'ItemStatusLastWebhook' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'investments', - :'transactions', - :'last_webhook' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'investments') - self.investments = attributes[:'investments'] - end - - if attributes.key?(:'transactions') - self.transactions = attributes[:'transactions'] - end - - if attributes.key?(:'last_webhook') - self.last_webhook = attributes[:'last_webhook'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - investments == o.investments && - transactions == o.transactions && - last_webhook == o.last_webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [investments, transactions, last_webhook].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_status_investments.rb b/lib/plaid/models/item_status_investments.rb deleted file mode 100644 index 5d8058b1c..000000000 --- a/lib/plaid/models/item_status_investments.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the last successful and failed investments update for the Item. - class ItemStatusInvestments - # [ISO 8601](https://wikipedia.org/wiki/ISO_8601) timestamp of the last successful investments 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. - attr_accessor :last_successful_update - - # [ISO 8601](https://wikipedia.org/wiki/ISO_8601) timestamp of the last failed investments 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. - attr_accessor :last_failed_update - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'last_successful_update' => :'last_successful_update', - :'last_failed_update' => :'last_failed_update' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'last_successful_update' => :'Time', - :'last_failed_update' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'last_successful_update', - :'last_failed_update' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemStatusInvestments` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemStatusInvestments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'last_successful_update') - self.last_successful_update = attributes[:'last_successful_update'] - end - - if attributes.key?(:'last_failed_update') - self.last_failed_update = attributes[:'last_failed_update'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - last_successful_update == o.last_successful_update && - last_failed_update == o.last_failed_update - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [last_successful_update, last_failed_update].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_status_last_webhook.rb b/lib/plaid/models/item_status_last_webhook.rb deleted file mode 100644 index f5664b076..000000000 --- a/lib/plaid/models/item_status_last_webhook.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the last webhook fired for the Item. - class ItemStatusLastWebhook - # [ISO 8601](https://wikipedia.org/wiki/ISO_8601) timestamp of when the webhook was fired. - attr_accessor :sent_at - - # The last webhook code sent. - attr_accessor :code_sent - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sent_at' => :'sent_at', - :'code_sent' => :'code_sent' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sent_at' => :'Time', - :'code_sent' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'sent_at', - :'code_sent' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemStatusLastWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemStatusLastWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sent_at') - self.sent_at = attributes[:'sent_at'] - end - - if attributes.key?(:'code_sent') - self.code_sent = attributes[:'code_sent'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sent_at == o.sent_at && - code_sent == o.code_sent - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sent_at, code_sent].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_status_nullable.rb b/lib/plaid/models/item_status_nullable.rb deleted file mode 100644 index a213f3738..000000000 --- a/lib/plaid/models/item_status_nullable.rb +++ /dev/null @@ -1,248 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the last successful and failed transactions update for the Item. - class ItemStatusNullable - attr_accessor :investments - - attr_accessor :transactions - - attr_accessor :last_webhook - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'investments' => :'investments', - :'transactions' => :'transactions', - :'last_webhook' => :'last_webhook' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'investments' => :'ItemStatusInvestments', - :'transactions' => :'ItemStatusTransactions', - :'last_webhook' => :'ItemStatusLastWebhook' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'investments', - :'transactions', - :'last_webhook' - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'ItemStatus' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemStatusNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemStatusNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'investments') - self.investments = attributes[:'investments'] - end - - if attributes.key?(:'transactions') - self.transactions = attributes[:'transactions'] - end - - if attributes.key?(:'last_webhook') - self.last_webhook = attributes[:'last_webhook'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - investments == o.investments && - transactions == o.transactions && - last_webhook == o.last_webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [investments, transactions, last_webhook].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_status_transactions.rb b/lib/plaid/models/item_status_transactions.rb deleted file mode 100644 index c822adb2a..000000000 --- a/lib/plaid/models/item_status_transactions.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the last successful and failed transactions update for the Item. - class ItemStatusTransactions - # [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. - attr_accessor :last_successful_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. - attr_accessor :last_failed_update - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'last_successful_update' => :'last_successful_update', - :'last_failed_update' => :'last_failed_update' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'last_successful_update' => :'Time', - :'last_failed_update' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'last_successful_update', - :'last_failed_update' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemStatusTransactions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemStatusTransactions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'last_successful_update') - self.last_successful_update = attributes[:'last_successful_update'] - end - - if attributes.key?(:'last_failed_update') - self.last_failed_update = attributes[:'last_failed_update'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - last_successful_update == o.last_successful_update && - last_failed_update == o.last_failed_update - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [last_successful_update, last_failed_update].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_webhook_update_request.rb b/lib/plaid/models/item_webhook_update_request.rb deleted file mode 100644 index 73cf05bfc..000000000 --- a/lib/plaid/models/item_webhook_update_request.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemWebhookUpdateRequest defines the request schema for `/item/webhook/update` - class ItemWebhookUpdateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # The new webhook URL to associate with the Item. To remove a webhook from an Item, set to `null`. - attr_accessor :webhook - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'webhook' => :'webhook' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'webhook' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'webhook' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemWebhookUpdateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemWebhookUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - webhook == o.webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, webhook].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/item_webhook_update_response.rb b/lib/plaid/models/item_webhook_update_response.rb deleted file mode 100644 index 748b0f021..000000000 --- a/lib/plaid/models/item_webhook_update_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ItemWebhookUpdateResponse defines the response schema for `/item/webhook/update` - class ItemWebhookUpdateResponse - attr_accessor :item - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item' => :'item', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item' => :'Item', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ItemWebhookUpdateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ItemWebhookUpdateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item') - self.item = attributes[:'item'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item.nil? - invalid_properties.push('invalid value for "item", item cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item == o.item && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/jwk_public_key.rb b/lib/plaid/models/jwk_public_key.rb deleted file mode 100644 index 501fe3b46..000000000 --- a/lib/plaid/models/jwk_public_key.rb +++ /dev/null @@ -1,342 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A JSON Web Key (JWK) that can be used in conjunction with [JWT libraries](https://jwt.io/#libraries-io) to verify Plaid webhooks - class JWKPublicKey - # The alg member identifies the cryptographic algorithm family used with the key. - attr_accessor :alg - - # The crv member identifies the cryptographic curve used with the key. - attr_accessor :crv - - # The kid (Key ID) member can be used to match a specific key. This can be used, for instance, to choose among a set of keys within the JWK during key rollover. - attr_accessor :kid - - # The kty (key type) parameter identifies the cryptographic algorithm family used with the key, such as RSA or EC. - attr_accessor :kty - - # The use (public key use) parameter identifies the intended use of the public key. - attr_accessor :use - - # The x member contains the x coordinate for the elliptic curve point, provided as a base64url-encoded string of the coordinate's big endian representation. - attr_accessor :x - - # The y member contains the y coordinate for the elliptic curve point, provided as a base64url-encoded string of the coordinate's big endian representation. - attr_accessor :y - - # The timestamp when the key was created, in Unix time. - attr_accessor :created_at - - # The timestamp when the key expired, in Unix time. - attr_accessor :expired_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'alg' => :'alg', - :'crv' => :'crv', - :'kid' => :'kid', - :'kty' => :'kty', - :'use' => :'use', - :'x' => :'x', - :'y' => :'y', - :'created_at' => :'created_at', - :'expired_at' => :'expired_at' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'alg' => :'String', - :'crv' => :'String', - :'kid' => :'String', - :'kty' => :'String', - :'use' => :'String', - :'x' => :'String', - :'y' => :'String', - :'created_at' => :'Integer', - :'expired_at' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'expired_at' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::JWKPublicKey` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::JWKPublicKey`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'alg') - self.alg = attributes[:'alg'] - end - - if attributes.key?(:'crv') - self.crv = attributes[:'crv'] - end - - if attributes.key?(:'kid') - self.kid = attributes[:'kid'] - end - - if attributes.key?(:'kty') - self.kty = attributes[:'kty'] - end - - if attributes.key?(:'use') - self.use = attributes[:'use'] - end - - if attributes.key?(:'x') - self.x = attributes[:'x'] - end - - if attributes.key?(:'y') - self.y = attributes[:'y'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'expired_at') - self.expired_at = attributes[:'expired_at'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @alg.nil? - invalid_properties.push('invalid value for "alg", alg cannot be nil.') - end - - if @crv.nil? - invalid_properties.push('invalid value for "crv", crv cannot be nil.') - end - - if @kid.nil? - invalid_properties.push('invalid value for "kid", kid cannot be nil.') - end - - if @kty.nil? - invalid_properties.push('invalid value for "kty", kty cannot be nil.') - end - - if @use.nil? - invalid_properties.push('invalid value for "use", use cannot be nil.') - end - - if @x.nil? - invalid_properties.push('invalid value for "x", x cannot be nil.') - end - - if @y.nil? - invalid_properties.push('invalid value for "y", y cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @alg.nil? - return false if @crv.nil? - return false if @kid.nil? - return false if @kty.nil? - return false if @use.nil? - return false if @x.nil? - return false if @y.nil? - return false if @created_at.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - alg == o.alg && - crv == o.crv && - kid == o.kid && - kty == o.kty && - use == o.use && - x == o.x && - y == o.y && - created_at == o.created_at && - expired_at == o.expired_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [alg, crv, kid, kty, use, x, y, created_at, expired_at].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/jwt_header.rb b/lib/plaid/models/jwt_header.rb deleted file mode 100644 index dbd3336cf..000000000 --- a/lib/plaid/models/jwt_header.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A JWT Header, used for webhook validation - class JWTHeader - attr_accessor :id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::JWTHeader` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::JWTHeader`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/kyc_check_address_summary.rb b/lib/plaid/models/kyc_check_address_summary.rb deleted file mode 100644 index 1016305a5..000000000 --- a/lib/plaid/models/kyc_check_address_summary.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Result summary object specifying how the `address` field matched. - class KYCCheckAddressSummary - attr_accessor :summary - - attr_accessor :po_box - - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'summary' => :'summary', - :'po_box' => :'po_box', - :'type' => :'type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'summary' => :'MatchSummaryCode', - :'po_box' => :'POBoxStatus', - :'type' => :'AddressPurposeLabel' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::KYCCheckAddressSummary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::KYCCheckAddressSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'summary') - self.summary = attributes[:'summary'] - end - - if attributes.key?(:'po_box') - self.po_box = attributes[:'po_box'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @summary.nil? - invalid_properties.push('invalid value for "summary", summary cannot be nil.') - end - - if @po_box.nil? - invalid_properties.push('invalid value for "po_box", po_box cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @summary.nil? - return false if @po_box.nil? - return false if @type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - summary == o.summary && - po_box == o.po_box && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [summary, po_box, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/kyc_check_date_of_birth_summary.rb b/lib/plaid/models/kyc_check_date_of_birth_summary.rb deleted file mode 100644 index 630fbef5e..000000000 --- a/lib/plaid/models/kyc_check_date_of_birth_summary.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Result summary object specifying how the `date_of_birth` field matched. - class KYCCheckDateOfBirthSummary - attr_accessor :summary - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'summary' => :'summary' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'summary' => :'MatchSummaryCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::KYCCheckDateOfBirthSummary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::KYCCheckDateOfBirthSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'summary') - self.summary = attributes[:'summary'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @summary.nil? - invalid_properties.push('invalid value for "summary", summary cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @summary.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - summary == o.summary - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [summary].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/kyc_check_details.rb b/lib/plaid/models/kyc_check_details.rb deleted file mode 100644 index 942789181..000000000 --- a/lib/plaid/models/kyc_check_details.rb +++ /dev/null @@ -1,296 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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`. - class KYCCheckDetails - # The outcome status for the associated Identity Verification attempt's `kyc_check` step. This field will always have the same value as `steps.kyc_check`. - attr_accessor :status - - attr_accessor :address - - attr_accessor :name - - attr_accessor :date_of_birth - - attr_accessor :id_number - - attr_accessor :phone_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'address' => :'address', - :'name' => :'name', - :'date_of_birth' => :'date_of_birth', - :'id_number' => :'id_number', - :'phone_number' => :'phone_number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'String', - :'address' => :'KYCCheckAddressSummary', - :'name' => :'KYCCheckNameSummary', - :'date_of_birth' => :'KYCCheckDateOfBirthSummary', - :'id_number' => :'KYCCheckIDNumberSummary', - :'phone_number' => :'KYCCheckPhoneSummary' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::KYCCheckDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::KYCCheckDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'id_number') - self.id_number = attributes[:'id_number'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @address.nil? - invalid_properties.push('invalid value for "address", address cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @date_of_birth.nil? - invalid_properties.push('invalid value for "date_of_birth", date_of_birth cannot be nil.') - end - - if @id_number.nil? - invalid_properties.push('invalid value for "id_number", id_number cannot be nil.') - end - - if @phone_number.nil? - invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @status.nil? - return false if @address.nil? - return false if @name.nil? - return false if @date_of_birth.nil? - return false if @id_number.nil? - return false if @phone_number.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - address == o.address && - name == o.name && - date_of_birth == o.date_of_birth && - id_number == o.id_number && - phone_number == o.phone_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, address, name, date_of_birth, id_number, phone_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/kyc_check_id_number_summary.rb b/lib/plaid/models/kyc_check_id_number_summary.rb deleted file mode 100644 index 347283822..000000000 --- a/lib/plaid/models/kyc_check_id_number_summary.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Result summary object specifying how the `id_number` field matched. - class KYCCheckIDNumberSummary - attr_accessor :summary - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'summary' => :'summary' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'summary' => :'MatchSummaryCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::KYCCheckIDNumberSummary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::KYCCheckIDNumberSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'summary') - self.summary = attributes[:'summary'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @summary.nil? - invalid_properties.push('invalid value for "summary", summary cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @summary.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - summary == o.summary - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [summary].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/kyc_check_name_summary.rb b/lib/plaid/models/kyc_check_name_summary.rb deleted file mode 100644 index 911227853..000000000 --- a/lib/plaid/models/kyc_check_name_summary.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Result summary object specifying how the `name` field matched. - class KYCCheckNameSummary - attr_accessor :summary - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'summary' => :'summary' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'summary' => :'MatchSummaryCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::KYCCheckNameSummary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::KYCCheckNameSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'summary') - self.summary = attributes[:'summary'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @summary.nil? - invalid_properties.push('invalid value for "summary", summary cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @summary.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - summary == o.summary - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [summary].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/kyc_check_phone_summary.rb b/lib/plaid/models/kyc_check_phone_summary.rb deleted file mode 100644 index 305e98bbf..000000000 --- a/lib/plaid/models/kyc_check_phone_summary.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Result summary object specifying how the `phone` field matched. - class KYCCheckPhoneSummary - attr_accessor :summary - - attr_accessor :area_code - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'summary' => :'summary', - :'area_code' => :'area_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'summary' => :'MatchSummaryCode', - :'area_code' => :'MatchSummaryCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::KYCCheckPhoneSummary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::KYCCheckPhoneSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'summary') - self.summary = attributes[:'summary'] - end - - if attributes.key?(:'area_code') - self.area_code = attributes[:'area_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @summary.nil? - invalid_properties.push('invalid value for "summary", summary cannot be nil.') - end - - if @area_code.nil? - invalid_properties.push('invalid value for "area_code", area_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @summary.nil? - return false if @area_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - summary == o.summary && - area_code == o.area_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [summary, area_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/last_data_access_times.rb b/lib/plaid/models/last_data_access_times.rb deleted file mode 100644 index ce3e27836..000000000 --- a/lib/plaid/models/last_data_access_times.rb +++ /dev/null @@ -1,314 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Describes the last time each datatype was accessed by an application. - class LastDataAccessTimes - # ID of the application accessing data. - attr_accessor :application_id - - # The last time account_balance_info was accessed by this application in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format in UTC. null if never accessed. - attr_accessor :account_balance_info - - # The last time account_routing_number was accessed by this application in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format in UTC. null if never accessed. - attr_accessor :account_routing_number - - # The last time contact_details was accessed by this application in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format in UTC. null if never accessed. - attr_accessor :contact_details - - # The last time transactions was accessed by this application in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format in UTC. null if never accessed. - attr_accessor :transactions - - # The last time credit_and_loans was accessed by this application in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format in UTC. null if never accessed. - attr_accessor :credit_and_loans - - # The last time investments was accessed by this application in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format in UTC. null if never accessed. - attr_accessor :investments - - # The last time payroll_info was accessed by this application in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format in UTC. null if never accessed. - attr_accessor :payroll_info - - # The last time transaction_risk_info was accessed by this application in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format in UTC. null if never accessed. - attr_accessor :transaction_risk_info - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'application_id' => :'application_id', - :'account_balance_info' => :'account_balance_info', - :'account_routing_number' => :'account_routing_number', - :'contact_details' => :'contact_details', - :'transactions' => :'transactions', - :'credit_and_loans' => :'credit_and_loans', - :'investments' => :'investments', - :'payroll_info' => :'payroll_info', - :'transaction_risk_info' => :'transaction_risk_info' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'application_id' => :'String', - :'account_balance_info' => :'Time', - :'account_routing_number' => :'Time', - :'contact_details' => :'Time', - :'transactions' => :'Time', - :'credit_and_loans' => :'Time', - :'investments' => :'Time', - :'payroll_info' => :'Time', - :'transaction_risk_info' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_balance_info', - :'account_routing_number', - :'contact_details', - :'transactions', - :'credit_and_loans', - :'investments', - :'payroll_info', - :'transaction_risk_info' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LastDataAccessTimes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LastDataAccessTimes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'account_balance_info') - self.account_balance_info = attributes[:'account_balance_info'] - end - - if attributes.key?(:'account_routing_number') - self.account_routing_number = attributes[:'account_routing_number'] - end - - if attributes.key?(:'contact_details') - self.contact_details = attributes[:'contact_details'] - end - - if attributes.key?(:'transactions') - self.transactions = attributes[:'transactions'] - end - - if attributes.key?(:'credit_and_loans') - self.credit_and_loans = attributes[:'credit_and_loans'] - end - - if attributes.key?(:'investments') - self.investments = attributes[:'investments'] - end - - if attributes.key?(:'payroll_info') - self.payroll_info = attributes[:'payroll_info'] - end - - if attributes.key?(:'transaction_risk_info') - self.transaction_risk_info = attributes[:'transaction_risk_info'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @application_id.nil? - invalid_properties.push('invalid value for "application_id", application_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @application_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - application_id == o.application_id && - account_balance_info == o.account_balance_info && - account_routing_number == o.account_routing_number && - contact_details == o.contact_details && - transactions == o.transactions && - credit_and_loans == o.credit_and_loans && - investments == o.investments && - payroll_info == o.payroll_info && - transaction_risk_info == o.transaction_risk_info - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [application_id, account_balance_info, account_routing_number, contact_details, transactions, credit_and_loans, investments, payroll_info, transaction_risk_info].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/liabilities_default_update_webhook.rb b/lib/plaid/models/liabilities_default_update_webhook.rb deleted file mode 100644 index c2cd048c2..000000000 --- a/lib/plaid/models/liabilities_default_update_webhook.rb +++ /dev/null @@ -1,336 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The webhook of type `LIABILITIES` and code `DEFAULT_UPDATE` will be fired when new or updated liabilities have been detected on a liabilities item. - class LiabilitiesDefaultUpdateWebhook - # `LIABILITIES` - attr_accessor :webhook_type - - # `DEFAULT_UPDATE` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :error - - # An array of `account_id`'s for accounts that contain new liabilities.' - attr_accessor :account_ids_with_new_liabilities - - # An object with keys of `account_id`'s that are mapped to their respective liabilities fields that changed. Example: `{ \"XMBvvyMGQ1UoLbKByoMqH3nXMj84ALSdE5B58\": [\"past_amount_due\"] }` - attr_accessor :account_ids_with_updated_liabilities - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'error' => :'error', - :'account_ids_with_new_liabilities' => :'account_ids_with_new_liabilities', - :'account_ids_with_updated_liabilities' => :'account_ids_with_updated_liabilities', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'error' => :'PlaidError', - :'account_ids_with_new_liabilities' => :'Array', - :'account_ids_with_updated_liabilities' => :'Hash>', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LiabilitiesDefaultUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LiabilitiesDefaultUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'account_ids_with_new_liabilities') - if (value = attributes[:'account_ids_with_new_liabilities']).is_a?(Array) - self.account_ids_with_new_liabilities = value - end - end - - if attributes.key?(:'account_ids_with_updated_liabilities') - if (value = attributes[:'account_ids_with_updated_liabilities']).is_a?(Hash) - self.account_ids_with_updated_liabilities = value - end - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @account_ids_with_new_liabilities.nil? - invalid_properties.push('invalid value for "account_ids_with_new_liabilities", account_ids_with_new_liabilities cannot be nil.') - end - - if @account_ids_with_updated_liabilities.nil? - invalid_properties.push('invalid value for "account_ids_with_updated_liabilities", account_ids_with_updated_liabilities cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @account_ids_with_new_liabilities.nil? - return false if @account_ids_with_updated_liabilities.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - error == o.error && - account_ids_with_new_liabilities == o.account_ids_with_new_liabilities && - account_ids_with_updated_liabilities == o.account_ids_with_updated_liabilities && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, error, account_ids_with_new_liabilities, account_ids_with_updated_liabilities, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/liabilities_get_request.rb b/lib/plaid/models/liabilities_get_request.rb deleted file mode 100644 index 7dbea305d..000000000 --- a/lib/plaid/models/liabilities_get_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # LiabilitiesGetRequest defines the request schema for `/liabilities/get` - class LiabilitiesGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'options' => :'LiabilitiesGetRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LiabilitiesGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LiabilitiesGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/liabilities_get_request_options.rb b/lib/plaid/models/liabilities_get_request_options.rb deleted file mode 100644 index d845824e2..000000000 --- a/lib/plaid/models/liabilities_get_request_options.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to filter `/liabilities/get` results. If provided, `options` cannot be null. - class LiabilitiesGetRequestOptions - # A list of accounts to retrieve for the Item. An error will be returned if a provided `account_id` is not associated with the Item - attr_accessor :account_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_ids' => :'account_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LiabilitiesGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LiabilitiesGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_ids') - if (value = attributes[:'account_ids']).is_a?(Array) - self.account_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_ids == o.account_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/liabilities_get_response.rb b/lib/plaid/models/liabilities_get_response.rb deleted file mode 100644 index 895d3f6e7..000000000 --- a/lib/plaid/models/liabilities_get_response.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # LiabilitiesGetResponse defines the response schema for `/liabilities/get` - class LiabilitiesGetResponse - # An array of accounts associated with the Item - attr_accessor :accounts - - attr_accessor :item - - attr_accessor :liabilities - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'accounts' => :'accounts', - :'item' => :'item', - :'liabilities' => :'liabilities', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'accounts' => :'Array', - :'item' => :'Item', - :'liabilities' => :'LiabilitiesObject', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LiabilitiesGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LiabilitiesGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - - if attributes.key?(:'item') - self.item = attributes[:'item'] - end - - if attributes.key?(:'liabilities') - self.liabilities = attributes[:'liabilities'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @accounts.nil? - invalid_properties.push('invalid value for "accounts", accounts cannot be nil.') - end - - if @item.nil? - invalid_properties.push('invalid value for "item", item cannot be nil.') - end - - if @liabilities.nil? - invalid_properties.push('invalid value for "liabilities", liabilities cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @accounts.nil? - return false if @item.nil? - return false if @liabilities.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - accounts == o.accounts && - item == o.item && - liabilities == o.liabilities && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [accounts, item, liabilities, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/liabilities_object.rb b/lib/plaid/models/liabilities_object.rb deleted file mode 100644 index 824f62474..000000000 --- a/lib/plaid/models/liabilities_object.rb +++ /dev/null @@ -1,250 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing liability accounts - class LiabilitiesObject - # The credit accounts returned. - attr_accessor :credit - - # The mortgage accounts returned. - attr_accessor :mortgage - - # The student loan accounts returned. - attr_accessor :student - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'credit' => :'credit', - :'mortgage' => :'mortgage', - :'student' => :'student' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'credit' => :'Array', - :'mortgage' => :'Array', - :'student' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'credit', - :'mortgage', - :'student' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LiabilitiesObject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LiabilitiesObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'credit') - if (value = attributes[:'credit']).is_a?(Array) - self.credit = value - end - end - - if attributes.key?(:'mortgage') - if (value = attributes[:'mortgage']).is_a?(Array) - self.mortgage = value - end - end - - if attributes.key?(:'student') - if (value = attributes[:'student']).is_a?(Array) - self.student = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - credit == o.credit && - mortgage == o.mortgage && - student == o.student - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [credit, mortgage, student].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/liability_override.rb b/lib/plaid/models/liability_override.rb deleted file mode 100644 index 2dd5e8ba7..000000000 --- a/lib/plaid/models/liability_override.rb +++ /dev/null @@ -1,567 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Used to configure Sandbox test data for the Liabilities product - class LiabilityOverride - # The type of the liability object, either `credit` or `student`. Mortgages are not currently supported in the custom Sandbox. - attr_accessor :type - - # 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`. - attr_accessor :purchase_apr - - # The cash APR percentage value. Can only be set if `type` is `credit`. - attr_accessor :cash_apr - - # The balance transfer APR percentage value. Can only be set if `type` is `credit`. - attr_accessor :balance_transfer_apr - - # The special APR percentage value. Can only be set if `type` is `credit`. - attr_accessor :special_apr - - # Override the `last_payment_amount` field. Can only be set if `type` is `credit`. - attr_accessor :last_payment_amount - - # Override the `minimum_payment_amount` field. Can only be set if `type` is `credit` or `student`. - attr_accessor :minimum_payment_amount - - # Override the `is_overdue` field - attr_accessor :is_overdue - - # The date on which the loan was initially lent, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format. Can only be set if `type` is `student`. - attr_accessor :origination_date - - # The original loan principal. Can only be set if `type` is `student`. - attr_accessor :principal - - # The interest rate on the loan as a percentage. Can only be set if `type` is `student`. - attr_accessor :nominal_apr - - # If set, interest capitalization begins at the given number of months after loan origination. By default interest is never capitalized. Can only be set if `type` is `student`. - attr_accessor :interest_capitalization_grace_period_months - - attr_accessor :repayment_model - - # Override the `expected_payoff_date` field. Can only be set if `type` is `student`. - attr_accessor :expected_payoff_date - - # Override the `guarantor` field. Can only be set if `type` is `student`. - attr_accessor :guarantor - - # Override the `is_federal` field. Can only be set if `type` is `student`. - attr_accessor :is_federal - - # Override the `loan_name` field. Can only be set if `type` is `student`. - attr_accessor :loan_name - - attr_accessor :loan_status - - # Override the `payment_reference_number` field. Can only be set if `type` is `student`. - attr_accessor :payment_reference_number - - attr_accessor :pslf_status - - # Override the `repayment_plan.description` field. Can only be set if `type` is `student`. - attr_accessor :repayment_plan_description - - # 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\"`. - attr_accessor :repayment_plan_type - - # Override the `sequence_number` field. Can only be set if `type` is `student`. - attr_accessor :sequence_number - - attr_accessor :servicer_address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'purchase_apr' => :'purchase_apr', - :'cash_apr' => :'cash_apr', - :'balance_transfer_apr' => :'balance_transfer_apr', - :'special_apr' => :'special_apr', - :'last_payment_amount' => :'last_payment_amount', - :'minimum_payment_amount' => :'minimum_payment_amount', - :'is_overdue' => :'is_overdue', - :'origination_date' => :'origination_date', - :'principal' => :'principal', - :'nominal_apr' => :'nominal_apr', - :'interest_capitalization_grace_period_months' => :'interest_capitalization_grace_period_months', - :'repayment_model' => :'repayment_model', - :'expected_payoff_date' => :'expected_payoff_date', - :'guarantor' => :'guarantor', - :'is_federal' => :'is_federal', - :'loan_name' => :'loan_name', - :'loan_status' => :'loan_status', - :'payment_reference_number' => :'payment_reference_number', - :'pslf_status' => :'pslf_status', - :'repayment_plan_description' => :'repayment_plan_description', - :'repayment_plan_type' => :'repayment_plan_type', - :'sequence_number' => :'sequence_number', - :'servicer_address' => :'servicer_address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'purchase_apr' => :'Float', - :'cash_apr' => :'Float', - :'balance_transfer_apr' => :'Float', - :'special_apr' => :'Float', - :'last_payment_amount' => :'Float', - :'minimum_payment_amount' => :'Float', - :'is_overdue' => :'Boolean', - :'origination_date' => :'Date', - :'principal' => :'Float', - :'nominal_apr' => :'Float', - :'interest_capitalization_grace_period_months' => :'Float', - :'repayment_model' => :'StudentLoanRepaymentModel', - :'expected_payoff_date' => :'Date', - :'guarantor' => :'String', - :'is_federal' => :'Boolean', - :'loan_name' => :'String', - :'loan_status' => :'StudentLoanStatus', - :'payment_reference_number' => :'String', - :'pslf_status' => :'PSLFStatus', - :'repayment_plan_description' => :'String', - :'repayment_plan_type' => :'String', - :'sequence_number' => :'String', - :'servicer_address' => :'Address' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LiabilityOverride` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LiabilityOverride`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'purchase_apr') - self.purchase_apr = attributes[:'purchase_apr'] - end - - if attributes.key?(:'cash_apr') - self.cash_apr = attributes[:'cash_apr'] - end - - if attributes.key?(:'balance_transfer_apr') - self.balance_transfer_apr = attributes[:'balance_transfer_apr'] - end - - if attributes.key?(:'special_apr') - self.special_apr = attributes[:'special_apr'] - end - - if attributes.key?(:'last_payment_amount') - self.last_payment_amount = attributes[:'last_payment_amount'] - end - - if attributes.key?(:'minimum_payment_amount') - self.minimum_payment_amount = attributes[:'minimum_payment_amount'] - end - - if attributes.key?(:'is_overdue') - self.is_overdue = attributes[:'is_overdue'] - end - - if attributes.key?(:'origination_date') - self.origination_date = attributes[:'origination_date'] - end - - if attributes.key?(:'principal') - self.principal = attributes[:'principal'] - end - - if attributes.key?(:'nominal_apr') - self.nominal_apr = attributes[:'nominal_apr'] - end - - if attributes.key?(:'interest_capitalization_grace_period_months') - self.interest_capitalization_grace_period_months = attributes[:'interest_capitalization_grace_period_months'] - end - - if attributes.key?(:'repayment_model') - self.repayment_model = attributes[:'repayment_model'] - end - - if attributes.key?(:'expected_payoff_date') - self.expected_payoff_date = attributes[:'expected_payoff_date'] - end - - if attributes.key?(:'guarantor') - self.guarantor = attributes[:'guarantor'] - end - - if attributes.key?(:'is_federal') - self.is_federal = attributes[:'is_federal'] - end - - if attributes.key?(:'loan_name') - self.loan_name = attributes[:'loan_name'] - end - - if attributes.key?(:'loan_status') - self.loan_status = attributes[:'loan_status'] - end - - if attributes.key?(:'payment_reference_number') - self.payment_reference_number = attributes[:'payment_reference_number'] - end - - if attributes.key?(:'pslf_status') - self.pslf_status = attributes[:'pslf_status'] - end - - if attributes.key?(:'repayment_plan_description') - self.repayment_plan_description = attributes[:'repayment_plan_description'] - end - - if attributes.key?(:'repayment_plan_type') - self.repayment_plan_type = attributes[:'repayment_plan_type'] - end - - if attributes.key?(:'sequence_number') - self.sequence_number = attributes[:'sequence_number'] - end - - if attributes.key?(:'servicer_address') - self.servicer_address = attributes[:'servicer_address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @purchase_apr.nil? - invalid_properties.push('invalid value for "purchase_apr", purchase_apr cannot be nil.') - end - - if @cash_apr.nil? - invalid_properties.push('invalid value for "cash_apr", cash_apr cannot be nil.') - end - - if @balance_transfer_apr.nil? - invalid_properties.push('invalid value for "balance_transfer_apr", balance_transfer_apr cannot be nil.') - end - - if @special_apr.nil? - invalid_properties.push('invalid value for "special_apr", special_apr cannot be nil.') - end - - if @last_payment_amount.nil? - invalid_properties.push('invalid value for "last_payment_amount", last_payment_amount cannot be nil.') - end - - if @minimum_payment_amount.nil? - invalid_properties.push('invalid value for "minimum_payment_amount", minimum_payment_amount cannot be nil.') - end - - if @is_overdue.nil? - invalid_properties.push('invalid value for "is_overdue", is_overdue cannot be nil.') - end - - if @origination_date.nil? - invalid_properties.push('invalid value for "origination_date", origination_date cannot be nil.') - end - - if @principal.nil? - invalid_properties.push('invalid value for "principal", principal cannot be nil.') - end - - if @nominal_apr.nil? - invalid_properties.push('invalid value for "nominal_apr", nominal_apr cannot be nil.') - end - - if @interest_capitalization_grace_period_months.nil? - invalid_properties.push('invalid value for "interest_capitalization_grace_period_months", interest_capitalization_grace_period_months cannot be nil.') - end - - if @repayment_model.nil? - invalid_properties.push('invalid value for "repayment_model", repayment_model cannot be nil.') - end - - if @expected_payoff_date.nil? - invalid_properties.push('invalid value for "expected_payoff_date", expected_payoff_date cannot be nil.') - end - - if @guarantor.nil? - invalid_properties.push('invalid value for "guarantor", guarantor cannot be nil.') - end - - if @is_federal.nil? - invalid_properties.push('invalid value for "is_federal", is_federal cannot be nil.') - end - - if @loan_name.nil? - invalid_properties.push('invalid value for "loan_name", loan_name cannot be nil.') - end - - if @loan_status.nil? - invalid_properties.push('invalid value for "loan_status", loan_status cannot be nil.') - end - - if @payment_reference_number.nil? - invalid_properties.push('invalid value for "payment_reference_number", payment_reference_number cannot be nil.') - end - - if @pslf_status.nil? - invalid_properties.push('invalid value for "pslf_status", pslf_status cannot be nil.') - end - - if @repayment_plan_description.nil? - invalid_properties.push('invalid value for "repayment_plan_description", repayment_plan_description cannot be nil.') - end - - if @repayment_plan_type.nil? - invalid_properties.push('invalid value for "repayment_plan_type", repayment_plan_type cannot be nil.') - end - - if @sequence_number.nil? - invalid_properties.push('invalid value for "sequence_number", sequence_number cannot be nil.') - end - - if @servicer_address.nil? - invalid_properties.push('invalid value for "servicer_address", servicer_address cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - return false if @purchase_apr.nil? - return false if @cash_apr.nil? - return false if @balance_transfer_apr.nil? - return false if @special_apr.nil? - return false if @last_payment_amount.nil? - return false if @minimum_payment_amount.nil? - return false if @is_overdue.nil? - return false if @origination_date.nil? - return false if @principal.nil? - return false if @nominal_apr.nil? - return false if @interest_capitalization_grace_period_months.nil? - return false if @repayment_model.nil? - return false if @expected_payoff_date.nil? - return false if @guarantor.nil? - return false if @is_federal.nil? - return false if @loan_name.nil? - return false if @loan_status.nil? - return false if @payment_reference_number.nil? - return false if @pslf_status.nil? - return false if @repayment_plan_description.nil? - return false if @repayment_plan_type.nil? - return false if @sequence_number.nil? - return false if @servicer_address.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - purchase_apr == o.purchase_apr && - cash_apr == o.cash_apr && - balance_transfer_apr == o.balance_transfer_apr && - special_apr == o.special_apr && - last_payment_amount == o.last_payment_amount && - minimum_payment_amount == o.minimum_payment_amount && - is_overdue == o.is_overdue && - origination_date == o.origination_date && - principal == o.principal && - nominal_apr == o.nominal_apr && - interest_capitalization_grace_period_months == o.interest_capitalization_grace_period_months && - repayment_model == o.repayment_model && - expected_payoff_date == o.expected_payoff_date && - guarantor == o.guarantor && - is_federal == o.is_federal && - loan_name == o.loan_name && - loan_status == o.loan_status && - payment_reference_number == o.payment_reference_number && - pslf_status == o.pslf_status && - repayment_plan_description == o.repayment_plan_description && - repayment_plan_type == o.repayment_plan_type && - sequence_number == o.sequence_number && - servicer_address == o.servicer_address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, purchase_apr, cash_apr, balance_transfer_apr, special_apr, last_payment_amount, minimum_payment_amount, is_overdue, origination_date, principal, nominal_apr, interest_capitalization_grace_period_months, repayment_model, expected_payoff_date, guarantor, is_federal, loan_name, loan_status, payment_reference_number, pslf_status, repayment_plan_description, repayment_plan_type, sequence_number, servicer_address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_callback_metadata.rb b/lib/plaid/models/link_callback_metadata.rb deleted file mode 100644 index b4d64a329..000000000 --- a/lib/plaid/models/link_callback_metadata.rb +++ /dev/null @@ -1,302 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information related to the callback from the Hosted Link session. - class LinkCallbackMetadata - attr_accessor :callback_type - - attr_accessor :event_name - - # Indicates where in the flow the Link user exited - attr_accessor :status - - # 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. - attr_accessor :link_session_id - - # The request ID for the last request made by Link. This can be shared with Plaid Support to expedite investigation. - attr_accessor :request_id - - attr_accessor :institution - - # A list of accounts attached to the connected Item. If Account Select is enabled via the developer dashboard, accounts will only include selected accounts. - attr_accessor :accounts - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'callback_type' => :'callback_type', - :'event_name' => :'event_name', - :'status' => :'status', - :'link_session_id' => :'link_session_id', - :'request_id' => :'request_id', - :'institution' => :'institution', - :'accounts' => :'accounts' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'callback_type' => :'LinkDeliveryWebhookCallbackType', - :'event_name' => :'LinkEventName', - :'status' => :'String', - :'link_session_id' => :'String', - :'request_id' => :'String', - :'institution' => :'LinkDeliveryInstitution', - :'accounts' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkCallbackMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkCallbackMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'callback_type') - self.callback_type = attributes[:'callback_type'] - end - - if attributes.key?(:'event_name') - self.event_name = attributes[:'event_name'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'link_session_id') - self.link_session_id = attributes[:'link_session_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'institution') - self.institution = attributes[:'institution'] - end - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - callback_type == o.callback_type && - event_name == o.event_name && - status == o.status && - link_session_id == o.link_session_id && - request_id == o.request_id && - institution == o.institution && - accounts == o.accounts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [callback_type, event_name, status, link_session_id, request_id, institution, accounts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_delivery_account.rb b/lib/plaid/models/link_delivery_account.rb deleted file mode 100644 index 2bb59ca47..000000000 --- a/lib/plaid/models/link_delivery_account.rb +++ /dev/null @@ -1,302 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information related to account attached to the connected Item - class LinkDeliveryAccount - # The Plaid `account_id` - attr_accessor :id - - # The official account name - attr_accessor :name - - # 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. It may also not match the mask that the bank displays to the user. - attr_accessor :mask - - # The account type. See the [Account schema](https://plaid.com/docs/api/accounts/#account-type-schema) for a full list of possible values - attr_accessor :type - - # The account subtype. See the [Account schema](https://plaid.com/docs/api/accounts/#account-type-schema) for a full list of possible values - attr_accessor :subtype - - attr_accessor :verification_status - - # If micro-deposit verification is being used, indicates whether the account being verified is a `business` or `personal` account. - attr_accessor :class_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name', - :'mask' => :'mask', - :'type' => :'type', - :'subtype' => :'subtype', - :'verification_status' => :'verification_status', - :'class_type' => :'class_type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String', - :'mask' => :'String', - :'type' => :'String', - :'subtype' => :'String', - :'verification_status' => :'LinkDeliveryVerificationStatus', - :'class_type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkDeliveryAccount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkDeliveryAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'mask') - self.mask = attributes[:'mask'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'subtype') - self.subtype = attributes[:'subtype'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - - if attributes.key?(:'class_type') - self.class_type = attributes[:'class_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name && - mask == o.mask && - type == o.type && - subtype == o.subtype && - verification_status == o.verification_status && - class_type == o.class_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name, mask, type, subtype, verification_status, class_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_delivery_callback_webhook.rb b/lib/plaid/models/link_delivery_callback_webhook.rb deleted file mode 100644 index 308812043..000000000 --- a/lib/plaid/models/link_delivery_callback_webhook.rb +++ /dev/null @@ -1,295 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Webhook containing metadata proxied over from Link callback e.g `onEvent`, `onExit`, `onSuccess`. - class LinkDeliveryCallbackWebhook - # `LINK_DELIVERY` - attr_accessor :webhook_type - - # `LINK_CALLBACK` - attr_accessor :webhook_code - - # The ID of the Hosted Link session. - attr_accessor :link_delivery_session_id - - # Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :timestamp - - attr_accessor :error - - attr_accessor :link_callback_metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'link_delivery_session_id' => :'link_delivery_session_id', - :'timestamp' => :'timestamp', - :'error' => :'error', - :'link_callback_metadata' => :'link_callback_metadata' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'link_delivery_session_id' => :'String', - :'timestamp' => :'String', - :'error' => :'PlaidError', - :'link_callback_metadata' => :'LinkCallbackMetadata' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkDeliveryCallbackWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkDeliveryCallbackWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'link_delivery_session_id') - self.link_delivery_session_id = attributes[:'link_delivery_session_id'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'link_callback_metadata') - self.link_callback_metadata = attributes[:'link_callback_metadata'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @link_delivery_session_id.nil? - invalid_properties.push('invalid value for "link_delivery_session_id", link_delivery_session_id cannot be nil.') - end - - if @timestamp.nil? - invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.') - end - - if @link_callback_metadata.nil? - invalid_properties.push('invalid value for "link_callback_metadata", link_callback_metadata cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @link_delivery_session_id.nil? - return false if @timestamp.nil? - return false if @link_callback_metadata.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - link_delivery_session_id == o.link_delivery_session_id && - timestamp == o.timestamp && - error == o.error && - link_callback_metadata == o.link_callback_metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, link_delivery_session_id, timestamp, error, link_callback_metadata].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_delivery_communication_method.rb b/lib/plaid/models/link_delivery_communication_method.rb deleted file mode 100644 index bef04e94a..000000000 --- a/lib/plaid/models/link_delivery_communication_method.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The communication method containing both the type and address to send the URL. - class LinkDeliveryCommunicationMethod - attr_accessor :method - - # The phone number / email address that Hosted Link sessions are delivered to. Phone numbers must be in E.164 format. - attr_accessor :address - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'method' => :'method', - :'address' => :'address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'method' => :'LinkDeliveryDeliveryMethod', - :'address' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkDeliveryCommunicationMethod` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkDeliveryCommunicationMethod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'method') - self.method = attributes[:'method'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - method == o.method && - address == o.address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [method, address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_delivery_create_request.rb b/lib/plaid/models/link_delivery_create_request.rb deleted file mode 100644 index b4b594388..000000000 --- a/lib/plaid/models/link_delivery_create_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # LinkDeliveryCreateRequest defines the request schema for `/link_delivery/create` - class LinkDeliveryCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A `link_token` from a previous invocation of `/link/token/create`. - attr_accessor :link_token - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'link_token' => :'link_token', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'link_token' => :'String', - :'options' => :'LinkDeliveryOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkDeliveryCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkDeliveryCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'link_token') - self.link_token = attributes[:'link_token'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @link_token.nil? - invalid_properties.push('invalid value for "link_token", link_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @link_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - link_token == o.link_token && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, link_token, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_delivery_create_response.rb b/lib/plaid/models/link_delivery_create_response.rb deleted file mode 100644 index 5415ce2cb..000000000 --- a/lib/plaid/models/link_delivery_create_response.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # LinkDeliveryCreateResponse defines the response schema for `/link_delivery/create` - class LinkDeliveryCreateResponse - # The URL to the Hosted Link session, which will be delivered by the specified delivery method. - attr_accessor :link_delivery_url - - # The ID for the Hosted Link session. Same as the `link_token` string excluding the \"link-{env}-\" prefix. - attr_accessor :link_delivery_session_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'link_delivery_url' => :'link_delivery_url', - :'link_delivery_session_id' => :'link_delivery_session_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'link_delivery_url' => :'String', - :'link_delivery_session_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkDeliveryCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkDeliveryCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'link_delivery_url') - self.link_delivery_url = attributes[:'link_delivery_url'] - end - - if attributes.key?(:'link_delivery_session_id') - self.link_delivery_session_id = attributes[:'link_delivery_session_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @link_delivery_url.nil? - invalid_properties.push('invalid value for "link_delivery_url", link_delivery_url cannot be nil.') - end - - if @link_delivery_session_id.nil? - invalid_properties.push('invalid value for "link_delivery_session_id", link_delivery_session_id cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @link_delivery_url.nil? - return false if @link_delivery_session_id.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - link_delivery_url == o.link_delivery_url && - link_delivery_session_id == o.link_delivery_session_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [link_delivery_url, link_delivery_session_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_delivery_delivery_method.rb b/lib/plaid/models/link_delivery_delivery_method.rb deleted file mode 100644 index ca49bd670..000000000 --- a/lib/plaid/models/link_delivery_delivery_method.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class LinkDeliveryDeliveryMethod - SMS = "SMS".freeze - EMAIL = "EMAIL".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/link_delivery_get_request.rb b/lib/plaid/models/link_delivery_get_request.rb deleted file mode 100644 index 8d15db47a..000000000 --- a/lib/plaid/models/link_delivery_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # LinkDeliveryGetRequest defines the request schema for `/link_delivery/get` - class LinkDeliveryGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID for the Hosted Link session from a previous invocation of `/link_delivery/create`. - attr_accessor :link_delivery_session_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'link_delivery_session_id' => :'link_delivery_session_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'link_delivery_session_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkDeliveryGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkDeliveryGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'link_delivery_session_id') - self.link_delivery_session_id = attributes[:'link_delivery_session_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @link_delivery_session_id.nil? - invalid_properties.push('invalid value for "link_delivery_session_id", link_delivery_session_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @link_delivery_session_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - link_delivery_session_id == o.link_delivery_session_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, link_delivery_session_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_delivery_get_response.rb b/lib/plaid/models/link_delivery_get_response.rb deleted file mode 100644 index 7503db750..000000000 --- a/lib/plaid/models/link_delivery_get_response.rb +++ /dev/null @@ -1,314 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # LinkDeliveryGetRequest defines the response schema for `/link_delivery/get` - class LinkDeliveryGetResponse - attr_accessor :status - - # Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the time the given Hosted Link session was created at. - attr_accessor :created_at - - # Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the time the given Hosted Link session was completed at. - attr_accessor :completed_at - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # An array of access tokens associated with the Hosted Link session. - attr_accessor :access_tokens - - # An array of `item_id`s associated with the Hosted Link session. - attr_accessor :item_ids - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'created_at' => :'created_at', - :'completed_at' => :'completed_at', - :'request_id' => :'request_id', - :'access_tokens' => :'access_tokens', - :'item_ids' => :'item_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'LinkDeliverySessionStatus', - :'created_at' => :'Time', - :'completed_at' => :'Time', - :'request_id' => :'String', - :'access_tokens' => :'Array', - :'item_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'completed_at', - :'access_tokens', - :'item_ids' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkDeliveryGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkDeliveryGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'completed_at') - self.completed_at = attributes[:'completed_at'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'access_tokens') - if (value = attributes[:'access_tokens']).is_a?(Array) - self.access_tokens = value - end - end - - if attributes.key?(:'item_ids') - if (value = attributes[:'item_ids']).is_a?(Array) - self.item_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @status.nil? - return false if @created_at.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - created_at == o.created_at && - completed_at == o.completed_at && - request_id == o.request_id && - access_tokens == o.access_tokens && - item_ids == o.item_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, created_at, completed_at, request_id, access_tokens, item_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_delivery_institution.rb b/lib/plaid/models/link_delivery_institution.rb deleted file mode 100644 index 5b7657fca..000000000 --- a/lib/plaid/models/link_delivery_institution.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information related to the financial institution. - class LinkDeliveryInstitution - # The full institution name, such as 'Wells Fargo' - attr_accessor :name - - # The Plaid institution identifier - attr_accessor :institution_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'institution_id' => :'institution_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'institution_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkDeliveryInstitution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkDeliveryInstitution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - institution_id == o.institution_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, institution_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_delivery_metadata.rb b/lib/plaid/models/link_delivery_metadata.rb deleted file mode 100644 index f1a6605e5..000000000 --- a/lib/plaid/models/link_delivery_metadata.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information related to the related to the delivery of the link session to users - class LinkDeliveryMetadata - attr_accessor :communication_method - - attr_accessor :delivery_status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'communication_method' => :'communication_method', - :'delivery_status' => :'delivery_status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'communication_method' => :'LinkDeliveryWebhookCommunicationMethod', - :'delivery_status' => :'LinkDeliveryWebhookDeliveryStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkDeliveryMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkDeliveryMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'communication_method') - self.communication_method = attributes[:'communication_method'] - end - - if attributes.key?(:'delivery_status') - self.delivery_status = attributes[:'delivery_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - communication_method == o.communication_method && - delivery_status == o.delivery_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [communication_method, delivery_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_delivery_options.rb b/lib/plaid/models/link_delivery_options.rb deleted file mode 100644 index 0deadd31d..000000000 --- a/lib/plaid/models/link_delivery_options.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Optional metadata related to the Hosted Link session - class LinkDeliveryOptions - attr_accessor :recipient - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'recipient' => :'recipient' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'recipient' => :'LinkDeliveryRecipient' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkDeliveryOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkDeliveryOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'recipient') - self.recipient = attributes[:'recipient'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - recipient == o.recipient - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [recipient].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_delivery_recipient.rb b/lib/plaid/models/link_delivery_recipient.rb deleted file mode 100644 index 256589ce2..000000000 --- a/lib/plaid/models/link_delivery_recipient.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Metadata related to the recipient. If the information required to populate this field is not available, leave it blank. - class LinkDeliveryRecipient - # The list of communication methods to send the Hosted Link session URL to. If delivery is not required, leave this field blank. - attr_accessor :communication_methods - - # First name of the recipient. Will be used in the body of the email / text (if configured). If this information is not available, leave this field blank. - attr_accessor :first_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'communication_methods' => :'communication_methods', - :'first_name' => :'first_name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'communication_methods' => :'Array', - :'first_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkDeliveryRecipient` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkDeliveryRecipient`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'communication_methods') - if (value = attributes[:'communication_methods']).is_a?(Array) - self.communication_methods = value - end - end - - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - communication_methods == o.communication_methods && - first_name == o.first_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [communication_methods, first_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_delivery_session_status.rb b/lib/plaid/models/link_delivery_session_status.rb deleted file mode 100644 index 554af1f5f..000000000 --- a/lib/plaid/models/link_delivery_session_status.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class LinkDeliverySessionStatus - CREATED = "CREATED".freeze - OPENED = "OPENED".freeze - EXITED = "EXITED".freeze - COMPLETED = "COMPLETED".freeze - EXPIRED = "EXPIRED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/link_delivery_verification_status.rb b/lib/plaid/models/link_delivery_verification_status.rb deleted file mode 100644 index 7ed1c478f..000000000 --- a/lib/plaid/models/link_delivery_verification_status.rb +++ /dev/null @@ -1,47 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class LinkDeliveryVerificationStatus - AUTOMATICALLY_VERIFIED = "automatically_verified".freeze - PENDING_AUTOMATIC_VERIFICATION = "pending_automatic_verification".freeze - PENDING_MANUAL_VERIFICATION = "pending_manual_verification".freeze - MANUALLY_VERIFIED = "manually_verified".freeze - VERIFICATION_EXPIRED = "verification_expired".freeze - VERIFICATION_FAILED = "verification_failed".freeze - DATABASE_MATCHED = "database_matched".freeze - DATABASE_INSIGHTS_PASS = "database_insights_pass".freeze - DATABASE_INSIGHTS_PASS_WITH_CAUTION = "database_insights_pass_with_caution".freeze - DATABASE_INSIGHTS_FAIL = "database_insights_fail".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/link_delivery_webhook_callback_type.rb b/lib/plaid/models/link_delivery_webhook_callback_type.rb deleted file mode 100644 index 262564d9f..000000000 --- a/lib/plaid/models/link_delivery_webhook_callback_type.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class LinkDeliveryWebhookCallbackType - SUCCESS = "ON_SUCCESS".freeze - EVENT = "ON_EVENT".freeze - EXIT = "ON_EXIT".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/link_delivery_webhook_communication_method.rb b/lib/plaid/models/link_delivery_webhook_communication_method.rb deleted file mode 100644 index 0600cb6bd..000000000 --- a/lib/plaid/models/link_delivery_webhook_communication_method.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class LinkDeliveryWebhookCommunicationMethod - SMS = "SMS".freeze - EMAIL = "EMAIL".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/link_delivery_webhook_delivery_status.rb b/lib/plaid/models/link_delivery_webhook_delivery_status.rb deleted file mode 100644 index 15c284c9d..000000000 --- a/lib/plaid/models/link_delivery_webhook_delivery_status.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class LinkDeliveryWebhookDeliveryStatus - SUCCESS = "SUCCESS".freeze - FAILURE = "FAILURE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/link_event.rb b/lib/plaid/models/link_event.rb deleted file mode 100644 index a5a11c57a..000000000 --- a/lib/plaid/models/link_event.rb +++ /dev/null @@ -1,270 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An event that occurred while the user was going through Link - class LinkEvent - # Event name - attr_accessor :event_name - - # Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :timestamp - - # UUID that can be used to deduplicate events - attr_accessor :event_id - - attr_accessor :event_metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'event_name' => :'event_name', - :'timestamp' => :'timestamp', - :'event_id' => :'event_id', - :'event_metadata' => :'event_metadata' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'event_name' => :'String', - :'timestamp' => :'String', - :'event_id' => :'String', - :'event_metadata' => :'LinkEventMetadata' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkEvent` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'event_name') - self.event_name = attributes[:'event_name'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - - if attributes.key?(:'event_id') - self.event_id = attributes[:'event_id'] - end - - if attributes.key?(:'event_metadata') - self.event_metadata = attributes[:'event_metadata'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @event_name.nil? - invalid_properties.push('invalid value for "event_name", event_name cannot be nil.') - end - - if @timestamp.nil? - invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.') - end - - if @event_id.nil? - invalid_properties.push('invalid value for "event_id", event_id cannot be nil.') - end - - if @event_metadata.nil? - invalid_properties.push('invalid value for "event_metadata", event_metadata cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @event_name.nil? - return false if @timestamp.nil? - return false if @event_id.nil? - return false if @event_metadata.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - event_name == o.event_name && - timestamp == o.timestamp && - event_id == o.event_id && - event_metadata == o.event_metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [event_name, timestamp, event_id, event_metadata].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_event_metadata.rb b/lib/plaid/models/link_event_metadata.rb deleted file mode 100644 index ae037f952..000000000 --- a/lib/plaid/models/link_event_metadata.rb +++ /dev/null @@ -1,366 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Metadata about an event that occured while the user was going through Link - class LinkEventMetadata - # The error code that the user encountered. Emitted by `ERROR`, `EXIT`. - attr_accessor :error_code - - # The error message that the user encountered. Emitted by: `ERROR`, `EXIT`. - attr_accessor :error_message - - # The error type that the user encountered. Emitted by: `ERROR`, `EXIT`. - attr_accessor :error_type - - # The status key indicates the point at which the user exited the Link flow. Emitted by: `EXIT`. - attr_accessor :exit_status - - # The ID of the selected institution. Emitted by: all events. - attr_accessor :institution_id - - # The name of the selected institution. Emitted by: all events. - attr_accessor :institution_name - - # The query used to search for institutions. Emitted by: `SEARCH_INSTITUTION`. - attr_accessor :institution_search_query - - # The request ID for the last request made by Link. This can be shared with Plaid Support to expedite investigation. Emitted by: all events. - attr_accessor :request_id - - # 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`. - attr_accessor :mfa_type - - # The name of the view that is being transitioned to. Emitted by: `TRANSITION_VIEW`. - attr_accessor :view_name - - # 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`. - attr_accessor :selection - - # The name of the selected brand. - attr_accessor :brand_name - - # The reason this institution was matched, which will be either `returning_user` or `routing_number`. Emitted by: `MATCHED_SELECT_INSTITUTION`. - attr_accessor :match_reason - - # The routing number submitted by user at the micro-deposits routing number pane. Emitted by `SUBMIT_ROUTING_NUMBER`. - attr_accessor :routing_number - - # 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`. - attr_accessor :account_number_mask - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'error_code' => :'error_code', - :'error_message' => :'error_message', - :'error_type' => :'error_type', - :'exit_status' => :'exit_status', - :'institution_id' => :'institution_id', - :'institution_name' => :'institution_name', - :'institution_search_query' => :'institution_search_query', - :'request_id' => :'request_id', - :'mfa_type' => :'mfa_type', - :'view_name' => :'view_name', - :'selection' => :'selection', - :'brand_name' => :'brand_name', - :'match_reason' => :'match_reason', - :'routing_number' => :'routing_number', - :'account_number_mask' => :'account_number_mask' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'error_code' => :'String', - :'error_message' => :'String', - :'error_type' => :'String', - :'exit_status' => :'String', - :'institution_id' => :'String', - :'institution_name' => :'String', - :'institution_search_query' => :'String', - :'request_id' => :'String', - :'mfa_type' => :'String', - :'view_name' => :'String', - :'selection' => :'String', - :'brand_name' => :'String', - :'match_reason' => :'String', - :'routing_number' => :'String', - :'account_number_mask' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkEventMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkEventMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'error_code') - self.error_code = attributes[:'error_code'] - end - - if attributes.key?(:'error_message') - self.error_message = attributes[:'error_message'] - end - - if attributes.key?(:'error_type') - self.error_type = attributes[:'error_type'] - end - - if attributes.key?(:'exit_status') - self.exit_status = attributes[:'exit_status'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'institution_name') - self.institution_name = attributes[:'institution_name'] - end - - if attributes.key?(:'institution_search_query') - self.institution_search_query = attributes[:'institution_search_query'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'mfa_type') - self.mfa_type = attributes[:'mfa_type'] - end - - if attributes.key?(:'view_name') - self.view_name = attributes[:'view_name'] - end - - if attributes.key?(:'selection') - self.selection = attributes[:'selection'] - end - - if attributes.key?(:'brand_name') - self.brand_name = attributes[:'brand_name'] - end - - if attributes.key?(:'match_reason') - self.match_reason = attributes[:'match_reason'] - end - - if attributes.key?(:'routing_number') - self.routing_number = attributes[:'routing_number'] - end - - if attributes.key?(:'account_number_mask') - self.account_number_mask = attributes[:'account_number_mask'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - error_code == o.error_code && - error_message == o.error_message && - error_type == o.error_type && - exit_status == o.exit_status && - institution_id == o.institution_id && - institution_name == o.institution_name && - institution_search_query == o.institution_search_query && - request_id == o.request_id && - mfa_type == o.mfa_type && - view_name == o.view_name && - selection == o.selection && - brand_name == o.brand_name && - match_reason == o.match_reason && - routing_number == o.routing_number && - account_number_mask == o.account_number_mask - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [error_code, error_message, error_type, exit_status, institution_id, institution_name, institution_search_query, request_id, mfa_type, view_name, selection, brand_name, match_reason, routing_number, account_number_mask].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_event_name.rb b/lib/plaid/models/link_event_name.rb deleted file mode 100644 index eb4e321e6..000000000 --- a/lib/plaid/models/link_event_name.rb +++ /dev/null @@ -1,62 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class LinkEventName - BANK_INCOME_INSIGHTS_COMPLETED = "BANK_INCOME_INSIGHTS_COMPLETED".freeze - CLOSE_OAUTH = "CLOSE_OAUTH".freeze - ERROR = "ERROR".freeze - EXIT = "EXIT".freeze - FAIL_OAUTH = "FAIL_OAUTH".freeze - HANDOFF = "HANDOFF".freeze - OPEN = "OPEN".freeze - OPEN_MY_PLAID = "OPEN_MY_PLAID".freeze - OPEN_OAUTH = "OPEN_OAUTH".freeze - SEARCH_INSTITUTION = "SEARCH_INSTITUTION".freeze - SELECT_AUTH_TYPE = "SELECT_AUTH_TYPE".freeze - SELECT_BRAND = "SELECT_BRAND".freeze - SELECT_DEGRADED_INSTITUTION = "SELECT_DEGRADED_INSTITUTION".freeze - SELECT_DOWN_INSTITUTION = "SELECT_DOWN_INSTITUTION".freeze - SELECT_FILTERED_INSTITUTION = "SELECT_FILTERED_INSTITUTION".freeze - SELECT_INSTITUTION = "SELECT_INSTITUTION".freeze - SUBMIT_ACCOUNT_NUMBER = "SUBMIT_ACCOUNT_NUMBER".freeze - SUBMIT_CREDENTIALS = "SUBMIT_CREDENTIALS".freeze - SUBMIT_DOCUMENTS = "SUBMIT_DOCUMENTS".freeze - SUBMIT_DOCUMENTS_ERROR = "SUBMIT_DOCUMENTS_ERROR".freeze - SUBMIT_DOCUMENTS_SUCCESS = "SUBMIT_DOCUMENTS_SUCCESS".freeze - SUBMIT_MFA = "SUBMIT_MFA".freeze - SUBMIT_ROUTING_NUMBER = "SUBMIT_ROUTING_NUMBER".freeze - TRANSITION_VIEW = "TRANSITION_VIEW".freeze - VIEW_DATA_TYPES = "VIEW_DATA_TYPES".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/link_events_webhook.rb b/lib/plaid/models/link_events_webhook.rb deleted file mode 100644 index 641ba90be..000000000 --- a/lib/plaid/models/link_events_webhook.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Contains a summary of the events from a link session - class LinkEventsWebhook - # `LINK` - attr_accessor :webhook_type - - # `EVENTS` - attr_accessor :webhook_code - - # The link events emitted during the link session - attr_accessor :events - - # An identifier for the link session these events occurred in - attr_accessor :link_session_id - - # The link token used to create the link session these events are from - attr_accessor :link_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'events' => :'events', - :'link_session_id' => :'link_session_id', - :'link_token' => :'link_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'events' => :'Array', - :'link_session_id' => :'String', - :'link_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkEventsWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkEventsWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'events') - if (value = attributes[:'events']).is_a?(Array) - self.events = value - end - end - - if attributes.key?(:'link_session_id') - self.link_session_id = attributes[:'link_session_id'] - end - - if attributes.key?(:'link_token') - self.link_token = attributes[:'link_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @events.nil? - invalid_properties.push('invalid value for "events", events cannot be nil.') - end - - if @link_session_id.nil? - invalid_properties.push('invalid value for "link_session_id", link_session_id cannot be nil.') - end - - if @link_token.nil? - invalid_properties.push('invalid value for "link_token", link_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @events.nil? - return false if @link_session_id.nil? - return false if @link_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - events == o.events && - link_session_id == o.link_session_id && - link_token == o.link_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, events, link_session_id, link_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_o_auth_correlation_id_exchange_request.rb b/lib/plaid/models/link_o_auth_correlation_id_exchange_request.rb deleted file mode 100644 index ccd0c658f..000000000 --- a/lib/plaid/models/link_o_auth_correlation_id_exchange_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # LinkOAuthCorrelationIdExchangeRequest defines the request schema for `/link/oauth/correlation_id/exchange` - class LinkOAuthCorrelationIdExchangeRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A `link_correlation_id` from a received OAuth redirect URI callback - attr_accessor :link_correlation_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'link_correlation_id' => :'link_correlation_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'link_correlation_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkOAuthCorrelationIdExchangeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkOAuthCorrelationIdExchangeRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'link_correlation_id') - self.link_correlation_id = attributes[:'link_correlation_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @link_correlation_id.nil? - invalid_properties.push('invalid value for "link_correlation_id", link_correlation_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @link_correlation_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - link_correlation_id == o.link_correlation_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, link_correlation_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_o_auth_correlation_id_exchange_response.rb b/lib/plaid/models/link_o_auth_correlation_id_exchange_response.rb deleted file mode 100644 index e0d8a12b9..000000000 --- a/lib/plaid/models/link_o_auth_correlation_id_exchange_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # LinkOAuthCorrelationIdExchangeResponse defines the response schema for `/link/oauth/correlation_id/exchange` - class LinkOAuthCorrelationIdExchangeResponse - # The `link_token` associated to the given `link_correlation_id`, which can be used to re-initialize Link. - attr_accessor :link_token - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'link_token' => :'link_token', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'link_token' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkOAuthCorrelationIdExchangeResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkOAuthCorrelationIdExchangeResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'link_token') - self.link_token = attributes[:'link_token'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @link_token.nil? - invalid_properties.push('invalid value for "link_token", link_token cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @link_token.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - link_token == o.link_token && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [link_token, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_session_exit.rb b/lib/plaid/models/link_session_exit.rb deleted file mode 100644 index c7f2a1db4..000000000 --- a/lib/plaid/models/link_session_exit.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing an [onExit](https://plaid.com/docs/link/web/#onexit) callback from Link. - class LinkSessionExit - attr_accessor :error - - attr_accessor :metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'error' => :'error', - :'metadata' => :'metadata' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'error' => :'PlaidError', - :'metadata' => :'LinkSessionExitMetadata' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - :'metadata' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkSessionExit` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkSessionExit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'metadata') - self.metadata = attributes[:'metadata'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - error == o.error && - metadata == o.metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [error, metadata].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_session_exit_metadata.rb b/lib/plaid/models/link_session_exit_metadata.rb deleted file mode 100644 index 2ea6e4399..000000000 --- a/lib/plaid/models/link_session_exit_metadata.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Displayed if a user exits Link without successfully linking an Item. - class LinkSessionExitMetadata - attr_accessor :institution - - # The point at which the user exited the Link flow. One of the following values. - attr_accessor :status - - # 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. - attr_accessor :link_session_id - - # The request ID for the last request made by Link. This can be shared with Plaid Support to expedite investigation. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'institution' => :'institution', - :'status' => :'status', - :'link_session_id' => :'link_session_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'institution' => :'LinkSessionExitMetadataInstitution', - :'status' => :'String', - :'link_session_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'institution', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkSessionExitMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkSessionExitMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'institution') - self.institution = attributes[:'institution'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'link_session_id') - self.link_session_id = attributes[:'link_session_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - institution == o.institution && - status == o.status && - link_session_id == o.link_session_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [institution, status, link_session_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_session_exit_metadata_institution.rb b/lib/plaid/models/link_session_exit_metadata_institution.rb deleted file mode 100644 index bbd00299a..000000000 --- a/lib/plaid/models/link_session_exit_metadata_institution.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An institution object. If the Item was created via Same-Day micro-deposit verification, will be `null`. - class LinkSessionExitMetadataInstitution - # The full institution name, such as `Wells Fargo` - attr_accessor :name - - # The Plaid institution identifier - attr_accessor :institution_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'institution_id' => :'institution_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'institution_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkSessionExitMetadataInstitution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkSessionExitMetadataInstitution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - institution_id == o.institution_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, institution_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_session_finished_webhook.rb b/lib/plaid/models/link_session_finished_webhook.rb deleted file mode 100644 index 9d45c6a9e..000000000 --- a/lib/plaid/models/link_session_finished_webhook.rb +++ /dev/null @@ -1,332 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Contains the state of a completed Link session, along with the public token if available. - class LinkSessionFinishedWebhook - # `LINK` - attr_accessor :webhook_type - - # `SESSION_FINISHED` - attr_accessor :webhook_code - - # The final status of the Link session. Will always be \"SUCCESS\" or \"EXITED\". - attr_accessor :status - - # The identifier for the Link session. - attr_accessor :link_session_id - - # The link token used to create the Link session. - attr_accessor :link_token - - # The public token generated by the Link session. - attr_accessor :public_token - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'status' => :'status', - :'link_session_id' => :'link_session_id', - :'link_token' => :'link_token', - :'public_token' => :'public_token', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'status' => :'String', - :'link_session_id' => :'String', - :'link_token' => :'String', - :'public_token' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkSessionFinishedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkSessionFinishedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'link_session_id') - self.link_session_id = attributes[:'link_session_id'] - end - - if attributes.key?(:'link_token') - self.link_token = attributes[:'link_token'] - end - - if attributes.key?(:'public_token') - self.public_token = attributes[:'public_token'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @link_session_id.nil? - invalid_properties.push('invalid value for "link_session_id", link_session_id cannot be nil.') - end - - if @link_token.nil? - invalid_properties.push('invalid value for "link_token", link_token cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @status.nil? - return false if @link_session_id.nil? - return false if @link_token.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - status == o.status && - link_session_id == o.link_session_id && - link_token == o.link_token && - public_token == o.public_token && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, status, link_session_id, link_token, public_token, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_session_success.rb b/lib/plaid/models/link_session_success.rb deleted file mode 100644 index 28575c5d1..000000000 --- a/lib/plaid/models/link_session_success.rb +++ /dev/null @@ -1,236 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing an [onSuccess](https://plaid.com/docs/link/web/#onsuccess) callback from Link. - class LinkSessionSuccess - # Displayed once a user has successfully linked their Item. - attr_accessor :public_token - - attr_accessor :metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'public_token' => :'public_token', - :'metadata' => :'metadata' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'public_token' => :'String', - :'metadata' => :'LinkSessionSuccessMetadata' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'metadata' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkSessionSuccess` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkSessionSuccess`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'public_token') - self.public_token = attributes[:'public_token'] - end - - if attributes.key?(:'metadata') - self.metadata = attributes[:'metadata'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @public_token.nil? - invalid_properties.push('invalid value for "public_token", public_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @public_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - public_token == o.public_token && - metadata == o.metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [public_token, metadata].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_session_success_metadata.rb b/lib/plaid/models/link_session_success_metadata.rb deleted file mode 100644 index 4f8746d1f..000000000 --- a/lib/plaid/models/link_session_success_metadata.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Displayed once a user has successfully linked their Item. - class LinkSessionSuccessMetadata - attr_accessor :institution - - # A list of accounts attached to the connected Item. If Account Select is enabled via the developer dashboard, `accounts` will only include selected accounts. - attr_accessor :accounts - - # 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. - attr_accessor :link_session_id - - attr_accessor :transfer_status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'institution' => :'institution', - :'accounts' => :'accounts', - :'link_session_id' => :'link_session_id', - :'transfer_status' => :'transfer_status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'institution' => :'LinkSessionSuccessMetadataInstitution', - :'accounts' => :'Array', - :'link_session_id' => :'String', - :'transfer_status' => :'LinkSessionSuccessMetadataTransferStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'institution', - :'transfer_status' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkSessionSuccessMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkSessionSuccessMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'institution') - self.institution = attributes[:'institution'] - end - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - - if attributes.key?(:'link_session_id') - self.link_session_id = attributes[:'link_session_id'] - end - - if attributes.key?(:'transfer_status') - self.transfer_status = attributes[:'transfer_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - institution == o.institution && - accounts == o.accounts && - link_session_id == o.link_session_id && - transfer_status == o.transfer_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [institution, accounts, link_session_id, transfer_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_session_success_metadata_account.rb b/lib/plaid/models/link_session_success_metadata_account.rb deleted file mode 100644 index 309c95c2f..000000000 --- a/lib/plaid/models/link_session_success_metadata_account.rb +++ /dev/null @@ -1,284 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An account attached to the connected Item. - class LinkSessionSuccessMetadataAccount - # The Plaid `account_id` - attr_accessor :id - - # The official account name - attr_accessor :name - - # 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. It may also not match the mask that the bank displays to the user. - attr_accessor :mask - - # The account type. See the [Account schema](/docs/api/accounts#account-type-schema) for a full list of possible values - attr_accessor :type - - # The account subtype. See the [Account schema](/docs/api/accounts#account-type-schema) for a full list of possible values - attr_accessor :subtype - - # Indicates an Item's micro-deposit-based 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 code. `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. `database_insights_pass`: The Item's ACH numbers have been verified using Plaid's data sources and have strong signal for being valid. Note: Database Insights is currently a beta feature, please contact your account manager for more information. `database_insights_pass_with_caution`: The Item's ACH numbers have been verified using Plaid's data sources and have some signal for being valid. Note: Database Insights is currently a beta feature, please contact your account manager for more information. `database_insights_fail`: The Item's ACH numbers have been verified using Plaid's data sources and have signal for being invalid and/or have no signal for being valid. Note: Database Insights is currently a beta feature, please contact your account manager for more information. `null`: micro-deposit-based verification is not being used for the Item. - attr_accessor :verification_status - - # If micro-deposit verification is being used, indicates whether the account being verified is a `business` or `personal` account. - attr_accessor :class_type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'name' => :'name', - :'mask' => :'mask', - :'type' => :'type', - :'subtype' => :'subtype', - :'verification_status' => :'verification_status', - :'class_type' => :'class_type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'name' => :'String', - :'mask' => :'String', - :'type' => :'String', - :'subtype' => :'String', - :'verification_status' => :'String', - :'class_type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'mask', - :'verification_status', - :'class_type' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkSessionSuccessMetadataAccount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkSessionSuccessMetadataAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'mask') - self.mask = attributes[:'mask'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'subtype') - self.subtype = attributes[:'subtype'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - - if attributes.key?(:'class_type') - self.class_type = attributes[:'class_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - name == o.name && - mask == o.mask && - type == o.type && - subtype == o.subtype && - verification_status == o.verification_status && - class_type == o.class_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, name, mask, type, subtype, verification_status, class_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_session_success_metadata_institution.rb b/lib/plaid/models/link_session_success_metadata_institution.rb deleted file mode 100644 index 89a598f34..000000000 --- a/lib/plaid/models/link_session_success_metadata_institution.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An institution object. If the Item was created via Same-Day micro-deposit verification, will be `null`. - class LinkSessionSuccessMetadataInstitution - # The full institution name, such as `'Wells Fargo'` - attr_accessor :name - - # The Plaid institution identifier - attr_accessor :institution_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'institution_id' => :'institution_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'institution_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkSessionSuccessMetadataInstitution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkSessionSuccessMetadataInstitution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - institution_id == o.institution_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, institution_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_session_success_metadata_transfer_status.rb b/lib/plaid/models/link_session_success_metadata_transfer_status.rb deleted file mode 100644 index 0aec4171e..000000000 --- a/lib/plaid/models/link_session_success_metadata_transfer_status.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class LinkSessionSuccessMetadataTransferStatus - COMPLETE = "COMPLETE".freeze - INCOMPLETE = "INCOMPLETE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/link_token_account_filters.rb b/lib/plaid/models/link_token_account_filters.rb deleted file mode 100644 index 454841473..000000000 --- a/lib/plaid/models/link_token_account_filters.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # By default, Link will provide limited account filtering: it will only display Institutions that are compatible with all products supplied in the `products` parameter of `/link/token/create`, and, if `auth` is specified in the `products` array, will also filter out accounts other than `checking` and `savings` accounts on the Account Select pane. You can further limit the accounts shown in Link by using `account_filters` to specify the account subtypes to be shown in Link. Only the specified subtypes will be shown. This filtering applies to both the Account Select view (if enabled) and the Institution Select view. Institutions that do not support the selected subtypes will be omitted from Link. To indicate that all subtypes should be shown, use the value `\"all\"`. If the `account_filters` filter is used, any account type for which a filter is not specified will be entirely omitted from Link. For a full list of valid types and subtypes, see the [Account schema](https://plaid.com/docs/api/accounts#account-type-schema). The filter may or may not impact the list of accounts shown by the institution in the OAuth account selection flow, depending on the specific institution. If the user selects excluded account subtypes in the OAuth flow, these accounts will not be added to the Item. If the user selects only excluded account subtypes, the link attempt will fail and the user will be prompted to try again. - class LinkTokenAccountFilters - attr_accessor :depository - - attr_accessor :credit - - attr_accessor :loan - - attr_accessor :investment - - attr_accessor :other - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'depository' => :'depository', - :'credit' => :'credit', - :'loan' => :'loan', - :'investment' => :'investment', - :'other' => :'other' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'depository' => :'DepositoryFilter', - :'credit' => :'CreditFilter', - :'loan' => :'LoanFilter', - :'investment' => :'InvestmentFilter', - :'other' => :'OtherFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenAccountFilters` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenAccountFilters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'depository') - self.depository = attributes[:'depository'] - end - - if attributes.key?(:'credit') - self.credit = attributes[:'credit'] - end - - if attributes.key?(:'loan') - self.loan = attributes[:'loan'] - end - - if attributes.key?(:'investment') - self.investment = attributes[:'investment'] - end - - if attributes.key?(:'other') - self.other = attributes[:'other'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - depository == o.depository && - credit == o.credit && - loan == o.loan && - investment == o.investment && - other == o.other - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [depository, credit, loan, investment, other].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_card_switch.rb b/lib/plaid/models/link_token_create_card_switch.rb deleted file mode 100644 index 9e107ab26..000000000 --- a/lib/plaid/models/link_token_create_card_switch.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A map containing data to pass in for the Card Switch flow. - class LinkTokenCreateCardSwitch - # The BIN (Bank Identification Number) of the card to switch. - attr_accessor :card_bin - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'card_bin' => :'card_bin' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'card_bin' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateCardSwitch` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateCardSwitch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'card_bin') - self.card_bin = attributes[:'card_bin'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @card_bin.nil? - invalid_properties.push('invalid value for "card_bin", card_bin cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @card_bin.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - card_bin == o.card_bin - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [card_bin].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_credit_filter.rb b/lib/plaid/models/link_token_create_credit_filter.rb deleted file mode 100644 index afce8527f..000000000 --- a/lib/plaid/models/link_token_create_credit_filter.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A filter to apply to `credit`-type accounts - class LinkTokenCreateCreditFilter - # 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). - attr_accessor :account_subtypes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_subtypes' => :'account_subtypes' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_subtypes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateCreditFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateCreditFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_subtypes') - if (value = attributes[:'account_subtypes']).is_a?(Array) - self.account_subtypes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_subtypes == o.account_subtypes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_subtypes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_depository_filter.rb b/lib/plaid/models/link_token_create_depository_filter.rb deleted file mode 100644 index ba29a1d44..000000000 --- a/lib/plaid/models/link_token_create_depository_filter.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A filter to apply to `depository`-type accounts - class LinkTokenCreateDepositoryFilter - # 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). - attr_accessor :account_subtypes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_subtypes' => :'account_subtypes' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_subtypes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateDepositoryFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateDepositoryFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_subtypes') - if (value = attributes[:'account_subtypes']).is_a?(Array) - self.account_subtypes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_subtypes == o.account_subtypes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_subtypes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_hosted_link.rb b/lib/plaid/models/link_token_create_hosted_link.rb deleted file mode 100644 index 07c5c8c72..000000000 --- a/lib/plaid/models/link_token_create_hosted_link.rb +++ /dev/null @@ -1,274 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Configuration parameters for Hosted Link (beta). Only available for participants in the Hosted Link beta program. - class LinkTokenCreateHostedLink - attr_accessor :delivery_method - - # 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. - attr_accessor :completion_redirect_uri - - # How many seconds the link will be valid for. Must be positive. Cannot be longer than 21 days. The default lifetime is 4 hours. - attr_accessor :url_lifetime_seconds - - # This indicates whether the client is opening hosted Link in a mobile app in an out of process web view (OOPWV). - attr_accessor :is_mobile_app - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'delivery_method' => :'delivery_method', - :'completion_redirect_uri' => :'completion_redirect_uri', - :'url_lifetime_seconds' => :'url_lifetime_seconds', - :'is_mobile_app' => :'is_mobile_app' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'delivery_method' => :'HostedLinkDeliveryMethod', - :'completion_redirect_uri' => :'String', - :'url_lifetime_seconds' => :'Integer', - :'is_mobile_app' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateHostedLink` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateHostedLink`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'delivery_method') - self.delivery_method = attributes[:'delivery_method'] - end - - if attributes.key?(:'completion_redirect_uri') - self.completion_redirect_uri = attributes[:'completion_redirect_uri'] - end - - if attributes.key?(:'url_lifetime_seconds') - self.url_lifetime_seconds = attributes[:'url_lifetime_seconds'] - end - - if attributes.key?(:'is_mobile_app') - self.is_mobile_app = attributes[:'is_mobile_app'] - else - self.is_mobile_app = false - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - delivery_method == o.delivery_method && - completion_redirect_uri == o.completion_redirect_uri && - url_lifetime_seconds == o.url_lifetime_seconds && - is_mobile_app == o.is_mobile_app - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [delivery_method, completion_redirect_uri, url_lifetime_seconds, is_mobile_app].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_identity.rb b/lib/plaid/models/link_token_create_identity.rb deleted file mode 100644 index 053ca358d..000000000 --- a/lib/plaid/models/link_token_create_identity.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Identity object used to specify document upload - class LinkTokenCreateIdentity - # Used to specify whether the Link session is Identity Document Upload - attr_accessor :is_document_upload - - # An array of `account_ids` - attr_accessor :account_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'is_document_upload' => :'is_document_upload', - :'account_ids' => :'account_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'is_document_upload' => :'Boolean', - :'account_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateIdentity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateIdentity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'is_document_upload') - self.is_document_upload = attributes[:'is_document_upload'] - end - - if attributes.key?(:'account_ids') - if (value = attributes[:'account_ids']).is_a?(Array) - self.account_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - is_document_upload == o.is_document_upload && - account_ids == o.account_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [is_document_upload, account_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_institution_data.rb b/lib/plaid/models/link_token_create_institution_data.rb deleted file mode 100644 index f9bc55457..000000000 --- a/lib/plaid/models/link_token_create_institution_data.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A map containing data used to highlight institutions in Link. - class LinkTokenCreateInstitutionData - # The routing number of the bank to highlight in Link. Note: in rare cases, a single routing number can be associated with multiple institutions, e.g. due to a brokerage using another institution to manage ACH on its sweep accounts. If this happens, the bank will not be highlighted in Link even if the routing number is provided. - attr_accessor :routing_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'routing_number' => :'routing_number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'routing_number' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateInstitutionData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateInstitutionData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'routing_number') - self.routing_number = attributes[:'routing_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - routing_number == o.routing_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [routing_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_investment_filter.rb b/lib/plaid/models/link_token_create_investment_filter.rb deleted file mode 100644 index f94423282..000000000 --- a/lib/plaid/models/link_token_create_investment_filter.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A filter to apply to `investment`-type accounts (or `brokerage`-type accounts for API versions 2018-05-22 and earlier). - class LinkTokenCreateInvestmentFilter - # 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). - attr_accessor :account_subtypes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_subtypes' => :'account_subtypes' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_subtypes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateInvestmentFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateInvestmentFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_subtypes') - if (value = attributes[:'account_subtypes']).is_a?(Array) - self.account_subtypes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_subtypes == o.account_subtypes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_subtypes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_loan_filter.rb b/lib/plaid/models/link_token_create_loan_filter.rb deleted file mode 100644 index 4de845bb1..000000000 --- a/lib/plaid/models/link_token_create_loan_filter.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A filter to apply to `loan`-type accounts - class LinkTokenCreateLoanFilter - # 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). - attr_accessor :account_subtypes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_subtypes' => :'account_subtypes' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_subtypes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateLoanFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateLoanFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_subtypes') - if (value = attributes[:'account_subtypes']).is_a?(Array) - self.account_subtypes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_subtypes == o.account_subtypes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_subtypes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request.rb b/lib/plaid/models/link_token_create_request.rb deleted file mode 100644 index 1f5c3370a..000000000 --- a/lib/plaid/models/link_token_create_request.rb +++ /dev/null @@ -1,728 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # LinkTokenCreateRequest defines the request schema for `/link/token/create` - class LinkTokenCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The name of your application, as it should be displayed in Link. Maximum length of 30 characters. If a value longer than 30 characters is provided, Link will display \"This Application\" instead. - attr_accessor :client_name - - # The language that Link should be displayed in. When initializing with Identity Verification, this field is not used; for more details, see [Identity Verification supported languages](https://www.plaid.com/docs/identity-verification/#supported-languages). Supported languages are: - Danish (`'da'`) - Dutch (`'nl'`) - English (`'en'`) - Estonian (`'et'`) - French (`'fr'`) - German (`'de'`) - Italian (`'it'`) - Latvian (`'lv'`) - Lithuanian (`'lt'`) - Norwegian (`'no'`) - Polish (`'pl'`) - Portuguese (`'pt'`) - Romanian (`'ro'`) - Spanish (`'es'`) - Swedish (`'sv'`) When using a Link customization, the language configured here must match the setting in the customization, or the customization will not be applied. - attr_accessor :language - - # Specify an array of Plaid-supported country codes using the ISO-3166-1 alpha-2 country code standard. Institutions from all listed countries will be shown. For a complete mapping of supported products by country, see https://plaid.com/global/. If using Identity Verification, `country_codes` should be set to the country where your company is based, not the country where your user is located. For all other products, `country_codes` represents the location of your user's financial institution. If Link is launched with multiple country codes, only products that you are enabled for in all countries will be used by Link. Note that while all countries are enabled by default in Sandbox and Development, in Production only US and Canada are enabled by default. Access to European institutions requires additional compliance steps. To request access to European institutions in the Production environment, [file a product access Support ticket](https://dashboard.plaid.com/support/new/product-and-development/product-troubleshooting/request-product-access) via the Plaid dashboard. If you initialize with a European country code, your users will see the European consent panel during the Link flow. If using a Link customization, make sure the country codes in the customization match those specified in `country_codes`, or the customization may not be applied. If using the Auth features Instant Match, Same-day Micro-deposits, or Automated Micro-deposits, `country_codes` must be set to `['US']`. - attr_accessor :country_codes - - attr_accessor :user - - # List of Plaid product(s) you wish to use. If launching Link in update mode, should be omitted (unless you are using update mode to add Income or Assets to an Item); required otherwise. `balance` is *not* a valid value, the Balance product does not require explicit initialization and will automatically be initialized when any other product is initialized. The products specified here will determine which institutions will be available to your users in Link. Only institutions that support *all* requested products can be selected; a if a user attempts to select an institution that does not support a listed product, a \"Connectivity not supported\" error message will appear in Link. To maximize the number of institutions available, initialize Link with the minimal product set required for your use case. Additional products can be included via the [`optional_products`](https://plaid.com/docs/api/tokens/#link-token-create-request-optional-products) or [`required_if_supported_products`](https://plaid.com/docs/api/tokens/#link-token-create-request-required-if-supported-products) fields, or can be initialized by calling the endpoint after obtaining an access token. For details and exceptions, see [Choosing when to initialize products](https://plaid.com/docs/link/initializing-products/). Note that, unless you have opted to disable Instant Match support, institutions that support Instant Match will also be shown in Link if `auth` is specified as a product, even though these institutions do not contain `auth` in their product array. In Production, you will be billed for each product that you specify when initializing Link. Note that a product cannot be removed from an Item once the Item has been initialized with that product. To stop billing on an Item for subscription-based products, such as Liabilities, Investments, and Transactions, remove the Item via `/item/remove`. - attr_accessor :products - - # List of Plaid product(s) you wish to use only if the institution and account(s) selected by the user support the product. Institutions that do not support these products will still be shown in Link. The products will only be extracted and billed if the user selects an institution and account type that supports them. There should be no overlap between this array and the `products`, `optional_products`, or `additional_consented_products` arrays. The `products` array must have at least one product. For more details on using this feature, see [Required if Supported Products](https://www.plaid.com/docs/link/initializing-products/#required-if-supported-products). - attr_accessor :required_if_supported_products - - # List of Plaid product(s) that you may wish to use but that are not required for your use case. Plaid will attempt to fetch data for these products on a best-effort basis, and failure to support these products will not affect Item creation. There should be no overlap between this array and the `products`, `required_if_supported_products`, or `additional_consented_products` arrays. The `products` array must have at least one product. For more details on using this feature, see [Optional Products](https://www.plaid.com/docs/link/initializing-products/#optional-products). - attr_accessor :optional_products - - # (Beta) This field has no effect unless you are participating in the [Data Transparency](https://plaid.com/docs/link/data-transparency-messaging-migration-guide) beta program. List of additional Plaid product(s) you wish to collect consent for. These products will not be billed until you start using them by calling the relevant endpoints. `balance` is *not* a valid value, the Balance product does not require explicit initialization and will automatically have consent collected. Institutions that do not support these products will still be shown in Link. There should be no overlap between this array and the `products` or `required_if_supported_products` arrays. - attr_accessor :additional_consented_products - - # The destination URL to which any webhooks should be sent. Note that webhooks for Payment Initiation (e-wallet transactions only), Transfer, Bank Transfer (including Auth micro-deposit notification webhooks) and Identity Verification are configured via the Dashboard instead. - attr_accessor :webhook - - # The `access_token` associated with the Item to update or reference, used when updating, modifying, or accessing an existing `access_token`. Used when launching Link in update mode, when completing the Same-day (manual) Micro-deposit flow, or (optionally) when initializing Link for a returning user as part of the Transfer UI flow. - attr_accessor :access_token - - # A list of access tokens associated with the items to update in Link update mode for the Assets product. Using this instead of the `access_token` field allows the updating of multiple items at once. This feature is in closed beta, please contact your account manager for more info. - attr_accessor :access_tokens - - # The name of the Link customization from the Plaid Dashboard to be applied to Link. If not specified, the `default` customization will be used. When using a Link customization, the language in the customization must match the language selected via the `language` parameter, and the countries in the customization should match the country codes selected via `country_codes`. - attr_accessor :link_customization_name - - # A URI indicating the destination where a user should be forwarded after completing the Link flow; used to support OAuth authentication flows when launching Link in the browser or via a webview. The `redirect_uri` should not contain any query parameters. When used in Production or Development, must be an https URI. To specify any subdomain, use `*` as a wildcard character, e.g. `https://*.example.com/oauth.html`. Note that any redirect URI must also be added to the Allowed redirect URIs list in the [developer dashboard](https://dashboard.plaid.com/team/api). If initializing on Android, `android_package_name` must be specified instead and `redirect_uri` should be left blank. If using Hosted Link (beta) the `redirect_uri` must be set to `https://hosted.plaid.com/oauth/redirect`. - attr_accessor :redirect_uri - - # The name of your app's Android package. Required if using the `link_token` to initialize Link on Android. Any package name specified here must also be added to the Allowed Android package names setting on the [developer dashboard](https://dashboard.plaid.com/team/api). When creating a `link_token` for initializing Link on other platforms, `android_package_name` must be left blank and `redirect_uri` should be used instead. - attr_accessor :android_package_name - - attr_accessor :institution_data - - attr_accessor :card_switch - - attr_accessor :account_filters - - attr_accessor :eu_config - - # Used for certain Europe-only configurations, as well as certain legacy use cases in other regions. - attr_accessor :institution_id - - attr_accessor :payment_initiation - - attr_accessor :deposit_switch - - attr_accessor :employment - - attr_accessor :income_verification - - attr_accessor :base_report - - attr_accessor :credit_partner_insights - - attr_accessor :consumer_report_permissible_purpose - - attr_accessor :auth - - attr_accessor :transfer - - attr_accessor :update - - attr_accessor :identity_verification - - attr_accessor :statements - - # A user token generated using `/user/create`. Any Item created during the Link session will be associated with the user. - attr_accessor :user_token - - attr_accessor :investments - - attr_accessor :investments_auth - - attr_accessor :hosted_link - - attr_accessor :transactions - - # If `true`, request a CRA connection. Defaults to `false`. - attr_accessor :cra_enabled - - attr_accessor :identity - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'client_name' => :'client_name', - :'language' => :'language', - :'country_codes' => :'country_codes', - :'user' => :'user', - :'products' => :'products', - :'required_if_supported_products' => :'required_if_supported_products', - :'optional_products' => :'optional_products', - :'additional_consented_products' => :'additional_consented_products', - :'webhook' => :'webhook', - :'access_token' => :'access_token', - :'access_tokens' => :'access_tokens', - :'link_customization_name' => :'link_customization_name', - :'redirect_uri' => :'redirect_uri', - :'android_package_name' => :'android_package_name', - :'institution_data' => :'institution_data', - :'card_switch' => :'card_switch', - :'account_filters' => :'account_filters', - :'eu_config' => :'eu_config', - :'institution_id' => :'institution_id', - :'payment_initiation' => :'payment_initiation', - :'deposit_switch' => :'deposit_switch', - :'employment' => :'employment', - :'income_verification' => :'income_verification', - :'base_report' => :'base_report', - :'credit_partner_insights' => :'credit_partner_insights', - :'consumer_report_permissible_purpose' => :'consumer_report_permissible_purpose', - :'auth' => :'auth', - :'transfer' => :'transfer', - :'update' => :'update', - :'identity_verification' => :'identity_verification', - :'statements' => :'statements', - :'user_token' => :'user_token', - :'investments' => :'investments', - :'investments_auth' => :'investments_auth', - :'hosted_link' => :'hosted_link', - :'transactions' => :'transactions', - :'cra_enabled' => :'cra_enabled', - :'identity' => :'identity' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'client_name' => :'String', - :'language' => :'String', - :'country_codes' => :'Array', - :'user' => :'LinkTokenCreateRequestUser', - :'products' => :'Array', - :'required_if_supported_products' => :'Array', - :'optional_products' => :'Array', - :'additional_consented_products' => :'Array', - :'webhook' => :'String', - :'access_token' => :'String', - :'access_tokens' => :'Array', - :'link_customization_name' => :'String', - :'redirect_uri' => :'String', - :'android_package_name' => :'String', - :'institution_data' => :'LinkTokenCreateInstitutionData', - :'card_switch' => :'LinkTokenCreateCardSwitch', - :'account_filters' => :'LinkTokenAccountFilters', - :'eu_config' => :'LinkTokenEUConfig', - :'institution_id' => :'String', - :'payment_initiation' => :'LinkTokenCreateRequestPaymentInitiation', - :'deposit_switch' => :'LinkTokenCreateRequestDepositSwitch', - :'employment' => :'LinkTokenCreateRequestEmployment', - :'income_verification' => :'LinkTokenCreateRequestIncomeVerification', - :'base_report' => :'LinkTokenCreateRequestBaseReport', - :'credit_partner_insights' => :'LinkTokenCreateRequestCreditPartnerInsights', - :'consumer_report_permissible_purpose' => :'ConsumerReportPermissiblePurpose', - :'auth' => :'LinkTokenCreateRequestAuth', - :'transfer' => :'LinkTokenCreateRequestTransfer', - :'update' => :'LinkTokenCreateRequestUpdate', - :'identity_verification' => :'LinkTokenCreateRequestIdentityVerification', - :'statements' => :'LinkTokenCreateRequestStatements', - :'user_token' => :'String', - :'investments' => :'LinkTokenInvestments', - :'investments_auth' => :'LinkTokenInvestmentsAuth', - :'hosted_link' => :'LinkTokenCreateHostedLink', - :'transactions' => :'LinkTokenTransactions', - :'cra_enabled' => :'Boolean', - :'identity' => :'LinkTokenCreateIdentity' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'products', - :'required_if_supported_products', - :'optional_products', - :'additional_consented_products', - :'access_token', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_name') - self.client_name = attributes[:'client_name'] - end - - if attributes.key?(:'language') - self.language = attributes[:'language'] - end - - if attributes.key?(:'country_codes') - if (value = attributes[:'country_codes']).is_a?(Array) - self.country_codes = value - end - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'products') - if (value = attributes[:'products']).is_a?(Array) - self.products = value - end - end - - if attributes.key?(:'required_if_supported_products') - if (value = attributes[:'required_if_supported_products']).is_a?(Array) - self.required_if_supported_products = value - end - end - - if attributes.key?(:'optional_products') - if (value = attributes[:'optional_products']).is_a?(Array) - self.optional_products = value - end - end - - if attributes.key?(:'additional_consented_products') - if (value = attributes[:'additional_consented_products']).is_a?(Array) - self.additional_consented_products = value - end - end - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'access_tokens') - if (value = attributes[:'access_tokens']).is_a?(Array) - self.access_tokens = value - end - end - - if attributes.key?(:'link_customization_name') - self.link_customization_name = attributes[:'link_customization_name'] - end - - if attributes.key?(:'redirect_uri') - self.redirect_uri = attributes[:'redirect_uri'] - end - - if attributes.key?(:'android_package_name') - self.android_package_name = attributes[:'android_package_name'] - end - - if attributes.key?(:'institution_data') - self.institution_data = attributes[:'institution_data'] - end - - if attributes.key?(:'card_switch') - self.card_switch = attributes[:'card_switch'] - end - - if attributes.key?(:'account_filters') - self.account_filters = attributes[:'account_filters'] - end - - if attributes.key?(:'eu_config') - self.eu_config = attributes[:'eu_config'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'payment_initiation') - self.payment_initiation = attributes[:'payment_initiation'] - end - - if attributes.key?(:'deposit_switch') - self.deposit_switch = attributes[:'deposit_switch'] - end - - if attributes.key?(:'employment') - self.employment = attributes[:'employment'] - end - - if attributes.key?(:'income_verification') - self.income_verification = attributes[:'income_verification'] - end - - if attributes.key?(:'base_report') - self.base_report = attributes[:'base_report'] - end - - if attributes.key?(:'credit_partner_insights') - self.credit_partner_insights = attributes[:'credit_partner_insights'] - end - - if attributes.key?(:'consumer_report_permissible_purpose') - self.consumer_report_permissible_purpose = attributes[:'consumer_report_permissible_purpose'] - end - - if attributes.key?(:'auth') - self.auth = attributes[:'auth'] - end - - if attributes.key?(:'transfer') - self.transfer = attributes[:'transfer'] - end - - if attributes.key?(:'update') - self.update = attributes[:'update'] - end - - if attributes.key?(:'identity_verification') - self.identity_verification = attributes[:'identity_verification'] - end - - if attributes.key?(:'statements') - self.statements = attributes[:'statements'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - - if attributes.key?(:'investments') - self.investments = attributes[:'investments'] - end - - if attributes.key?(:'investments_auth') - self.investments_auth = attributes[:'investments_auth'] - end - - if attributes.key?(:'hosted_link') - self.hosted_link = attributes[:'hosted_link'] - end - - if attributes.key?(:'transactions') - self.transactions = attributes[:'transactions'] - end - - if attributes.key?(:'cra_enabled') - self.cra_enabled = attributes[:'cra_enabled'] - end - - if attributes.key?(:'identity') - self.identity = attributes[:'identity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @client_name.nil? - invalid_properties.push('invalid value for "client_name", client_name cannot be nil.') - end - - if @client_name.to_s.length < 1 - invalid_properties.push('invalid value for "client_name", the character length must be great than or equal to 1.') - end - - - if @language.nil? - invalid_properties.push('invalid value for "language", language cannot be nil.') - end - - if @language.to_s.length < 1 - invalid_properties.push('invalid value for "language", the character length must be great than or equal to 1.') - end - - - if @country_codes.nil? - invalid_properties.push('invalid value for "country_codes", country_codes cannot be nil.') - end - - - if @country_codes.length < 1 - invalid_properties.push('invalid value for "country_codes", number of items must be greater than or equal to 1.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if !@access_token.nil? && @access_token.to_s.length < 1 - invalid_properties.push('invalid value for "access_token", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @client_name.nil? - return false if @client_name.to_s.length < 1 - return false if @language.nil? - return false if @language.to_s.length < 1 - return false if @country_codes.nil? - return false if @country_codes.length < 1 - return false if @user.nil? - return false if !@access_token.nil? && @access_token.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] client_name Value to be assigned - def client_name=(client_name) - if client_name.nil? - fail ArgumentError, 'client_name cannot be nil' - end - - if client_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_name", the character length must be great than or equal to 1.' - end - - - @client_name = client_name - end - - # Custom attribute writer method with validation - # @param [Object] language Value to be assigned - def language=(language) - if language.nil? - fail ArgumentError, 'language cannot be nil' - end - - if language.to_s.length < 1 - fail ArgumentError, 'invalid value for "language", the character length must be great than or equal to 1.' - end - - - @language = language - end - - # Custom attribute writer method with validation - # @param [Object] country_codes Value to be assigned - def country_codes=(country_codes) - if country_codes.nil? - fail ArgumentError, 'country_codes cannot be nil' - end - - - if country_codes.length < 1 - fail ArgumentError, 'invalid value for "country_codes", number of items must be greater than or equal to 1.' - end - - @country_codes = country_codes - end - - # Custom attribute writer method with validation - # @param [Object] access_token Value to be assigned - def access_token=(access_token) - if !access_token.nil? && access_token.to_s.length < 1 - fail ArgumentError, 'invalid value for "access_token", the character length must be great than or equal to 1.' - end - - - @access_token = access_token - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - client_name == o.client_name && - language == o.language && - country_codes == o.country_codes && - user == o.user && - products == o.products && - required_if_supported_products == o.required_if_supported_products && - optional_products == o.optional_products && - additional_consented_products == o.additional_consented_products && - webhook == o.webhook && - access_token == o.access_token && - access_tokens == o.access_tokens && - link_customization_name == o.link_customization_name && - redirect_uri == o.redirect_uri && - android_package_name == o.android_package_name && - institution_data == o.institution_data && - card_switch == o.card_switch && - account_filters == o.account_filters && - eu_config == o.eu_config && - institution_id == o.institution_id && - payment_initiation == o.payment_initiation && - deposit_switch == o.deposit_switch && - employment == o.employment && - income_verification == o.income_verification && - base_report == o.base_report && - credit_partner_insights == o.credit_partner_insights && - consumer_report_permissible_purpose == o.consumer_report_permissible_purpose && - auth == o.auth && - transfer == o.transfer && - update == o.update && - identity_verification == o.identity_verification && - statements == o.statements && - user_token == o.user_token && - investments == o.investments && - investments_auth == o.investments_auth && - hosted_link == o.hosted_link && - transactions == o.transactions && - cra_enabled == o.cra_enabled && - identity == o.identity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, client_name, language, country_codes, user, products, required_if_supported_products, optional_products, additional_consented_products, webhook, access_token, access_tokens, link_customization_name, redirect_uri, android_package_name, institution_data, card_switch, account_filters, eu_config, institution_id, payment_initiation, deposit_switch, employment, income_verification, base_report, credit_partner_insights, consumer_report_permissible_purpose, auth, transfer, update, identity_verification, statements, user_token, investments, investments_auth, hosted_link, transactions, cra_enabled, identity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_account_subtypes.rb b/lib/plaid/models/link_token_create_request_account_subtypes.rb deleted file mode 100644 index c7e95f559..000000000 --- a/lib/plaid/models/link_token_create_request_account_subtypes.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # By default, Link will only display account types that are compatible with all products supplied in the `products` parameter of `/link/token/create`. You can further limit the accounts shown in Link by using `account_filters` to specify the account subtypes to be shown in Link. Only the specified subtypes will be shown. This filtering applies to both the Account Select view (if enabled) and the Institution Select view. Institutions that do not support the selected subtypes will be omitted from Link. To indicate that all subtypes should be shown, use the value `\"all\"`. If the `account_filters` filter is used, any account type for which a filter is not specified will be entirely omitted from Link. For a full list of valid types and subtypes, see the [Account schema](https://plaid.com/docs/api/accounts#account-type-schema). For institutions using OAuth, the filter will not affect the list of institutions or accounts shown by the bank in the OAuth window. - class LinkTokenCreateRequestAccountSubtypes - attr_accessor :depository - - attr_accessor :credit - - attr_accessor :loan - - attr_accessor :investment - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'depository' => :'depository', - :'credit' => :'credit', - :'loan' => :'loan', - :'investment' => :'investment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'depository' => :'LinkTokenCreateDepositoryFilter', - :'credit' => :'LinkTokenCreateCreditFilter', - :'loan' => :'LinkTokenCreateLoanFilter', - :'investment' => :'LinkTokenCreateInvestmentFilter' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestAccountSubtypes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestAccountSubtypes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'depository') - self.depository = attributes[:'depository'] - end - - if attributes.key?(:'credit') - self.credit = attributes[:'credit'] - end - - if attributes.key?(:'loan') - self.loan = attributes[:'loan'] - end - - if attributes.key?(:'investment') - self.investment = attributes[:'investment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - depository == o.depository && - credit == o.credit && - loan == o.loan && - investment == o.investment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [depository, credit, loan, investment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_auth.rb b/lib/plaid/models/link_token_create_request_auth.rb deleted file mode 100644 index d97857b29..000000000 --- a/lib/plaid/models/link_token_create_request_auth.rb +++ /dev/null @@ -1,349 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class 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. - attr_accessor :auth_type_select_enabled - - # Specifies whether the Link session is enabled for the Automated Micro-deposits flow. - attr_accessor :automated_microdeposits_enabled - - # 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`. - attr_accessor :instant_match_enabled - - # Specifies whether the Link session is enabled for the Same Day Micro-deposits flow. - attr_accessor :same_day_microdeposits_enabled - - # Specifies whether the Link session is enabled for the Instant Micro-deposits flow. - attr_accessor :instant_microdeposits_enabled - - # 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`. - attr_accessor :reroute_to_credentials - - # Specifies whether the Link session is enabled for the Database Match flow. - attr_accessor :database_match_enabled - - # Specifies whether the Link session is enabled for the Database Insights flow. - attr_accessor :database_insights_enabled - - # This field has been deprecated in favor of `auth_type_select_enabled`. - attr_accessor :flow_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'auth_type_select_enabled' => :'auth_type_select_enabled', - :'automated_microdeposits_enabled' => :'automated_microdeposits_enabled', - :'instant_match_enabled' => :'instant_match_enabled', - :'same_day_microdeposits_enabled' => :'same_day_microdeposits_enabled', - :'instant_microdeposits_enabled' => :'instant_microdeposits_enabled', - :'reroute_to_credentials' => :'reroute_to_credentials', - :'database_match_enabled' => :'database_match_enabled', - :'database_insights_enabled' => :'database_insights_enabled', - :'flow_type' => :'flow_type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'auth_type_select_enabled' => :'Boolean', - :'automated_microdeposits_enabled' => :'Boolean', - :'instant_match_enabled' => :'Boolean', - :'same_day_microdeposits_enabled' => :'Boolean', - :'instant_microdeposits_enabled' => :'Boolean', - :'reroute_to_credentials' => :'String', - :'database_match_enabled' => :'Boolean', - :'database_insights_enabled' => :'Boolean', - :'flow_type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestAuth` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestAuth`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'auth_type_select_enabled') - self.auth_type_select_enabled = attributes[:'auth_type_select_enabled'] - else - self.auth_type_select_enabled = false - end - - if attributes.key?(:'automated_microdeposits_enabled') - self.automated_microdeposits_enabled = attributes[:'automated_microdeposits_enabled'] - end - - if attributes.key?(:'instant_match_enabled') - self.instant_match_enabled = attributes[:'instant_match_enabled'] - end - - if attributes.key?(:'same_day_microdeposits_enabled') - self.same_day_microdeposits_enabled = attributes[:'same_day_microdeposits_enabled'] - end - - if attributes.key?(:'instant_microdeposits_enabled') - self.instant_microdeposits_enabled = attributes[:'instant_microdeposits_enabled'] - end - - if attributes.key?(:'reroute_to_credentials') - self.reroute_to_credentials = attributes[:'reroute_to_credentials'] - end - - if attributes.key?(:'database_match_enabled') - self.database_match_enabled = attributes[:'database_match_enabled'] - end - - if attributes.key?(:'database_insights_enabled') - self.database_insights_enabled = attributes[:'database_insights_enabled'] - end - - if attributes.key?(:'flow_type') - self.flow_type = attributes[:'flow_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - reroute_to_credentials_validator = EnumAttributeValidator.new('String', ["OFF", "OPTIONAL", "FORCED"]) - return false unless reroute_to_credentials_validator.valid?(@reroute_to_credentials) - flow_type_validator = EnumAttributeValidator.new('String', ["FLEXIBLE_AUTH"]) - return false unless flow_type_validator.valid?(@flow_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] reroute_to_credentials Object to be assigned - def reroute_to_credentials=(reroute_to_credentials) - validator = EnumAttributeValidator.new('String', ["OFF", "OPTIONAL", "FORCED"]) - unless validator.valid?(reroute_to_credentials) - fail ArgumentError, "invalid value for \"reroute_to_credentials\", must be one of #{validator.allowable_values}." - end - @reroute_to_credentials = reroute_to_credentials - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] flow_type Object to be assigned - def flow_type=(flow_type) - validator = EnumAttributeValidator.new('String', ["FLEXIBLE_AUTH"]) - unless validator.valid?(flow_type) - fail ArgumentError, "invalid value for \"flow_type\", must be one of #{validator.allowable_values}." - end - @flow_type = flow_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - auth_type_select_enabled == o.auth_type_select_enabled && - automated_microdeposits_enabled == o.automated_microdeposits_enabled && - instant_match_enabled == o.instant_match_enabled && - same_day_microdeposits_enabled == o.same_day_microdeposits_enabled && - instant_microdeposits_enabled == o.instant_microdeposits_enabled && - reroute_to_credentials == o.reroute_to_credentials && - database_match_enabled == o.database_match_enabled && - database_insights_enabled == o.database_insights_enabled && - flow_type == o.flow_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [auth_type_select_enabled, automated_microdeposits_enabled, instant_match_enabled, same_day_microdeposits_enabled, instant_microdeposits_enabled, reroute_to_credentials, database_match_enabled, database_insights_enabled, flow_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_base_report.rb b/lib/plaid/models/link_token_create_request_base_report.rb deleted file mode 100644 index d1568b5e5..000000000 --- a/lib/plaid/models/link_token_create_request_base_report.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class LinkTokenCreateRequestBaseReport - # The maximum integer number of days of history to include in the Base Report. - attr_accessor :days_requested - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'days_requested' => :'days_requested' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'days_requested' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestBaseReport` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestBaseReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @days_requested.nil? - invalid_properties.push('invalid value for "days_requested", days_requested cannot be nil.') - end - - if @days_requested > 730 - invalid_properties.push('invalid value for "days_requested", must be smaller than or equal to 730.') - end - - if @days_requested < 1 - invalid_properties.push('invalid value for "days_requested", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @days_requested.nil? - return false if @days_requested > 730 - return false if @days_requested < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] days_requested Value to be assigned - def days_requested=(days_requested) - if days_requested.nil? - fail ArgumentError, 'days_requested cannot be nil' - end - - if days_requested > 730 - fail ArgumentError, 'invalid value for "days_requested", must be smaller than or equal to 730.' - end - - if days_requested < 1 - fail ArgumentError, 'invalid value for "days_requested", must be greater than or equal to 1.' - end - - - @days_requested = days_requested - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - days_requested == o.days_requested - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [days_requested].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_credit_partner_insights.rb b/lib/plaid/models/link_token_create_request_credit_partner_insights.rb deleted file mode 100644 index 553f24519..000000000 --- a/lib/plaid/models/link_token_create_request_credit_partner_insights.rb +++ /dev/null @@ -1,259 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specifies options for initializing Link for use with the Credit Partner Insights product. - class LinkTokenCreateRequestCreditPartnerInsights - # The maximum integer number of days of history to compute Crdit Partner Insights. Defaults to 180 if not specified - attr_accessor :days_requested - - # The specific prism products to return. If none are passed in, then all products will be returned. - attr_accessor :prism_products - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'days_requested' => :'days_requested', - :'prism_products' => :'prism_products' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'days_requested' => :'Integer', - :'prism_products' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestCreditPartnerInsights` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestCreditPartnerInsights`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - end - - if attributes.key?(:'prism_products') - if (value = attributes[:'prism_products']).is_a?(Array) - self.prism_products = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@days_requested.nil? && @days_requested > 730 - invalid_properties.push('invalid value for "days_requested", must be smaller than or equal to 730.') - end - - if !@days_requested.nil? && @days_requested < 1 - invalid_properties.push('invalid value for "days_requested", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@days_requested.nil? && @days_requested > 730 - return false if !@days_requested.nil? && @days_requested < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] days_requested Value to be assigned - def days_requested=(days_requested) - if !days_requested.nil? && days_requested > 730 - fail ArgumentError, 'invalid value for "days_requested", must be smaller than or equal to 730.' - end - - if !days_requested.nil? && days_requested < 1 - fail ArgumentError, 'invalid value for "days_requested", must be greater than or equal to 1.' - end - - - @days_requested = days_requested - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - days_requested == o.days_requested && - prism_products == o.prism_products - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [days_requested, prism_products].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_deposit_switch.rb b/lib/plaid/models/link_token_create_request_deposit_switch.rb deleted file mode 100644 index 1f72ba0b9..000000000 --- a/lib/plaid/models/link_token_create_request_deposit_switch.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class LinkTokenCreateRequestDepositSwitch - # The `deposit_switch_id` provided by the `/deposit_switch/create` endpoint. - attr_accessor :deposit_switch_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deposit_switch_id' => :'deposit_switch_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deposit_switch_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestDepositSwitch` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestDepositSwitch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deposit_switch_id') - self.deposit_switch_id = attributes[:'deposit_switch_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @deposit_switch_id.nil? - invalid_properties.push('invalid value for "deposit_switch_id", deposit_switch_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @deposit_switch_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deposit_switch_id == o.deposit_switch_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deposit_switch_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_employment.rb b/lib/plaid/models/link_token_create_request_employment.rb deleted file mode 100644 index 25666372b..000000000 --- a/lib/plaid/models/link_token_create_request_employment.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specifies options for initializing Link for use with the Employment product. This field is required if `employment` is included in the `products` array. - class LinkTokenCreateRequestEmployment - # 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. - attr_accessor :employment_source_types - - attr_accessor :bank_employment - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'employment_source_types' => :'employment_source_types', - :'bank_employment' => :'bank_employment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'employment_source_types' => :'Array', - :'bank_employment' => :'LinkTokenCreateRequestEmploymentBankIncome' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestEmployment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestEmployment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'employment_source_types') - if (value = attributes[:'employment_source_types']).is_a?(Array) - self.employment_source_types = value - end - end - - if attributes.key?(:'bank_employment') - self.bank_employment = attributes[:'bank_employment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - employment_source_types == o.employment_source_types && - bank_employment == o.bank_employment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [employment_source_types, bank_employment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_employment_bank_income.rb b/lib/plaid/models/link_token_create_request_employment_bank_income.rb deleted file mode 100644 index c734325f6..000000000 --- a/lib/plaid/models/link_token_create_request_employment_bank_income.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specifies options for initializing Link for use with Bank Employment. This field is required if `employment` is included in the `products` array and `bank` is specified in `employment_source_types`. - class LinkTokenCreateRequestEmploymentBankIncome - # The number of days of data to request for the Bank Employment product. - attr_accessor :days_requested - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'days_requested' => :'days_requested' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'days_requested' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestEmploymentBankIncome` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestEmploymentBankIncome`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @days_requested.nil? - invalid_properties.push('invalid value for "days_requested", days_requested cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @days_requested.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - days_requested == o.days_requested - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [days_requested].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_identity_verification.rb b/lib/plaid/models/link_token_create_request_identity_verification.rb deleted file mode 100644 index da4c12689..000000000 --- a/lib/plaid/models/link_token_create_request_identity_verification.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specifies option for initializing Link for use with the Identity Verification product. - class LinkTokenCreateRequestIdentityVerification - attr_accessor :template_id - - attr_accessor :consent - - # A flag specifying whether the end user has already agreed to a privacy policy specifying that their data will be shared with Plaid for verification purposes. If `gave_consent` is set to `true`, the `accept_tos` step will be marked as `skipped` and the end user's session will start at the next step requirement. - attr_accessor :gave_consent - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'template_id' => :'template_id', - :'consent' => :'consent', - :'gave_consent' => :'gave_consent' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'template_id' => :'String', - :'consent' => :'Boolean', - :'gave_consent' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestIdentityVerification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestIdentityVerification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'template_id') - self.template_id = attributes[:'template_id'] - end - - if attributes.key?(:'consent') - self.consent = attributes[:'consent'] - end - - if attributes.key?(:'gave_consent') - self.gave_consent = attributes[:'gave_consent'] - else - self.gave_consent = false - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @template_id.nil? - invalid_properties.push('invalid value for "template_id", template_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @template_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - template_id == o.template_id && - consent == o.consent && - gave_consent == o.gave_consent - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [template_id, consent, gave_consent].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_income_verification.rb b/lib/plaid/models/link_token_create_request_income_verification.rb deleted file mode 100644 index 5bc76e7b4..000000000 --- a/lib/plaid/models/link_token_create_request_income_verification.rb +++ /dev/null @@ -1,286 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specifies options for initializing Link for use with the Income product. This field is required if `income_verification` is included in the `products` array. - class LinkTokenCreateRequestIncomeVerification - # The `income_verification_id` of the verification instance, as provided by `/income/verification/create`. - attr_accessor :income_verification_id - - # The `asset_report_id` of an asset report associated with the user, as provided by `/asset_report/create`. Providing an `asset_report_id` is optional and can be used to verify the user through a streamlined flow. If provided, the bank linking flow will be skipped. - attr_accessor :asset_report_id - - # An array of access tokens corresponding to Items that a user has previously connected with. Data from these institutions will be cross-referenced with document data received during the Document Income flow to help verify that the uploaded documents are accurate. If the `transactions` product was not initialized for these Items during link, it will be initialized after this Link session. This field should only be used with the `payroll` income source type. - attr_accessor :access_tokens - - # 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. - attr_accessor :income_source_types - - attr_accessor :bank_income - - attr_accessor :payroll_income - - # A list of user stated income sources - attr_accessor :stated_income_sources - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'income_verification_id' => :'income_verification_id', - :'asset_report_id' => :'asset_report_id', - :'access_tokens' => :'access_tokens', - :'income_source_types' => :'income_source_types', - :'bank_income' => :'bank_income', - :'payroll_income' => :'payroll_income', - :'stated_income_sources' => :'stated_income_sources' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'income_verification_id' => :'String', - :'asset_report_id' => :'String', - :'access_tokens' => :'Array', - :'income_source_types' => :'Array', - :'bank_income' => :'LinkTokenCreateRequestIncomeVerificationBankIncome', - :'payroll_income' => :'LinkTokenCreateRequestIncomeVerificationPayrollIncome', - :'stated_income_sources' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'access_tokens', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestIncomeVerification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestIncomeVerification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'income_verification_id') - self.income_verification_id = attributes[:'income_verification_id'] - end - - if attributes.key?(:'asset_report_id') - self.asset_report_id = attributes[:'asset_report_id'] - end - - if attributes.key?(:'access_tokens') - if (value = attributes[:'access_tokens']).is_a?(Array) - self.access_tokens = value - end - end - - if attributes.key?(:'income_source_types') - if (value = attributes[:'income_source_types']).is_a?(Array) - self.income_source_types = value - end - end - - if attributes.key?(:'bank_income') - self.bank_income = attributes[:'bank_income'] - end - - if attributes.key?(:'payroll_income') - self.payroll_income = attributes[:'payroll_income'] - end - - if attributes.key?(:'stated_income_sources') - if (value = attributes[:'stated_income_sources']).is_a?(Array) - self.stated_income_sources = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - income_verification_id == o.income_verification_id && - asset_report_id == o.asset_report_id && - access_tokens == o.access_tokens && - income_source_types == o.income_source_types && - bank_income == o.bank_income && - payroll_income == o.payroll_income && - stated_income_sources == o.stated_income_sources - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [income_verification_id, asset_report_id, access_tokens, income_source_types, bank_income, payroll_income, stated_income_sources].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_income_verification_bank_income.rb b/lib/plaid/models/link_token_create_request_income_verification_bank_income.rb deleted file mode 100644 index 606f9d8b0..000000000 --- a/lib/plaid/models/link_token_create_request_income_verification_bank_income.rb +++ /dev/null @@ -1,269 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specifies options for initializing Link for use with Bank Income. This field is required if `income_verification` is included in the `products` array and `bank` is specified in `income_source_types`. - class LinkTokenCreateRequestIncomeVerificationBankIncome - # The number of days of data to request for the Bank Income product - attr_accessor :days_requested - - # Whether to enable multiple Items to be added in the Link session - attr_accessor :enable_multiple_items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'days_requested' => :'days_requested', - :'enable_multiple_items' => :'enable_multiple_items' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'days_requested' => :'Integer', - :'enable_multiple_items' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'enable_multiple_items' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestIncomeVerificationBankIncome` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestIncomeVerificationBankIncome`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - end - - if attributes.key?(:'enable_multiple_items') - self.enable_multiple_items = attributes[:'enable_multiple_items'] - else - self.enable_multiple_items = false - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @days_requested.nil? - invalid_properties.push('invalid value for "days_requested", days_requested cannot be nil.') - end - - if @days_requested > 731 - invalid_properties.push('invalid value for "days_requested", must be smaller than or equal to 731.') - end - - if @days_requested < 1 - invalid_properties.push('invalid value for "days_requested", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @days_requested.nil? - return false if @days_requested > 731 - return false if @days_requested < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] days_requested Value to be assigned - def days_requested=(days_requested) - if days_requested.nil? - fail ArgumentError, 'days_requested cannot be nil' - end - - if days_requested > 731 - fail ArgumentError, 'invalid value for "days_requested", must be smaller than or equal to 731.' - end - - if days_requested < 1 - fail ArgumentError, 'invalid value for "days_requested", must be greater than or equal to 1.' - end - - - @days_requested = days_requested - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - days_requested == o.days_requested && - enable_multiple_items == o.enable_multiple_items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [days_requested, enable_multiple_items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_income_verification_payroll_income.rb b/lib/plaid/models/link_token_create_request_income_verification_payroll_income.rb deleted file mode 100644 index 284cd4289..000000000 --- a/lib/plaid/models/link_token_create_request_income_verification_payroll_income.rb +++ /dev/null @@ -1,260 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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.) - class 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. - attr_accessor :flow_types - - # 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. - attr_accessor :is_update_mode - - # Uniquely identify a payroll income Item to update with. This field is only relevant for participants in the Payroll Income Refresh beta. - attr_accessor :item_id_to_update - - # The types of analysis to enable for document uploads. If this field is not provided, then docs will undergo OCR parsing only. - attr_accessor :parsing_config - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'flow_types' => :'flow_types', - :'is_update_mode' => :'is_update_mode', - :'item_id_to_update' => :'item_id_to_update', - :'parsing_config' => :'parsing_config' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'flow_types' => :'Array', - :'is_update_mode' => :'Boolean', - :'item_id_to_update' => :'String', - :'parsing_config' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'flow_types', - :'item_id_to_update', - :'parsing_config' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestIncomeVerificationPayrollIncome` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestIncomeVerificationPayrollIncome`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'flow_types') - if (value = attributes[:'flow_types']).is_a?(Array) - self.flow_types = value - end - end - - if attributes.key?(:'is_update_mode') - self.is_update_mode = attributes[:'is_update_mode'] - else - self.is_update_mode = false - end - - if attributes.key?(:'item_id_to_update') - self.item_id_to_update = attributes[:'item_id_to_update'] - end - - if attributes.key?(:'parsing_config') - if (value = attributes[:'parsing_config']).is_a?(Array) - self.parsing_config = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - flow_types == o.flow_types && - is_update_mode == o.is_update_mode && - item_id_to_update == o.item_id_to_update && - parsing_config == o.parsing_config - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [flow_types, is_update_mode, item_id_to_update, parsing_config].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_payment_initiation.rb b/lib/plaid/models/link_token_create_request_payment_initiation.rb deleted file mode 100644 index e9a47f625..000000000 --- a/lib/plaid/models/link_token_create_request_payment_initiation.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specifies options for initializing Link for use with the Payment Initiation (Europe) product. This field is required if `payment_initiation` is included in the `products` array. Either `payment_id` or `consent_id` must be provided. - class LinkTokenCreateRequestPaymentInitiation - # The `payment_id` provided by the `/payment_initiation/payment/create` endpoint. - attr_accessor :payment_id - - # The `consent_id` provided by the `/payment_initiation/consent/create` endpoint. - attr_accessor :consent_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payment_id' => :'payment_id', - :'consent_id' => :'consent_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'payment_id' => :'String', - :'consent_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestPaymentInitiation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestPaymentInitiation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payment_id') - self.payment_id = attributes[:'payment_id'] - end - - if attributes.key?(:'consent_id') - self.consent_id = attributes[:'consent_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payment_id == o.payment_id && - consent_id == o.consent_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payment_id, consent_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_statements.rb b/lib/plaid/models/link_token_create_request_statements.rb deleted file mode 100644 index 26c0a4744..000000000 --- a/lib/plaid/models/link_token_create_request_statements.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specifies options for initializing Link for use with the Statements product. - class LinkTokenCreateRequestStatements - # 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. - attr_accessor :start_date - - # 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. - attr_accessor :end_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_date' => :'start_date', - :'end_date' => :'end_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_date' => :'Date', - :'end_date' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestStatements` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestStatements`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_date == o.start_date && - end_date == o.end_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_date, end_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_transfer.rb b/lib/plaid/models/link_token_create_request_transfer.rb deleted file mode 100644 index a2bb3ef9b..000000000 --- a/lib/plaid/models/link_token_create_request_transfer.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specifies options for initializing Link for use with the Transfer product. - class LinkTokenCreateRequestTransfer - # The `id` returned by the `/transfer/intent/create` endpoint. - attr_accessor :intent_id - - # The `payment_profile_token` returned by the `/payment_profile/create` endpoint. - attr_accessor :payment_profile_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'intent_id' => :'intent_id', - :'payment_profile_token' => :'payment_profile_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'intent_id' => :'String', - :'payment_profile_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestTransfer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestTransfer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'intent_id') - self.intent_id = attributes[:'intent_id'] - end - - if attributes.key?(:'payment_profile_token') - self.payment_profile_token = attributes[:'payment_profile_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - intent_id == o.intent_id && - payment_profile_token == o.payment_profile_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [intent_id, payment_profile_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_update.rb b/lib/plaid/models/link_token_create_request_update.rb deleted file mode 100644 index c41d6abab..000000000 --- a/lib/plaid/models/link_token_create_request_update.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specifies options for initializing Link for [update mode](https://plaid.com/docs/link/update-mode). - class 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. - attr_accessor :account_selection_enabled - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_selection_enabled' => :'account_selection_enabled' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_selection_enabled' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestUpdate` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_selection_enabled') - self.account_selection_enabled = attributes[:'account_selection_enabled'] - else - self.account_selection_enabled = false - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_selection_enabled == o.account_selection_enabled - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_selection_enabled].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_user.rb b/lib/plaid/models/link_token_create_request_user.rb deleted file mode 100644 index cbee88127..000000000 --- a/lib/plaid/models/link_token_create_request_user.rb +++ /dev/null @@ -1,347 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object specifying information about the end user who will be linking their account. - class LinkTokenCreateRequestUser - # A unique ID representing the end user. Typically this will be a user ID number from your application. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`. It is currently used as a means of searching logs for the given user in the Plaid Dashboard. - attr_accessor :client_user_id - - # The user's full legal name, used for [micro-deposit based verification flows](https://plaid.com/docs/auth/coverage/). For a small number of customers on legacy flows, providing this field is required to enable micro-deposit-based flows. For all other customers, this field is optional. Providing the user's name in this field when using micro-deposit-based verification will streamline the end user experience, as the user will not be prompted to enter their name during the Link flow; Plaid will use the provided legal name instead. - attr_accessor :legal_name - - attr_accessor :name - - # 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. - attr_accessor :phone_number - - # 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. Only pass a verification time for a phone number that you have verified. If you have performed verification but don’t have the time, you may supply a signal value of the start of the UNIX epoch. Example: `2020-01-01T00:00:00Z` - attr_accessor :phone_number_verified_time - - # 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. - attr_accessor :email_address - - # 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. Only pass a verification time for an email address that you have verified. If you have performed verification but don’t have the time, you may supply a signal value of the start of the UNIX epoch. Example: `2020-01-01T00:00:00Z` - attr_accessor :email_address_verified_time - - # Deprecated and not currently used, use the `id_number` field instead. - attr_accessor :ssn - - # To be provided in the format \"yyyy-mm-dd\". Can be used to prefill Link fields when used with Identity Verification. - attr_accessor :date_of_birth - - attr_accessor :address - - attr_accessor :id_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_user_id' => :'client_user_id', - :'legal_name' => :'legal_name', - :'name' => :'name', - :'phone_number' => :'phone_number', - :'phone_number_verified_time' => :'phone_number_verified_time', - :'email_address' => :'email_address', - :'email_address_verified_time' => :'email_address_verified_time', - :'ssn' => :'ssn', - :'date_of_birth' => :'date_of_birth', - :'address' => :'address', - :'id_number' => :'id_number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_user_id' => :'String', - :'legal_name' => :'String', - :'name' => :'LinkTokenCreateRequestUserName', - :'phone_number' => :'String', - :'phone_number_verified_time' => :'Time', - :'email_address' => :'String', - :'email_address_verified_time' => :'Time', - :'ssn' => :'String', - :'date_of_birth' => :'Date', - :'address' => :'LinkTokenCreateRequestUserAddress', - :'id_number' => :'LinkTokenCreateRequestUserIdNumber' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'phone_number_verified_time', - :'email_address_verified_time', - :'date_of_birth', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'phone_number_verified_time') - self.phone_number_verified_time = attributes[:'phone_number_verified_time'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'email_address_verified_time') - self.email_address_verified_time = attributes[:'email_address_verified_time'] - end - - if attributes.key?(:'ssn') - self.ssn = attributes[:'ssn'] - end - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'id_number') - self.id_number = attributes[:'id_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @client_user_id.nil? - invalid_properties.push('invalid value for "client_user_id", client_user_id cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @client_user_id.nil? - return false if @client_user_id.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.nil? - fail ArgumentError, 'client_user_id cannot be nil' - end - - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_user_id == o.client_user_id && - legal_name == o.legal_name && - name == o.name && - phone_number == o.phone_number && - phone_number_verified_time == o.phone_number_verified_time && - email_address == o.email_address && - email_address_verified_time == o.email_address_verified_time && - ssn == o.ssn && - date_of_birth == o.date_of_birth && - address == o.address && - id_number == o.id_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_user_id, legal_name, name, phone_number, phone_number_verified_time, email_address, email_address_verified_time, ssn, date_of_birth, address, id_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_user_address.rb b/lib/plaid/models/link_token_create_request_user_address.rb deleted file mode 100644 index e693849b8..000000000 --- a/lib/plaid/models/link_token_create_request_user_address.rb +++ /dev/null @@ -1,308 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class LinkTokenCreateRequestUserAddress - # The primary street portion of an address. If an address is provided, this field will always be filled. - attr_accessor :street - - # Extra street information, like an apartment or suite number. - attr_accessor :street2 - - # City from the end user's address - attr_accessor :city - - # An ISO 3166-2 subdivision code. Related terms would be \"state\", \"province\", \"prefecture\", \"zone\", \"subdivision\", etc. - attr_accessor :region - - # The postal code for the associated address. Between 2 and 10 alphanumeric characters. For US-based addresses this must be 5 numeric digits. - attr_accessor :postal_code - - # Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'street' => :'street', - :'street2' => :'street2', - :'city' => :'city', - :'region' => :'region', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'street' => :'String', - :'street2' => :'String', - :'city' => :'String', - :'region' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'street', - :'street2', - :'city', - :'region', - :'postal_code', - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'UserAddress' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestUserAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestUserAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'street2') - self.street2 = attributes[:'street2'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @country.nil? - invalid_properties.push('invalid value for "country", country cannot be nil.') - end - - if @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @country.nil? - return false if @country.to_s.length < 2 - true - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if country.nil? - fail ArgumentError, 'country cannot be nil' - end - - if country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - street == o.street && - street2 == o.street2 && - city == o.city && - region == o.region && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [street, street2, city, region, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_user_id_number.rb b/lib/plaid/models/link_token_create_request_user_id_number.rb deleted file mode 100644 index 9f230c815..000000000 --- a/lib/plaid/models/link_token_create_request_user_id_number.rb +++ /dev/null @@ -1,268 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class LinkTokenCreateRequestUserIdNumber - # Value of identity document value typed in by user. Alpha-numeric, with all formatting characters stripped. - attr_accessor :value - - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'type' => :'type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'String', - :'type' => :'IDNumberType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'UserIDNumber' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestUserIdNumber` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestUserIdNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @value.nil? - return false if @type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_user_name.rb b/lib/plaid/models/link_token_create_request_user_name.rb deleted file mode 100644 index 9b7dc9c36..000000000 --- a/lib/plaid/models/link_token_create_request_user_name.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class LinkTokenCreateRequestUserName - # A string with at least one non-whitespace character, with a max length of 100 characters. - attr_accessor :given_name - - # A string with at least one non-whitespace character, with a max length of 100 characters. - attr_accessor :family_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'given_name', - :'family_name' => :'family_name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'IdentityVerificationRequestUserName' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestUserName` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestUserName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @given_name.nil? - invalid_properties.push('invalid value for "given_name", given_name cannot be nil.') - end - - if @family_name.nil? - invalid_properties.push('invalid value for "family_name", family_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @given_name.nil? - return false if @family_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_request_user_stated_income_source.rb b/lib/plaid/models/link_token_create_request_user_stated_income_source.rb deleted file mode 100644 index a58200ea9..000000000 --- a/lib/plaid/models/link_token_create_request_user_stated_income_source.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specifies user stated income sources for the Income product - class LinkTokenCreateRequestUserStatedIncomeSource - # The employer corresponding to an income source specified by the user - attr_accessor :employer - - attr_accessor :category - - # The income amount paid per cycle for a specified income source - attr_accessor :pay_per_cycle - - # The income amount paid annually for a specified income source - attr_accessor :pay_annual - - attr_accessor :pay_type - - attr_accessor :pay_frequency - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'employer' => :'employer', - :'category' => :'category', - :'pay_per_cycle' => :'pay_per_cycle', - :'pay_annual' => :'pay_annual', - :'pay_type' => :'pay_type', - :'pay_frequency' => :'pay_frequency' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'employer' => :'String', - :'category' => :'UserStatedIncomeSourceCategory', - :'pay_per_cycle' => :'Float', - :'pay_annual' => :'Float', - :'pay_type' => :'UserStatedIncomeSourcePayType', - :'pay_frequency' => :'UserStatedIncomeSourceFrequency' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateRequestUserStatedIncomeSource` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateRequestUserStatedIncomeSource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'employer') - self.employer = attributes[:'employer'] - end - - if attributes.key?(:'category') - self.category = attributes[:'category'] - end - - if attributes.key?(:'pay_per_cycle') - self.pay_per_cycle = attributes[:'pay_per_cycle'] - end - - if attributes.key?(:'pay_annual') - self.pay_annual = attributes[:'pay_annual'] - end - - if attributes.key?(:'pay_type') - self.pay_type = attributes[:'pay_type'] - end - - if attributes.key?(:'pay_frequency') - self.pay_frequency = attributes[:'pay_frequency'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - employer == o.employer && - category == o.category && - pay_per_cycle == o.pay_per_cycle && - pay_annual == o.pay_annual && - pay_type == o.pay_type && - pay_frequency == o.pay_frequency - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [employer, category, pay_per_cycle, pay_annual, pay_type, pay_frequency].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_create_response.rb b/lib/plaid/models/link_token_create_response.rb deleted file mode 100644 index 70c9a15c0..000000000 --- a/lib/plaid/models/link_token_create_response.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # LinkTokenCreateResponse defines the response schema for `/link/token/create` - class LinkTokenCreateResponse - # 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`. - attr_accessor :link_token - - # 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. - attr_accessor :expiration - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # 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). - attr_accessor :hosted_link_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'link_token' => :'link_token', - :'expiration' => :'expiration', - :'request_id' => :'request_id', - :'hosted_link_url' => :'hosted_link_url' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'link_token' => :'String', - :'expiration' => :'Time', - :'request_id' => :'String', - :'hosted_link_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'link_token') - self.link_token = attributes[:'link_token'] - end - - if attributes.key?(:'expiration') - self.expiration = attributes[:'expiration'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'hosted_link_url') - self.hosted_link_url = attributes[:'hosted_link_url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @link_token.nil? - invalid_properties.push('invalid value for "link_token", link_token cannot be nil.') - end - - if @expiration.nil? - invalid_properties.push('invalid value for "expiration", expiration cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @link_token.nil? - return false if @expiration.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - link_token == o.link_token && - expiration == o.expiration && - request_id == o.request_id && - hosted_link_url == o.hosted_link_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [link_token, expiration, request_id, hosted_link_url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_eu_config.rb b/lib/plaid/models/link_token_eu_config.rb deleted file mode 100644 index 64898df0d..000000000 --- a/lib/plaid/models/link_token_eu_config.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Configuration parameters for EU flows - class LinkTokenEUConfig - # If `true`, open Link without an initial UI. Defaults to `false`. - attr_accessor :headless - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'headless' => :'headless' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'headless' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenEUConfig` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenEUConfig`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'headless') - self.headless = attributes[:'headless'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - headless == o.headless - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [headless].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_get_metadata_response.rb b/lib/plaid/models/link_token_get_metadata_response.rb deleted file mode 100644 index 26fd4715f..000000000 --- a/lib/plaid/models/link_token_get_metadata_response.rb +++ /dev/null @@ -1,307 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object specifying the arguments originally provided to the `/link/token/create` call. - class LinkTokenGetMetadataResponse - # The `products` specified in the `/link/token/create` call. - attr_accessor :initial_products - - # The `webhook` specified in the `/link/token/create` call. - attr_accessor :webhook - - # The `country_codes` specified in the `/link/token/create` call. - attr_accessor :country_codes - - # The `language` specified in the `/link/token/create` call. - attr_accessor :language - - attr_accessor :institution_data - - attr_accessor :account_filters - - # The `redirect_uri` specified in the `/link/token/create` call. - attr_accessor :redirect_uri - - # The `client_name` specified in the `/link/token/create` call. - attr_accessor :client_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'initial_products' => :'initial_products', - :'webhook' => :'webhook', - :'country_codes' => :'country_codes', - :'language' => :'language', - :'institution_data' => :'institution_data', - :'account_filters' => :'account_filters', - :'redirect_uri' => :'redirect_uri', - :'client_name' => :'client_name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'initial_products' => :'Array', - :'webhook' => :'String', - :'country_codes' => :'Array', - :'language' => :'String', - :'institution_data' => :'LinkTokenCreateInstitutionData', - :'account_filters' => :'AccountFiltersResponse', - :'redirect_uri' => :'String', - :'client_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'webhook', - :'language', - :'redirect_uri', - :'client_name' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenGetMetadataResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenGetMetadataResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'initial_products') - if (value = attributes[:'initial_products']).is_a?(Array) - self.initial_products = value - end - end - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - - if attributes.key?(:'country_codes') - if (value = attributes[:'country_codes']).is_a?(Array) - self.country_codes = value - end - end - - if attributes.key?(:'language') - self.language = attributes[:'language'] - end - - if attributes.key?(:'institution_data') - self.institution_data = attributes[:'institution_data'] - end - - if attributes.key?(:'account_filters') - self.account_filters = attributes[:'account_filters'] - end - - if attributes.key?(:'redirect_uri') - self.redirect_uri = attributes[:'redirect_uri'] - end - - if attributes.key?(:'client_name') - self.client_name = attributes[:'client_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @initial_products.nil? - invalid_properties.push('invalid value for "initial_products", initial_products cannot be nil.') - end - - if @country_codes.nil? - invalid_properties.push('invalid value for "country_codes", country_codes cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @initial_products.nil? - return false if @country_codes.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - initial_products == o.initial_products && - webhook == o.webhook && - country_codes == o.country_codes && - language == o.language && - institution_data == o.institution_data && - account_filters == o.account_filters && - redirect_uri == o.redirect_uri && - client_name == o.client_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [initial_products, webhook, country_codes, language, institution_data, account_filters, redirect_uri, client_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_get_request.rb b/lib/plaid/models/link_token_get_request.rb deleted file mode 100644 index c148fbb80..000000000 --- a/lib/plaid/models/link_token_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # LinkTokenGetRequest defines the request schema for `/link/token/get` - class LinkTokenGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A `link_token` from a previous invocation of `/link/token/create` - attr_accessor :link_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'link_token' => :'link_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'link_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'link_token') - self.link_token = attributes[:'link_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @link_token.nil? - invalid_properties.push('invalid value for "link_token", link_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @link_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - link_token == o.link_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, link_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_get_response.rb b/lib/plaid/models/link_token_get_response.rb deleted file mode 100644 index a88b1260f..000000000 --- a/lib/plaid/models/link_token_get_response.rb +++ /dev/null @@ -1,289 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # LinkTokenGetResponse defines the response schema for `/link/token/get` - class LinkTokenGetResponse - # 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`. - attr_accessor :link_token - - # The creation timestamp for the `link_token`, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :created_at - - # The expiration timestamp for the `link_token`, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :expiration - - # 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. - attr_accessor :link_sessions - - attr_accessor :metadata - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'link_token' => :'link_token', - :'created_at' => :'created_at', - :'expiration' => :'expiration', - :'link_sessions' => :'link_sessions', - :'metadata' => :'metadata', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'link_token' => :'String', - :'created_at' => :'Time', - :'expiration' => :'Time', - :'link_sessions' => :'Array', - :'metadata' => :'LinkTokenGetMetadataResponse', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'created_at', - :'expiration', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'link_token') - self.link_token = attributes[:'link_token'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'expiration') - self.expiration = attributes[:'expiration'] - end - - if attributes.key?(:'link_sessions') - if (value = attributes[:'link_sessions']).is_a?(Array) - self.link_sessions = value - end - end - - if attributes.key?(:'metadata') - self.metadata = attributes[:'metadata'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @link_token.nil? - invalid_properties.push('invalid value for "link_token", link_token cannot be nil.') - end - - if @metadata.nil? - invalid_properties.push('invalid value for "metadata", metadata cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @link_token.nil? - return false if @metadata.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - link_token == o.link_token && - created_at == o.created_at && - expiration == o.expiration && - link_sessions == o.link_sessions && - metadata == o.metadata && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [link_token, created_at, expiration, link_sessions, metadata, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_get_sessions_response.rb b/lib/plaid/models/link_token_get_sessions_response.rb deleted file mode 100644 index 636221c73..000000000 --- a/lib/plaid/models/link_token_get_sessions_response.rb +++ /dev/null @@ -1,279 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class LinkTokenGetSessionsResponse - # The unique ID for the link session. - attr_accessor :link_session_id - - # The timestamp at which the link session was first started, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :started_at - - # The timestamp at which the link session was finished, if available, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :finished_at - - attr_accessor :on_success - - attr_accessor :on_exit - - # List of customer-related Link events - attr_accessor :events - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'link_session_id' => :'link_session_id', - :'started_at' => :'started_at', - :'finished_at' => :'finished_at', - :'on_success' => :'on_success', - :'on_exit' => :'on_exit', - :'events' => :'events' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'link_session_id' => :'String', - :'started_at' => :'Time', - :'finished_at' => :'Time', - :'on_success' => :'LinkSessionSuccess', - :'on_exit' => :'LinkSessionExit', - :'events' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'finished_at', - :'on_success', - :'on_exit', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenGetSessionsResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenGetSessionsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'link_session_id') - self.link_session_id = attributes[:'link_session_id'] - end - - if attributes.key?(:'started_at') - self.started_at = attributes[:'started_at'] - end - - if attributes.key?(:'finished_at') - self.finished_at = attributes[:'finished_at'] - end - - if attributes.key?(:'on_success') - self.on_success = attributes[:'on_success'] - end - - if attributes.key?(:'on_exit') - self.on_exit = attributes[:'on_exit'] - end - - if attributes.key?(:'events') - if (value = attributes[:'events']).is_a?(Array) - self.events = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @link_session_id.nil? - invalid_properties.push('invalid value for "link_session_id", link_session_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @link_session_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - link_session_id == o.link_session_id && - started_at == o.started_at && - finished_at == o.finished_at && - on_success == o.on_success && - on_exit == o.on_exit && - events == o.events - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [link_session_id, started_at, finished_at, on_success, on_exit, events].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_investments.rb b/lib/plaid/models/link_token_investments.rb deleted file mode 100644 index 7ea26955e..000000000 --- a/lib/plaid/models/link_token_investments.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Configuration parameters for the Investments product - class LinkTokenInvestments - # If `true`, allow self-custody crypto wallets to be added without requiring signature verification. Defaults to `false`. - attr_accessor :allow_unverified_crypto_wallets - - # If `true`, allow users to manually enter Investments account and holdings information. Defaults to `false`. - attr_accessor :allow_manual_entry - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'allow_unverified_crypto_wallets' => :'allow_unverified_crypto_wallets', - :'allow_manual_entry' => :'allow_manual_entry' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'allow_unverified_crypto_wallets' => :'Boolean', - :'allow_manual_entry' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenInvestments` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenInvestments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'allow_unverified_crypto_wallets') - self.allow_unverified_crypto_wallets = attributes[:'allow_unverified_crypto_wallets'] - end - - if attributes.key?(:'allow_manual_entry') - self.allow_manual_entry = attributes[:'allow_manual_entry'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - allow_unverified_crypto_wallets == o.allow_unverified_crypto_wallets && - allow_manual_entry == o.allow_manual_entry - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [allow_unverified_crypto_wallets, allow_manual_entry].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_investments_auth.rb b/lib/plaid/models/link_token_investments_auth.rb deleted file mode 100644 index 312eecaf4..000000000 --- a/lib/plaid/models/link_token_investments_auth.rb +++ /dev/null @@ -1,237 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Configuration parameters for the Investments Auth Product - class LinkTokenInvestmentsAuth - # If `true`, show institutions that use the manual entry fallback flow. - attr_accessor :manual_entry_enabled - - # If `true`, show institutions that use the masked number match fallback flow. - attr_accessor :masked_number_match_enabled - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'manual_entry_enabled' => :'manual_entry_enabled', - :'masked_number_match_enabled' => :'masked_number_match_enabled' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'manual_entry_enabled' => :'Boolean', - :'masked_number_match_enabled' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'manual_entry_enabled', - :'masked_number_match_enabled' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenInvestmentsAuth` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenInvestmentsAuth`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'manual_entry_enabled') - self.manual_entry_enabled = attributes[:'manual_entry_enabled'] - else - self.manual_entry_enabled = false - end - - if attributes.key?(:'masked_number_match_enabled') - self.masked_number_match_enabled = attributes[:'masked_number_match_enabled'] - else - self.masked_number_match_enabled = false - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - manual_entry_enabled == o.manual_entry_enabled && - masked_number_match_enabled == o.masked_number_match_enabled - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [manual_entry_enabled, masked_number_match_enabled].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_token_transactions.rb b/lib/plaid/models/link_token_transactions.rb deleted file mode 100644 index ec4f6c53d..000000000 --- a/lib/plaid/models/link_token_transactions.rb +++ /dev/null @@ -1,249 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Configuration parameters for the Transactions product - class 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. 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. - attr_accessor :days_requested - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'days_requested' => :'days_requested' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'days_requested' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkTokenTransactions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkTokenTransactions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - else - self.days_requested = 90 - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@days_requested.nil? && @days_requested > 730 - invalid_properties.push('invalid value for "days_requested", must be smaller than or equal to 730.') - end - - if !@days_requested.nil? && @days_requested < 1 - invalid_properties.push('invalid value for "days_requested", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@days_requested.nil? && @days_requested > 730 - return false if !@days_requested.nil? && @days_requested < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] days_requested Value to be assigned - def days_requested=(days_requested) - if !days_requested.nil? && days_requested > 730 - fail ArgumentError, 'invalid value for "days_requested", must be smaller than or equal to 730.' - end - - if !days_requested.nil? && days_requested < 1 - fail ArgumentError, 'invalid value for "days_requested", must be greater than or equal to 1.' - end - - - @days_requested = days_requested - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - days_requested == o.days_requested - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [days_requested].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/link_user_delivery_status_webhook.rb b/lib/plaid/models/link_user_delivery_status_webhook.rb deleted file mode 100644 index 6ea46a6a2..000000000 --- a/lib/plaid/models/link_user_delivery_status_webhook.rb +++ /dev/null @@ -1,285 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Webhook indicating that the status of the delivery of the Hosted Link session to a user - class LinkUserDeliveryStatusWebhook - # `LINK_DELIVERY` - attr_accessor :webhook_type - - # `DELIVERY_STATUS` - attr_accessor :webhook_code - - # The ID of the Hosted Link session. - attr_accessor :link_delivery_session_id - - # Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :timestamp - - attr_accessor :link_delivery_metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'link_delivery_session_id' => :'link_delivery_session_id', - :'timestamp' => :'timestamp', - :'link_delivery_metadata' => :'link_delivery_metadata' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'link_delivery_session_id' => :'String', - :'timestamp' => :'String', - :'link_delivery_metadata' => :'LinkDeliveryMetadata' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LinkUserDeliveryStatusWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LinkUserDeliveryStatusWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'link_delivery_session_id') - self.link_delivery_session_id = attributes[:'link_delivery_session_id'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - - if attributes.key?(:'link_delivery_metadata') - self.link_delivery_metadata = attributes[:'link_delivery_metadata'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @link_delivery_session_id.nil? - invalid_properties.push('invalid value for "link_delivery_session_id", link_delivery_session_id cannot be nil.') - end - - if @timestamp.nil? - invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.') - end - - if @link_delivery_metadata.nil? - invalid_properties.push('invalid value for "link_delivery_metadata", link_delivery_metadata cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @link_delivery_session_id.nil? - return false if @timestamp.nil? - return false if @link_delivery_metadata.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - link_delivery_session_id == o.link_delivery_session_id && - timestamp == o.timestamp && - link_delivery_metadata == o.link_delivery_metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, link_delivery_session_id, timestamp, link_delivery_metadata].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/loan.rb b/lib/plaid/models/loan.rb deleted file mode 100644 index 7ff4f55d7..000000000 --- a/lib/plaid/models/loan.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information specific to a mortgage loan agreement between one or more borrowers and a mortgage lender. - class Loan - attr_accessor :loan_identifiers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'loan_identifiers' => :'LOAN_IDENTIFIERS' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'loan_identifiers' => :'LoanIdentifiers' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Loan` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Loan`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'loan_identifiers') - self.loan_identifiers = attributes[:'loan_identifiers'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @loan_identifiers.nil? - invalid_properties.push('invalid value for "loan_identifiers", loan_identifiers cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @loan_identifiers.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - loan_identifiers == o.loan_identifiers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [loan_identifiers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/loan_account_subtype.rb b/lib/plaid/models/loan_account_subtype.rb deleted file mode 100644 index fc4be6efc..000000000 --- a/lib/plaid/models/loan_account_subtype.rb +++ /dev/null @@ -1,49 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class LoanAccountSubtype - AUTO = "auto".freeze - BUSINESS = "business".freeze - COMMERCIAL = "commercial".freeze - CONSTRUCTION = "construction".freeze - CONSUMER = "consumer".freeze - HOME_EQUITY = "home equity".freeze - LOAN = "loan".freeze - MORTGAGE = "mortgage".freeze - LINE_OF_CREDIT = "line of credit".freeze - STUDENT = "student".freeze - OTHER = "other".freeze - ALL = "all".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/loan_filter.rb b/lib/plaid/models/loan_filter.rb deleted file mode 100644 index 926829349..000000000 --- a/lib/plaid/models/loan_filter.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A filter to apply to `loan`-type accounts - class 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). - attr_accessor :account_subtypes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_subtypes' => :'account_subtypes' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_subtypes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LoanFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LoanFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_subtypes') - if (value = attributes[:'account_subtypes']).is_a?(Array) - self.account_subtypes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_subtypes.nil? - invalid_properties.push('invalid value for "account_subtypes", account_subtypes cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_subtypes.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_subtypes == o.account_subtypes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_subtypes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/loan_identifier.rb b/lib/plaid/models/loan_identifier.rb deleted file mode 100644 index fc52cc79c..000000000 --- a/lib/plaid/models/loan_identifier.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The information used to identify this loan by various parties to the transaction or other organizations. - class LoanIdentifier - # The value of the identifier for the specified type. - attr_accessor :loan_identifier - - attr_accessor :loan_identifier_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'loan_identifier' => :'LoanIdentifier', - :'loan_identifier_type' => :'LoanIdentifierType' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'loan_identifier' => :'String', - :'loan_identifier_type' => :'LoanIdentifierType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'loan_identifier', - :'loan_identifier_type' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LoanIdentifier` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LoanIdentifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'loan_identifier') - self.loan_identifier = attributes[:'loan_identifier'] - end - - if attributes.key?(:'loan_identifier_type') - self.loan_identifier_type = attributes[:'loan_identifier_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - loan_identifier == o.loan_identifier && - loan_identifier_type == o.loan_identifier_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [loan_identifier, loan_identifier_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/loan_identifier_type.rb b/lib/plaid/models/loan_identifier_type.rb deleted file mode 100644 index 78598398a..000000000 --- a/lib/plaid/models/loan_identifier_type.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class LoanIdentifierType - LENDER_LOAN = "LenderLoan".freeze - UNIVERSAL_LOAN = "UniversalLoan".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/loan_identifiers.rb b/lib/plaid/models/loan_identifiers.rb deleted file mode 100644 index 3706f4142..000000000 --- a/lib/plaid/models/loan_identifiers.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Collection of current and previous identifiers for this loan. - class LoanIdentifiers - attr_accessor :loan_identifier - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'loan_identifier' => :'LOAN_IDENTIFIER' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'loan_identifier' => :'LoanIdentifier' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::LoanIdentifiers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::LoanIdentifiers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'loan_identifier') - self.loan_identifier = attributes[:'loan_identifier'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @loan_identifier.nil? - invalid_properties.push('invalid value for "loan_identifier", loan_identifier cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @loan_identifier.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - loan_identifier == o.loan_identifier - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [loan_identifier].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/loans.rb b/lib/plaid/models/loans.rb deleted file mode 100644 index d0f974b29..000000000 --- a/lib/plaid/models/loans.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A collection of loans that are part of a single deal. - class Loans - attr_accessor :loan - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'loan' => :'LOAN' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'loan' => :'Loan' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Loans` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Loans`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'loan') - self.loan = attributes[:'loan'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @loan.nil? - invalid_properties.push('invalid value for "loan", loan cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @loan.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - loan == o.loan - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [loan].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/location.rb b/lib/plaid/models/location.rb deleted file mode 100644 index 66c6714b0..000000000 --- a/lib/plaid/models/location.rb +++ /dev/null @@ -1,299 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A representation of where a transaction took place - class Location - # The street address where the transaction occurred. - attr_accessor :address - - # The city where the transaction occurred. - attr_accessor :city - - # The region or state where the transaction occurred. In API versions 2018-05-22 and earlier, this field is called `state`. - attr_accessor :region - - # The postal code where the transaction occurred. In API versions 2018-05-22 and earlier, this field is called `zip`. - attr_accessor :postal_code - - # The ISO 3166-1 alpha-2 country code where the transaction occurred. - attr_accessor :country - - # The latitude where the transaction occurred. - attr_accessor :lat - - # The longitude where the transaction occurred. - attr_accessor :lon - - # The merchant defined store number where the transaction occurred. - attr_accessor :store_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'address' => :'address', - :'city' => :'city', - :'region' => :'region', - :'postal_code' => :'postal_code', - :'country' => :'country', - :'lat' => :'lat', - :'lon' => :'lon', - :'store_number' => :'store_number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'address' => :'String', - :'city' => :'String', - :'region' => :'String', - :'postal_code' => :'String', - :'country' => :'String', - :'lat' => :'Float', - :'lon' => :'Float', - :'store_number' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'address', - :'city', - :'region', - :'postal_code', - :'country', - :'lat', - :'lon', - :'store_number' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Location` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Location`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - - if attributes.key?(:'lat') - self.lat = attributes[:'lat'] - end - - if attributes.key?(:'lon') - self.lon = attributes[:'lon'] - end - - if attributes.key?(:'store_number') - self.store_number = attributes[:'store_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - address == o.address && - city == o.city && - region == o.region && - postal_code == o.postal_code && - country == o.country && - lat == o.lat && - lon == o.lon && - store_number == o.store_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [address, city, region, postal_code, country, lat, lon, store_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/match_summary.rb b/lib/plaid/models/match_summary.rb deleted file mode 100644 index 3a16d057c..000000000 --- a/lib/plaid/models/match_summary.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Summary object reflecting the match result of the associated data - class MatchSummary - attr_accessor :summary - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'summary' => :'summary' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'summary' => :'MatchSummaryCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::MatchSummary` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::MatchSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'summary') - self.summary = attributes[:'summary'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @summary.nil? - invalid_properties.push('invalid value for "summary", summary cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @summary.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - summary == o.summary - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [summary].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/match_summary_code.rb b/lib/plaid/models/match_summary_code.rb deleted file mode 100644 index 505e321a7..000000000 --- a/lib/plaid/models/match_summary_code.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class MatchSummaryCode - MATCH = "match".freeze - PARTIAL_MATCH = "partial_match".freeze - NO_MATCH = "no_match".freeze - NO_DATA = "no_data".freeze - NO_INPUT = "no_input".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/merchant_insights.rb b/lib/plaid/models/merchant_insights.rb deleted file mode 100644 index b8b7920ce..000000000 --- a/lib/plaid/models/merchant_insights.rb +++ /dev/null @@ -1,315 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Insights into a user’s top merchants. - class MerchantInsights - # The counterparty name. - attr_accessor :name - - # A unique, stable, Plaid-generated id that maps to the merchant. - attr_accessor :entity_id - - # The website associated with the merchant. - attr_accessor :website - - # The number of transactions associated with merchant of this type. - attr_accessor :transaction_count - - # The primary personal finance category associated with this merchant. - attr_accessor :personal_finance_category_primary - - # The detailed personal finance category associated with this merchant. - attr_accessor :personal_finance_category_detailed - - # Sum of outflow amounts. - attr_accessor :total_outflows - - # Sum of inflow amounts. - attr_accessor :total_inflows - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'entity_id' => :'entity_id', - :'website' => :'website', - :'transaction_count' => :'transaction_count', - :'personal_finance_category_primary' => :'personal_finance_category_primary', - :'personal_finance_category_detailed' => :'personal_finance_category_detailed', - :'total_outflows' => :'total_outflows', - :'total_inflows' => :'total_inflows' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'entity_id' => :'String', - :'website' => :'String', - :'transaction_count' => :'Integer', - :'personal_finance_category_primary' => :'String', - :'personal_finance_category_detailed' => :'String', - :'total_outflows' => :'Float', - :'total_inflows' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'entity_id', - :'website', - :'personal_finance_category_primary', - :'personal_finance_category_detailed', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::MerchantInsights` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::MerchantInsights`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'entity_id') - self.entity_id = attributes[:'entity_id'] - end - - if attributes.key?(:'website') - self.website = attributes[:'website'] - end - - if attributes.key?(:'transaction_count') - self.transaction_count = attributes[:'transaction_count'] - end - - if attributes.key?(:'personal_finance_category_primary') - self.personal_finance_category_primary = attributes[:'personal_finance_category_primary'] - end - - if attributes.key?(:'personal_finance_category_detailed') - self.personal_finance_category_detailed = attributes[:'personal_finance_category_detailed'] - end - - if attributes.key?(:'total_outflows') - self.total_outflows = attributes[:'total_outflows'] - end - - if attributes.key?(:'total_inflows') - self.total_inflows = attributes[:'total_inflows'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @transaction_count.nil? - invalid_properties.push('invalid value for "transaction_count", transaction_count cannot be nil.') - end - - if @total_outflows.nil? - invalid_properties.push('invalid value for "total_outflows", total_outflows cannot be nil.') - end - - if @total_inflows.nil? - invalid_properties.push('invalid value for "total_inflows", total_inflows cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @transaction_count.nil? - return false if @total_outflows.nil? - return false if @total_inflows.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - entity_id == o.entity_id && - website == o.website && - transaction_count == o.transaction_count && - personal_finance_category_primary == o.personal_finance_category_primary && - personal_finance_category_detailed == o.personal_finance_category_detailed && - total_outflows == o.total_outflows && - total_inflows == o.total_inflows - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, entity_id, website, transaction_count, personal_finance_category_primary, personal_finance_category_detailed, total_outflows, total_inflows].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/meta.rb b/lib/plaid/models/meta.rb deleted file mode 100644 index df427ce03..000000000 --- a/lib/plaid/models/meta.rb +++ /dev/null @@ -1,294 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Allows specifying the metadata of the test account - class Meta - # The account's name - attr_accessor :name - - # The account's official name - attr_accessor :official_name - - # The account's limit - attr_accessor :limit - - # The account's mask. Should be an empty string or a string of 2-4 alphanumeric characters. This allows you to model a mask which does not match the account number (such as with a virtual account number). - attr_accessor :mask - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'official_name' => :'official_name', - :'limit' => :'limit', - :'mask' => :'mask' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'official_name' => :'String', - :'limit' => :'Float', - :'mask' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Meta` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Meta`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'official_name') - self.official_name = attributes[:'official_name'] - end - - if attributes.key?(:'limit') - self.limit = attributes[:'limit'] - end - - if attributes.key?(:'mask') - self.mask = attributes[:'mask'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @official_name.nil? - invalid_properties.push('invalid value for "official_name", official_name cannot be nil.') - end - - if @limit.nil? - invalid_properties.push('invalid value for "limit", limit cannot be nil.') - end - - if @mask.nil? - invalid_properties.push('invalid value for "mask", mask cannot be nil.') - end - - pattern = Regexp.new(/^$|^[A-Za-z0-9]{2,4}$/) - if @mask !~ pattern - invalid_properties.push("invalid value for \"mask\", must conform to the pattern #{pattern}.") - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @official_name.nil? - return false if @limit.nil? - return false if @mask.nil? - return false if @mask !~ Regexp.new(/^$|^[A-Za-z0-9]{2,4}$/) - true - end - - # Custom attribute writer method with validation - # @param [Object] mask Value to be assigned - def mask=(mask) - if mask.nil? - fail ArgumentError, 'mask cannot be nil' - end - - pattern = Regexp.new(/^$|^[A-Za-z0-9]{2,4}$/) - if mask !~ pattern - fail ArgumentError, "invalid value for \"mask\", must conform to the pattern #{pattern}." - end - - - @mask = mask - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - official_name == o.official_name && - limit == o.limit && - mask == o.mask - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, official_name, limit, mask].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/mfa.rb b/lib/plaid/models/mfa.rb deleted file mode 100644 index 66c5417fb..000000000 --- a/lib/plaid/models/mfa.rb +++ /dev/null @@ -1,286 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specifies the multi-factor authentication settings to use with this test account - class MFA - # Possible values are `device`, `selections`, or `questions`. If value is `device`, the MFA answer is `1234`. If value is `selections`, the MFA answer is always the first option. If value is `questions`, the MFA answer is `answer__` for the j-th question in the i-th round, starting from 0. For example, the answer to the first question in the second round is `answer_1_0`. - attr_accessor :type - - # Number of rounds of questions. Required if value of `type` is `questions`. - attr_accessor :question_rounds - - # Number of questions per round. Required if value of `type` is `questions`. If value of type is `selections`, default value is 2. - attr_accessor :questions_per_round - - # Number of rounds of selections, used if `type` is `selections`. Defaults to 1. - attr_accessor :selection_rounds - - # Number of available answers per question, used if `type` is `selection`. Defaults to 2. - attr_accessor :selections_per_question - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'question_rounds' => :'question_rounds', - :'questions_per_round' => :'questions_per_round', - :'selection_rounds' => :'selection_rounds', - :'selections_per_question' => :'selections_per_question' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'question_rounds' => :'Float', - :'questions_per_round' => :'Float', - :'selection_rounds' => :'Float', - :'selections_per_question' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::MFA` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::MFA`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'question_rounds') - self.question_rounds = attributes[:'question_rounds'] - end - - if attributes.key?(:'questions_per_round') - self.questions_per_round = attributes[:'questions_per_round'] - end - - if attributes.key?(:'selection_rounds') - self.selection_rounds = attributes[:'selection_rounds'] - end - - if attributes.key?(:'selections_per_question') - self.selections_per_question = attributes[:'selections_per_question'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @question_rounds.nil? - invalid_properties.push('invalid value for "question_rounds", question_rounds cannot be nil.') - end - - if @questions_per_round.nil? - invalid_properties.push('invalid value for "questions_per_round", questions_per_round cannot be nil.') - end - - if @selection_rounds.nil? - invalid_properties.push('invalid value for "selection_rounds", selection_rounds cannot be nil.') - end - - if @selections_per_question.nil? - invalid_properties.push('invalid value for "selections_per_question", selections_per_question cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - return false if @question_rounds.nil? - return false if @questions_per_round.nil? - return false if @selection_rounds.nil? - return false if @selections_per_question.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - question_rounds == o.question_rounds && - questions_per_round == o.questions_per_round && - selection_rounds == o.selection_rounds && - selections_per_question == o.selections_per_question - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, question_rounds, questions_per_round, selection_rounds, selections_per_question].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/mortgage_interest_rate.rb b/lib/plaid/models/mortgage_interest_rate.rb deleted file mode 100644 index a4974870b..000000000 --- a/lib/plaid/models/mortgage_interest_rate.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Object containing metadata about the interest rate for the mortgage. - class MortgageInterestRate - # Percentage value (interest rate of current mortgage, not APR) of interest payable on a loan. - attr_accessor :percentage - - # The type of interest charged (fixed or variable). - attr_accessor :type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'percentage' => :'percentage', - :'type' => :'type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'percentage' => :'Float', - :'type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'percentage', - :'type' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::MortgageInterestRate` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::MortgageInterestRate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'percentage') - self.percentage = attributes[:'percentage'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - percentage == o.percentage && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [percentage, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/mortgage_liability.rb b/lib/plaid/models/mortgage_liability.rb deleted file mode 100644 index a96d4c9ee..000000000 --- a/lib/plaid/models/mortgage_liability.rb +++ /dev/null @@ -1,445 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Contains details about a mortgage account. - class MortgageLiability - # The ID of the account that this liability belongs to. - attr_accessor :account_id - - # The account number of the loan. - attr_accessor :account_number - - # The current outstanding amount charged for late payment. - attr_accessor :current_late_fee - - # Total amount held in escrow to pay taxes and insurance on behalf of the borrower. - attr_accessor :escrow_balance - - # Indicates whether the borrower has private mortgage insurance in effect. - attr_accessor :has_pmi - - # Indicates whether the borrower will pay a penalty for early payoff of mortgage. - attr_accessor :has_prepayment_penalty - - attr_accessor :interest_rate - - # The amount of the last payment. - attr_accessor :last_payment_amount - - # The date of the last payment. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). - attr_accessor :last_payment_date - - # Description of the type of loan, for example `conventional`, `fixed`, or `variable`. This field is provided directly from the loan servicer and does not have an enumerated set of possible values. - attr_accessor :loan_type_description - - # Full duration of mortgage as at origination (e.g. `10 year`). - attr_accessor :loan_term - - # Original date on which mortgage is due in full. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). - attr_accessor :maturity_date - - # The amount of the next payment. - attr_accessor :next_monthly_payment - - # The due date for the next payment. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). - attr_accessor :next_payment_due_date - - # The date on which the loan was initially lent. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). - attr_accessor :origination_date - - # The original principal balance of the mortgage. - attr_accessor :origination_principal_amount - - # Amount of loan (principal + interest) past due for payment. - attr_accessor :past_due_amount - - attr_accessor :property_address - - # The year to date (YTD) interest paid. - attr_accessor :ytd_interest_paid - - # The YTD principal paid. - attr_accessor :ytd_principal_paid - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'account_number' => :'account_number', - :'current_late_fee' => :'current_late_fee', - :'escrow_balance' => :'escrow_balance', - :'has_pmi' => :'has_pmi', - :'has_prepayment_penalty' => :'has_prepayment_penalty', - :'interest_rate' => :'interest_rate', - :'last_payment_amount' => :'last_payment_amount', - :'last_payment_date' => :'last_payment_date', - :'loan_type_description' => :'loan_type_description', - :'loan_term' => :'loan_term', - :'maturity_date' => :'maturity_date', - :'next_monthly_payment' => :'next_monthly_payment', - :'next_payment_due_date' => :'next_payment_due_date', - :'origination_date' => :'origination_date', - :'origination_principal_amount' => :'origination_principal_amount', - :'past_due_amount' => :'past_due_amount', - :'property_address' => :'property_address', - :'ytd_interest_paid' => :'ytd_interest_paid', - :'ytd_principal_paid' => :'ytd_principal_paid' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'account_number' => :'String', - :'current_late_fee' => :'Float', - :'escrow_balance' => :'Float', - :'has_pmi' => :'Boolean', - :'has_prepayment_penalty' => :'Boolean', - :'interest_rate' => :'MortgageInterestRate', - :'last_payment_amount' => :'Float', - :'last_payment_date' => :'Date', - :'loan_type_description' => :'String', - :'loan_term' => :'String', - :'maturity_date' => :'Date', - :'next_monthly_payment' => :'Float', - :'next_payment_due_date' => :'Date', - :'origination_date' => :'Date', - :'origination_principal_amount' => :'Float', - :'past_due_amount' => :'Float', - :'property_address' => :'MortgagePropertyAddress', - :'ytd_interest_paid' => :'Float', - :'ytd_principal_paid' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'current_late_fee', - :'escrow_balance', - :'has_pmi', - :'has_prepayment_penalty', - :'last_payment_amount', - :'last_payment_date', - :'loan_type_description', - :'loan_term', - :'maturity_date', - :'next_monthly_payment', - :'next_payment_due_date', - :'origination_date', - :'origination_principal_amount', - :'past_due_amount', - :'ytd_interest_paid', - :'ytd_principal_paid' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::MortgageLiability` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::MortgageLiability`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'account_number') - self.account_number = attributes[:'account_number'] - end - - if attributes.key?(:'current_late_fee') - self.current_late_fee = attributes[:'current_late_fee'] - end - - if attributes.key?(:'escrow_balance') - self.escrow_balance = attributes[:'escrow_balance'] - end - - if attributes.key?(:'has_pmi') - self.has_pmi = attributes[:'has_pmi'] - end - - if attributes.key?(:'has_prepayment_penalty') - self.has_prepayment_penalty = attributes[:'has_prepayment_penalty'] - end - - if attributes.key?(:'interest_rate') - self.interest_rate = attributes[:'interest_rate'] - end - - if attributes.key?(:'last_payment_amount') - self.last_payment_amount = attributes[:'last_payment_amount'] - end - - if attributes.key?(:'last_payment_date') - self.last_payment_date = attributes[:'last_payment_date'] - end - - if attributes.key?(:'loan_type_description') - self.loan_type_description = attributes[:'loan_type_description'] - end - - if attributes.key?(:'loan_term') - self.loan_term = attributes[:'loan_term'] - end - - if attributes.key?(:'maturity_date') - self.maturity_date = attributes[:'maturity_date'] - end - - if attributes.key?(:'next_monthly_payment') - self.next_monthly_payment = attributes[:'next_monthly_payment'] - end - - if attributes.key?(:'next_payment_due_date') - self.next_payment_due_date = attributes[:'next_payment_due_date'] - end - - if attributes.key?(:'origination_date') - self.origination_date = attributes[:'origination_date'] - end - - if attributes.key?(:'origination_principal_amount') - self.origination_principal_amount = attributes[:'origination_principal_amount'] - end - - if attributes.key?(:'past_due_amount') - self.past_due_amount = attributes[:'past_due_amount'] - end - - if attributes.key?(:'property_address') - self.property_address = attributes[:'property_address'] - end - - if attributes.key?(:'ytd_interest_paid') - self.ytd_interest_paid = attributes[:'ytd_interest_paid'] - end - - if attributes.key?(:'ytd_principal_paid') - self.ytd_principal_paid = attributes[:'ytd_principal_paid'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @account_number.nil? - invalid_properties.push('invalid value for "account_number", account_number cannot be nil.') - end - - if @interest_rate.nil? - invalid_properties.push('invalid value for "interest_rate", interest_rate cannot be nil.') - end - - if @property_address.nil? - invalid_properties.push('invalid value for "property_address", property_address cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @account_number.nil? - return false if @interest_rate.nil? - return false if @property_address.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - account_number == o.account_number && - current_late_fee == o.current_late_fee && - escrow_balance == o.escrow_balance && - has_pmi == o.has_pmi && - has_prepayment_penalty == o.has_prepayment_penalty && - interest_rate == o.interest_rate && - last_payment_amount == o.last_payment_amount && - last_payment_date == o.last_payment_date && - loan_type_description == o.loan_type_description && - loan_term == o.loan_term && - maturity_date == o.maturity_date && - next_monthly_payment == o.next_monthly_payment && - next_payment_due_date == o.next_payment_due_date && - origination_date == o.origination_date && - origination_principal_amount == o.origination_principal_amount && - past_due_amount == o.past_due_amount && - property_address == o.property_address && - ytd_interest_paid == o.ytd_interest_paid && - ytd_principal_paid == o.ytd_principal_paid - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, account_number, current_late_fee, escrow_balance, has_pmi, has_prepayment_penalty, interest_rate, last_payment_amount, last_payment_date, loan_type_description, loan_term, maturity_date, next_monthly_payment, next_payment_due_date, origination_date, origination_principal_amount, past_due_amount, property_address, ytd_interest_paid, ytd_principal_paid].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/mortgage_property_address.rb b/lib/plaid/models/mortgage_property_address.rb deleted file mode 100644 index aeef5c44d..000000000 --- a/lib/plaid/models/mortgage_property_address.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Object containing fields describing property address. - class MortgagePropertyAddress - # The city name. - attr_accessor :city - - # The ISO 3166-1 alpha-2 country code. - attr_accessor :country - - # The five or nine digit postal code. - attr_accessor :postal_code - - # The region or state (example \"NC\"). - attr_accessor :region - - # The full street address (example \"564 Main Street, Apt 15\"). - attr_accessor :street - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'country' => :'country', - :'postal_code' => :'postal_code', - :'region' => :'region', - :'street' => :'street' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'country' => :'String', - :'postal_code' => :'String', - :'region' => :'String', - :'street' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'city', - :'country', - :'postal_code', - :'region', - :'street' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::MortgagePropertyAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::MortgagePropertyAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - country == o.country && - postal_code == o.postal_code && - region == o.region && - street == o.street - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, country, postal_code, region, street].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/multi_document_risk_signal.rb b/lib/plaid/models/multi_document_risk_signal.rb deleted file mode 100644 index f78d1714a..000000000 --- a/lib/plaid/models/multi_document_risk_signal.rb +++ /dev/null @@ -1,245 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Object containing risk signals and relevant metadata for a set of uploaded documents - class MultiDocumentRiskSignal - # Array of objects containing attributes that could indicate if a document is fraudulent - attr_accessor :document_references - - # Array of attributes that indicate whether or not there is fraud risk with a set of documents - attr_accessor :risk_signals - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'document_references' => :'document_references', - :'risk_signals' => :'risk_signals' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'document_references' => :'Array', - :'risk_signals' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::MultiDocumentRiskSignal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::MultiDocumentRiskSignal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'document_references') - if (value = attributes[:'document_references']).is_a?(Array) - self.document_references = value - end - end - - if attributes.key?(:'risk_signals') - if (value = attributes[:'risk_signals']).is_a?(Array) - self.risk_signals = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @document_references.nil? - invalid_properties.push('invalid value for "document_references", document_references cannot be nil.') - end - - if @risk_signals.nil? - invalid_properties.push('invalid value for "risk_signals", risk_signals cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @document_references.nil? - return false if @risk_signals.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - document_references == o.document_references && - risk_signals == o.risk_signals - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [document_references, risk_signals].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/name_match_score.rb b/lib/plaid/models/name_match_score.rb deleted file mode 100644 index 193952f30..000000000 --- a/lib/plaid/models/name_match_score.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class NameMatchScore - # Match score for name. 100 is a perfect score, 99-85 means a strong match, 84-70 is a partial match, any score less than 70 is a mismatch. Typically, the match threshold should be set to a score of 70 or higher. If the name is missing from either the API or financial institution, this is null. - attr_accessor :score - - # first or last name completely matched, likely a family member - attr_accessor :is_first_name_or_last_name_match - - # nickname matched, example Jennifer and Jenn. - attr_accessor :is_nickname_match - - # 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. - attr_accessor :is_business_name_detected - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'score' => :'score', - :'is_first_name_or_last_name_match' => :'is_first_name_or_last_name_match', - :'is_nickname_match' => :'is_nickname_match', - :'is_business_name_detected' => :'is_business_name_detected' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'score' => :'Integer', - :'is_first_name_or_last_name_match' => :'Boolean', - :'is_nickname_match' => :'Boolean', - :'is_business_name_detected' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'score', - :'is_first_name_or_last_name_match', - :'is_nickname_match', - :'is_business_name_detected' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::NameMatchScore` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::NameMatchScore`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'score') - self.score = attributes[:'score'] - end - - if attributes.key?(:'is_first_name_or_last_name_match') - self.is_first_name_or_last_name_match = attributes[:'is_first_name_or_last_name_match'] - end - - if attributes.key?(:'is_nickname_match') - self.is_nickname_match = attributes[:'is_nickname_match'] - end - - if attributes.key?(:'is_business_name_detected') - self.is_business_name_detected = attributes[:'is_business_name_detected'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - score == o.score && - is_first_name_or_last_name_match == o.is_first_name_or_last_name_match && - is_nickname_match == o.is_nickname_match && - is_business_name_detected == o.is_business_name_detected - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [score, is_first_name_or_last_name_match, is_nickname_match, is_business_name_detected].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/net_pay.rb b/lib/plaid/models/net_pay.rb deleted file mode 100644 index f00acfa44..000000000 --- a/lib/plaid/models/net_pay.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing information about the net pay amount on the paystub. - class NetPay - # Raw amount of the net pay for the pay period - attr_accessor :current_amount - - # Description of the net pay - attr_accessor :description - - # The ISO-4217 currency code of the net pay. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # 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. - attr_accessor :unofficial_currency_code - - # The year-to-date amount of the net pay - attr_accessor :ytd_amount - - attr_accessor :total - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'current_amount' => :'current_amount', - :'description' => :'description', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'ytd_amount' => :'ytd_amount', - :'total' => :'total' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'current_amount' => :'Float', - :'description' => :'String', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'ytd_amount' => :'Float', - :'total' => :'Total' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'current_amount', - :'description', - :'iso_currency_code', - :'unofficial_currency_code', - :'ytd_amount', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::NetPay` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::NetPay`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'current_amount') - self.current_amount = attributes[:'current_amount'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'ytd_amount') - self.ytd_amount = attributes[:'ytd_amount'] - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - current_amount == o.current_amount && - description == o.description && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - ytd_amount == o.ytd_amount && - total == o.total - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [current_amount, description, iso_currency_code, unofficial_currency_code, ytd_amount, total].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/new_accounts_available_webhook.rb b/lib/plaid/models/new_accounts_available_webhook.rb deleted file mode 100644 index 26b146f72..000000000 --- a/lib/plaid/models/new_accounts_available_webhook.rb +++ /dev/null @@ -1,282 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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). - class NewAccountsAvailableWebhook - # `ITEM` - attr_accessor :webhook_type - - # `NEW_ACCOUNTS_AVAILABLE` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :error - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'error' => :'error', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'error' => :'PlaidError', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::NewAccountsAvailableWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::NewAccountsAvailableWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - error == o.error && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, error, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/numbers.rb b/lib/plaid/models/numbers.rb deleted file mode 100644 index 29b0ea8db..000000000 --- a/lib/plaid/models/numbers.rb +++ /dev/null @@ -1,291 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Account and bank identifier number data used to configure the test account. All values are optional. - class Numbers - # Will be used for the account number. - attr_accessor :account - - # Must be a valid ACH routing number. - attr_accessor :ach_routing - - # Must be a valid wire transfer routing number. - attr_accessor :ach_wire_routing - - # EFT institution number. Must be specified alongside `eft_branch`. - attr_accessor :eft_institution - - # EFT branch number. Must be specified alongside `eft_institution`. - attr_accessor :eft_branch - - # Bank identifier code (BIC). Must be specified alongside `international_iban`. - attr_accessor :international_bic - - # International bank account number (IBAN). If no account number is specified via `account`, will also be used as the account number by default. Must be specified alongside `international_bic`. - attr_accessor :international_iban - - # BACS sort code - attr_accessor :bacs_sort_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account' => :'account', - :'ach_routing' => :'ach_routing', - :'ach_wire_routing' => :'ach_wire_routing', - :'eft_institution' => :'eft_institution', - :'eft_branch' => :'eft_branch', - :'international_bic' => :'international_bic', - :'international_iban' => :'international_iban', - :'bacs_sort_code' => :'bacs_sort_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account' => :'String', - :'ach_routing' => :'String', - :'ach_wire_routing' => :'String', - :'eft_institution' => :'String', - :'eft_branch' => :'String', - :'international_bic' => :'String', - :'international_iban' => :'String', - :'bacs_sort_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Numbers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Numbers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'ach_routing') - self.ach_routing = attributes[:'ach_routing'] - end - - if attributes.key?(:'ach_wire_routing') - self.ach_wire_routing = attributes[:'ach_wire_routing'] - end - - if attributes.key?(:'eft_institution') - self.eft_institution = attributes[:'eft_institution'] - end - - if attributes.key?(:'eft_branch') - self.eft_branch = attributes[:'eft_branch'] - end - - if attributes.key?(:'international_bic') - self.international_bic = attributes[:'international_bic'] - end - - if attributes.key?(:'international_iban') - self.international_iban = attributes[:'international_iban'] - end - - if attributes.key?(:'bacs_sort_code') - self.bacs_sort_code = attributes[:'bacs_sort_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account == o.account && - ach_routing == o.ach_routing && - ach_wire_routing == o.ach_wire_routing && - eft_institution == o.eft_institution && - eft_branch == o.eft_branch && - international_bic == o.international_bic && - international_iban == o.international_iban && - bacs_sort_code == o.bacs_sort_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account, ach_routing, ach_wire_routing, eft_institution, eft_branch, international_bic, international_iban, bacs_sort_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/numbers_acats.rb b/lib/plaid/models/numbers_acats.rb deleted file mode 100644 index 0546ff64a..000000000 --- a/lib/plaid/models/numbers_acats.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Identifying information for transferring holdings to an investments account via ACATS. - class NumbersACATS - # The Plaid account ID associated with the account numbers - attr_accessor :account_id - - # The full account number for the account - attr_accessor :account - - # 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. - attr_accessor :dtc_numbers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'account' => :'account', - :'dtc_numbers' => :'dtc_numbers' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'account' => :'String', - :'dtc_numbers' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::NumbersACATS` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::NumbersACATS`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'dtc_numbers') - if (value = attributes[:'dtc_numbers']).is_a?(Array) - self.dtc_numbers = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @account.nil? - invalid_properties.push('invalid value for "account", account cannot be nil.') - end - - if @dtc_numbers.nil? - invalid_properties.push('invalid value for "dtc_numbers", dtc_numbers cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @account.nil? - return false if @dtc_numbers.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - account == o.account && - dtc_numbers == o.dtc_numbers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, account, dtc_numbers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/numbers_ach.rb b/lib/plaid/models/numbers_ach.rb deleted file mode 100644 index 4045a0868..000000000 --- a/lib/plaid/models/numbers_ach.rb +++ /dev/null @@ -1,289 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Identifying information for transferring money to or from a US account via ACH or wire transfer. - class NumbersACH - # The Plaid account ID associated with the account numbers - attr_accessor :account_id - - # 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. - attr_accessor :account - - # 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. - attr_accessor :routing - - # The wire transfer routing number for the account, if available - attr_accessor :wire_routing - - # Whether the account supports ACH transfers into the account - attr_accessor :can_transfer_in - - # Whether the account supports ACH transfers out of the account - attr_accessor :can_transfer_out - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'account' => :'account', - :'routing' => :'routing', - :'wire_routing' => :'wire_routing', - :'can_transfer_in' => :'can_transfer_in', - :'can_transfer_out' => :'can_transfer_out' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'account' => :'String', - :'routing' => :'String', - :'wire_routing' => :'String', - :'can_transfer_in' => :'Boolean', - :'can_transfer_out' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'wire_routing', - :'can_transfer_in', - :'can_transfer_out' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::NumbersACH` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::NumbersACH`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'routing') - self.routing = attributes[:'routing'] - end - - if attributes.key?(:'wire_routing') - self.wire_routing = attributes[:'wire_routing'] - end - - if attributes.key?(:'can_transfer_in') - self.can_transfer_in = attributes[:'can_transfer_in'] - end - - if attributes.key?(:'can_transfer_out') - self.can_transfer_out = attributes[:'can_transfer_out'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @account.nil? - invalid_properties.push('invalid value for "account", account cannot be nil.') - end - - if @routing.nil? - invalid_properties.push('invalid value for "routing", routing cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @account.nil? - return false if @routing.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - account == o.account && - routing == o.routing && - wire_routing == o.wire_routing && - can_transfer_in == o.can_transfer_in && - can_transfer_out == o.can_transfer_out - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, account, routing, wire_routing, can_transfer_in, can_transfer_out].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/numbers_ach_nullable.rb b/lib/plaid/models/numbers_ach_nullable.rb deleted file mode 100644 index d444c244e..000000000 --- a/lib/plaid/models/numbers_ach_nullable.rb +++ /dev/null @@ -1,296 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Identifying information for transferring money to or from a US account via ACH or wire transfer. - class NumbersACHNullable - # The Plaid account ID associated with the account numbers - attr_accessor :account_id - - # 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. - attr_accessor :account - - # 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. - attr_accessor :routing - - # The wire transfer routing number for the account, if available - attr_accessor :wire_routing - - # Whether the account supports ACH transfers into the account - attr_accessor :can_transfer_in - - # Whether the account supports ACH transfers out of the account - attr_accessor :can_transfer_out - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'account' => :'account', - :'routing' => :'routing', - :'wire_routing' => :'wire_routing', - :'can_transfer_in' => :'can_transfer_in', - :'can_transfer_out' => :'can_transfer_out' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'account' => :'String', - :'routing' => :'String', - :'wire_routing' => :'String', - :'can_transfer_in' => :'Boolean', - :'can_transfer_out' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'wire_routing', - :'can_transfer_in', - :'can_transfer_out' - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'NumbersACH' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::NumbersACHNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::NumbersACHNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'routing') - self.routing = attributes[:'routing'] - end - - if attributes.key?(:'wire_routing') - self.wire_routing = attributes[:'wire_routing'] - end - - if attributes.key?(:'can_transfer_in') - self.can_transfer_in = attributes[:'can_transfer_in'] - end - - if attributes.key?(:'can_transfer_out') - self.can_transfer_out = attributes[:'can_transfer_out'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @account.nil? - invalid_properties.push('invalid value for "account", account cannot be nil.') - end - - if @routing.nil? - invalid_properties.push('invalid value for "routing", routing cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @account.nil? - return false if @routing.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - account == o.account && - routing == o.routing && - wire_routing == o.wire_routing && - can_transfer_in == o.can_transfer_in && - can_transfer_out == o.can_transfer_out - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, account, routing, wire_routing, can_transfer_in, can_transfer_out].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/numbers_aton.rb b/lib/plaid/models/numbers_aton.rb deleted file mode 100644 index 0520f9e12..000000000 --- a/lib/plaid/models/numbers_aton.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Identifying information for transferring holdings to an investments account via ATON. - class NumbersATON - # The Plaid account ID associated with the account numbers - attr_accessor :account_id - - # The full account number for the account - attr_accessor :account - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'account' => :'account' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'account' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::NumbersATON` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::NumbersATON`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @account.nil? - invalid_properties.push('invalid value for "account", account cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @account.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - account == o.account - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, account].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/numbers_bacs.rb b/lib/plaid/models/numbers_bacs.rb deleted file mode 100644 index ab79281d8..000000000 --- a/lib/plaid/models/numbers_bacs.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Identifying information for transferring money to or from a UK bank account via BACS. - class NumbersBACS - # The Plaid account ID associated with the account numbers - attr_accessor :account_id - - # The BACS account number for the account - attr_accessor :account - - # The BACS sort code for the account - attr_accessor :sort_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'account' => :'account', - :'sort_code' => :'sort_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'account' => :'String', - :'sort_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::NumbersBACS` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::NumbersBACS`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'sort_code') - self.sort_code = attributes[:'sort_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @account.nil? - invalid_properties.push('invalid value for "account", account cannot be nil.') - end - - if @sort_code.nil? - invalid_properties.push('invalid value for "sort_code", sort_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @account.nil? - return false if @sort_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - account == o.account && - sort_code == o.sort_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, account, sort_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/numbers_bacs_nullable.rb b/lib/plaid/models/numbers_bacs_nullable.rb deleted file mode 100644 index 8fc1ac1f1..000000000 --- a/lib/plaid/models/numbers_bacs_nullable.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Identifying information for transferring money to or from a UK bank account via BACS. - class NumbersBACSNullable - # The Plaid account ID associated with the account numbers - attr_accessor :account_id - - # The BACS account number for the account - attr_accessor :account - - # The BACS sort code for the account - attr_accessor :sort_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'account' => :'account', - :'sort_code' => :'sort_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'account' => :'String', - :'sort_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'NumbersBACS' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::NumbersBACSNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::NumbersBACSNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'sort_code') - self.sort_code = attributes[:'sort_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @account.nil? - invalid_properties.push('invalid value for "account", account cannot be nil.') - end - - if @sort_code.nil? - invalid_properties.push('invalid value for "sort_code", sort_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @account.nil? - return false if @sort_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - account == o.account && - sort_code == o.sort_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, account, sort_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/numbers_eft.rb b/lib/plaid/models/numbers_eft.rb deleted file mode 100644 index adda60cbf..000000000 --- a/lib/plaid/models/numbers_eft.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Identifying information for transferring money to or from a Canadian bank account via EFT. - class NumbersEFT - # The Plaid account ID associated with the account numbers - attr_accessor :account_id - - # The EFT account number for the account - attr_accessor :account - - # The EFT institution number for the account - attr_accessor :institution - - # The EFT branch number for the account - attr_accessor :branch - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'account' => :'account', - :'institution' => :'institution', - :'branch' => :'branch' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'account' => :'String', - :'institution' => :'String', - :'branch' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::NumbersEFT` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::NumbersEFT`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'institution') - self.institution = attributes[:'institution'] - end - - if attributes.key?(:'branch') - self.branch = attributes[:'branch'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @account.nil? - invalid_properties.push('invalid value for "account", account cannot be nil.') - end - - if @institution.nil? - invalid_properties.push('invalid value for "institution", institution cannot be nil.') - end - - if @branch.nil? - invalid_properties.push('invalid value for "branch", branch cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @account.nil? - return false if @institution.nil? - return false if @branch.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - account == o.account && - institution == o.institution && - branch == o.branch - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, account, institution, branch].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/numbers_eft_nullable.rb b/lib/plaid/models/numbers_eft_nullable.rb deleted file mode 100644 index cb532dc6d..000000000 --- a/lib/plaid/models/numbers_eft_nullable.rb +++ /dev/null @@ -1,278 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Identifying information for transferring money to or from a Canadian bank account via EFT. - class NumbersEFTNullable - # The Plaid account ID associated with the account numbers - attr_accessor :account_id - - # The EFT account number for the account - attr_accessor :account - - # The EFT institution number for the account - attr_accessor :institution - - # The EFT branch number for the account - attr_accessor :branch - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'account' => :'account', - :'institution' => :'institution', - :'branch' => :'branch' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'account' => :'String', - :'institution' => :'String', - :'branch' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'NumbersEFT' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::NumbersEFTNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::NumbersEFTNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'institution') - self.institution = attributes[:'institution'] - end - - if attributes.key?(:'branch') - self.branch = attributes[:'branch'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @account.nil? - invalid_properties.push('invalid value for "account", account cannot be nil.') - end - - if @institution.nil? - invalid_properties.push('invalid value for "institution", institution cannot be nil.') - end - - if @branch.nil? - invalid_properties.push('invalid value for "branch", branch cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @account.nil? - return false if @institution.nil? - return false if @branch.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - account == o.account && - institution == o.institution && - branch == o.branch - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, account, institution, branch].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/numbers_iban_nullable.rb b/lib/plaid/models/numbers_iban_nullable.rb deleted file mode 100644 index c9e99429b..000000000 --- a/lib/plaid/models/numbers_iban_nullable.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # International Bank Account Number (IBAN). - class NumbersIBANNullable - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::NumbersIBANNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::NumbersIBANNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/numbers_international.rb b/lib/plaid/models/numbers_international.rb deleted file mode 100644 index 779f357d9..000000000 --- a/lib/plaid/models/numbers_international.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Identifying information for transferring money to or from an international bank account via wire transfer. - class NumbersInternational - # The Plaid account ID associated with the account numbers - attr_accessor :account_id - - # The International Bank Account Number (IBAN) for the account - attr_accessor :iban - - # The Bank Identifier Code (BIC) for the account - attr_accessor :bic - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'iban' => :'iban', - :'bic' => :'bic' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'iban' => :'String', - :'bic' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::NumbersInternational` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::NumbersInternational`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'iban') - self.iban = attributes[:'iban'] - end - - if attributes.key?(:'bic') - self.bic = attributes[:'bic'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @iban.nil? - invalid_properties.push('invalid value for "iban", iban cannot be nil.') - end - - if @bic.nil? - invalid_properties.push('invalid value for "bic", bic cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @iban.nil? - return false if @bic.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - iban == o.iban && - bic == o.bic - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, iban, bic].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/numbers_international_iban.rb b/lib/plaid/models/numbers_international_iban.rb deleted file mode 100644 index cd97928e1..000000000 --- a/lib/plaid/models/numbers_international_iban.rb +++ /dev/null @@ -1,301 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Account numbers using the International Bank Account Number and BIC/SWIFT code format. - class NumbersInternationalIBAN - # International Bank Account Number (IBAN). - attr_accessor :iban - - # The Business Identifier Code, also known as SWIFT code, for this bank account. - attr_accessor :bic - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'iban' => :'iban', - :'bic' => :'bic' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'iban' => :'String', - :'bic' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::NumbersInternationalIBAN` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::NumbersInternationalIBAN`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'iban') - self.iban = attributes[:'iban'] - end - - if attributes.key?(:'bic') - self.bic = attributes[:'bic'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @iban.nil? - invalid_properties.push('invalid value for "iban", iban cannot be nil.') - end - - if @iban.to_s.length > 34 - invalid_properties.push('invalid value for "iban", the character length must be smaller than or equal to 34.') - end - - if @iban.to_s.length < 15 - invalid_properties.push('invalid value for "iban", the character length must be great than or equal to 15.') - end - - - if @bic.nil? - invalid_properties.push('invalid value for "bic", bic cannot be nil.') - end - - if @bic.to_s.length > 11 - invalid_properties.push('invalid value for "bic", the character length must be smaller than or equal to 11.') - end - - if @bic.to_s.length < 8 - invalid_properties.push('invalid value for "bic", the character length must be great than or equal to 8.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @iban.nil? - return false if @iban.to_s.length > 34 - return false if @iban.to_s.length < 15 - return false if @bic.nil? - return false if @bic.to_s.length > 11 - return false if @bic.to_s.length < 8 - true - end - - # Custom attribute writer method with validation - # @param [Object] iban Value to be assigned - def iban=(iban) - if iban.nil? - fail ArgumentError, 'iban cannot be nil' - end - - if iban.to_s.length > 34 - fail ArgumentError, 'invalid value for "iban", the character length must be smaller than or equal to 34.' - end - - if iban.to_s.length < 15 - fail ArgumentError, 'invalid value for "iban", the character length must be great than or equal to 15.' - end - - - @iban = iban - end - - # Custom attribute writer method with validation - # @param [Object] bic Value to be assigned - def bic=(bic) - if bic.nil? - fail ArgumentError, 'bic cannot be nil' - end - - if bic.to_s.length > 11 - fail ArgumentError, 'invalid value for "bic", the character length must be smaller than or equal to 11.' - end - - if bic.to_s.length < 8 - fail ArgumentError, 'invalid value for "bic", the character length must be great than or equal to 8.' - end - - - @bic = bic - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - iban == o.iban && - bic == o.bic - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [iban, bic].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/numbers_international_nullable.rb b/lib/plaid/models/numbers_international_nullable.rb deleted file mode 100644 index c8ad47158..000000000 --- a/lib/plaid/models/numbers_international_nullable.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Identifying information for transferring money to or from an international bank account via wire transfer. - class NumbersInternationalNullable - # The Plaid account ID associated with the account numbers - attr_accessor :account_id - - # The International Bank Account Number (IBAN) for the account - attr_accessor :iban - - # The Bank Identifier Code (BIC) for the account - attr_accessor :bic - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'iban' => :'iban', - :'bic' => :'bic' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'iban' => :'String', - :'bic' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'NumbersInternational' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::NumbersInternationalNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::NumbersInternationalNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'iban') - self.iban = attributes[:'iban'] - end - - if attributes.key?(:'bic') - self.bic = attributes[:'bic'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @iban.nil? - invalid_properties.push('invalid value for "iban", iban cannot be nil.') - end - - if @bic.nil? - invalid_properties.push('invalid value for "bic", bic cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @iban.nil? - return false if @bic.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - iban == o.iban && - bic == o.bic - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, iban, bic].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/omittable_transfer_type.rb b/lib/plaid/models/omittable_transfer_type.rb deleted file mode 100644 index e1a2e16bc..000000000 --- a/lib/plaid/models/omittable_transfer_type.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class OmittableTransferType - DEBIT = "debit".freeze - CREDIT = "credit".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/option_contract.rb b/lib/plaid/models/option_contract.rb deleted file mode 100644 index ad7981862..000000000 --- a/lib/plaid/models/option_contract.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Details about the option security. For the Sandbox environment, this data is currently only available if the item is using a custom configuration object, and the `ticker` field of the custom security follows the [OCC Option Symbol](https://en.wikipedia.org/wiki/Option_symbol#The_OCC_Option_Symbol) standard with no spaces. - class OptionContract - # The type of this option contract. It is one of: `put`: for Put option contracts `call`: for Call option contracts - attr_accessor :contract_type - - # The expiration date for this option contract, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :expiration_date - - # The strike price for this option contract, per share of security. - attr_accessor :strike_price - - # The ticker of the underlying security for this option contract. - attr_accessor :underlying_security_ticker - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'contract_type' => :'contract_type', - :'expiration_date' => :'expiration_date', - :'strike_price' => :'strike_price', - :'underlying_security_ticker' => :'underlying_security_ticker' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'contract_type' => :'String', - :'expiration_date' => :'Date', - :'strike_price' => :'Float', - :'underlying_security_ticker' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::OptionContract` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::OptionContract`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'contract_type') - self.contract_type = attributes[:'contract_type'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - - if attributes.key?(:'strike_price') - self.strike_price = attributes[:'strike_price'] - end - - if attributes.key?(:'underlying_security_ticker') - self.underlying_security_ticker = attributes[:'underlying_security_ticker'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @contract_type.nil? - invalid_properties.push('invalid value for "contract_type", contract_type cannot be nil.') - end - - if @expiration_date.nil? - invalid_properties.push('invalid value for "expiration_date", expiration_date cannot be nil.') - end - - if @strike_price.nil? - invalid_properties.push('invalid value for "strike_price", strike_price cannot be nil.') - end - - if @underlying_security_ticker.nil? - invalid_properties.push('invalid value for "underlying_security_ticker", underlying_security_ticker cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @contract_type.nil? - return false if @expiration_date.nil? - return false if @strike_price.nil? - return false if @underlying_security_ticker.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - contract_type == o.contract_type && - expiration_date == o.expiration_date && - strike_price == o.strike_price && - underlying_security_ticker == o.underlying_security_ticker - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [contract_type, expiration_date, strike_price, underlying_security_ticker].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/originator.rb b/lib/plaid/models/originator.rb deleted file mode 100644 index 94dd6651c..000000000 --- a/lib/plaid/models/originator.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Originator and their status. - class Originator - # Originator’s client ID. - attr_accessor :client_id - - attr_accessor :transfer_diligence_status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'transfer_diligence_status' => :'transfer_diligence_status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'transfer_diligence_status' => :'TransferDiligenceStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Originator` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Originator`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'transfer_diligence_status') - self.transfer_diligence_status = attributes[:'transfer_diligence_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @client_id.nil? - invalid_properties.push('invalid value for "client_id", client_id cannot be nil.') - end - - if @transfer_diligence_status.nil? - invalid_properties.push('invalid value for "transfer_diligence_status", transfer_diligence_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @client_id.nil? - return false if @transfer_diligence_status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - transfer_diligence_status == o.transfer_diligence_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, transfer_diligence_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/originator_expected_transfer_frequency.rb b/lib/plaid/models/originator_expected_transfer_frequency.rb deleted file mode 100644 index 6887f3eac..000000000 --- a/lib/plaid/models/originator_expected_transfer_frequency.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class OriginatorExpectedTransferFrequency - ONCE_PER_MONTH = "once_per_month".freeze - TWICE_PER_MONTH = "twice_per_month".freeze - ONCE_PER_WEEK = "once_per_week".freeze - DAILY = "daily".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/other_account_subtype.rb b/lib/plaid/models/other_account_subtype.rb deleted file mode 100644 index abd73727e..000000000 --- a/lib/plaid/models/other_account_subtype.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class OtherAccountSubtype - OTHER = "other".freeze - ALL = "all".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/other_filter.rb b/lib/plaid/models/other_filter.rb deleted file mode 100644 index 4aee5fb54..000000000 --- a/lib/plaid/models/other_filter.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A filter to apply to `other`-type accounts - class 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). - attr_accessor :account_subtypes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_subtypes' => :'account_subtypes' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_subtypes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::OtherFilter` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::OtherFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_subtypes') - if (value = attributes[:'account_subtypes']).is_a?(Array) - self.account_subtypes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_subtypes.nil? - invalid_properties.push('invalid value for "account_subtypes", account_subtypes cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_subtypes.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_subtypes == o.account_subtypes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_subtypes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/override_account_type.rb b/lib/plaid/models/override_account_type.rb deleted file mode 100644 index 95c8dd101..000000000 --- a/lib/plaid/models/override_account_type.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class OverrideAccountType - INVESTMENT = "investment".freeze - CREDIT = "credit".freeze - DEPOSITORY = "depository".freeze - LOAN = "loan".freeze - PAYROLL = "payroll".freeze - OTHER = "other".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/override_accounts.rb b/lib/plaid/models/override_accounts.rb deleted file mode 100644 index 9d310d7bb..000000000 --- a/lib/plaid/models/override_accounts.rb +++ /dev/null @@ -1,416 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data to use to set values of test accounts. Some values cannot be specified in the schema and will instead will be calculated from other test data in order to achieve more consistent, realistic test data. - class OverrideAccounts - attr_accessor :type - - attr_accessor :subtype - - # If provided, the account will start with this amount as the current balance. - attr_accessor :starting_balance - - # If provided, the account will always have this amount as its available balance, regardless of current balance or changes in transactions over time. - attr_accessor :force_available_balance - - # ISO-4217 currency code. If provided, the account will be denominated in the given currency. Transactions will also be in this currency by default. - attr_accessor :currency - - attr_accessor :meta - - attr_accessor :numbers - - # Specify the list of transactions on the account. - attr_accessor :transactions - - attr_accessor :holdings - - attr_accessor :investment_transactions - - attr_accessor :identity - - attr_accessor :liability - - attr_accessor :inflow_model - - attr_accessor :income - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'subtype' => :'subtype', - :'starting_balance' => :'starting_balance', - :'force_available_balance' => :'force_available_balance', - :'currency' => :'currency', - :'meta' => :'meta', - :'numbers' => :'numbers', - :'transactions' => :'transactions', - :'holdings' => :'holdings', - :'investment_transactions' => :'investment_transactions', - :'identity' => :'identity', - :'liability' => :'liability', - :'inflow_model' => :'inflow_model', - :'income' => :'income' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'OverrideAccountType', - :'subtype' => :'AccountSubtype', - :'starting_balance' => :'Float', - :'force_available_balance' => :'Float', - :'currency' => :'String', - :'meta' => :'Meta', - :'numbers' => :'Numbers', - :'transactions' => :'Array', - :'holdings' => :'HoldingsOverride', - :'investment_transactions' => :'InvestmentsTransactionsOverride', - :'identity' => :'OwnerOverride', - :'liability' => :'LiabilityOverride', - :'inflow_model' => :'InflowModel', - :'income' => :'IncomeOverride' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'subtype', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::OverrideAccounts` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::OverrideAccounts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'subtype') - self.subtype = attributes[:'subtype'] - end - - if attributes.key?(:'starting_balance') - self.starting_balance = attributes[:'starting_balance'] - end - - if attributes.key?(:'force_available_balance') - self.force_available_balance = attributes[:'force_available_balance'] - end - - if attributes.key?(:'currency') - self.currency = attributes[:'currency'] - end - - if attributes.key?(:'meta') - self.meta = attributes[:'meta'] - end - - if attributes.key?(:'numbers') - self.numbers = attributes[:'numbers'] - end - - if attributes.key?(:'transactions') - if (value = attributes[:'transactions']).is_a?(Array) - self.transactions = value - end - end - - if attributes.key?(:'holdings') - self.holdings = attributes[:'holdings'] - end - - if attributes.key?(:'investment_transactions') - self.investment_transactions = attributes[:'investment_transactions'] - end - - if attributes.key?(:'identity') - self.identity = attributes[:'identity'] - end - - if attributes.key?(:'liability') - self.liability = attributes[:'liability'] - end - - if attributes.key?(:'inflow_model') - self.inflow_model = attributes[:'inflow_model'] - end - - if attributes.key?(:'income') - self.income = attributes[:'income'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @starting_balance.nil? - invalid_properties.push('invalid value for "starting_balance", starting_balance cannot be nil.') - end - - if @force_available_balance.nil? - invalid_properties.push('invalid value for "force_available_balance", force_available_balance cannot be nil.') - end - - if @currency.nil? - invalid_properties.push('invalid value for "currency", currency cannot be nil.') - end - - if @meta.nil? - invalid_properties.push('invalid value for "meta", meta cannot be nil.') - end - - if @numbers.nil? - invalid_properties.push('invalid value for "numbers", numbers cannot be nil.') - end - - if @transactions.nil? - invalid_properties.push('invalid value for "transactions", transactions cannot be nil.') - end - - if @identity.nil? - invalid_properties.push('invalid value for "identity", identity cannot be nil.') - end - - if @liability.nil? - invalid_properties.push('invalid value for "liability", liability cannot be nil.') - end - - if @inflow_model.nil? - invalid_properties.push('invalid value for "inflow_model", inflow_model cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - return false if @starting_balance.nil? - return false if @force_available_balance.nil? - return false if @currency.nil? - return false if @meta.nil? - return false if @numbers.nil? - return false if @transactions.nil? - return false if @identity.nil? - return false if @liability.nil? - return false if @inflow_model.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - subtype == o.subtype && - starting_balance == o.starting_balance && - force_available_balance == o.force_available_balance && - currency == o.currency && - meta == o.meta && - numbers == o.numbers && - transactions == o.transactions && - holdings == o.holdings && - investment_transactions == o.investment_transactions && - identity == o.identity && - liability == o.liability && - inflow_model == o.inflow_model && - income == o.income - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, subtype, starting_balance, force_available_balance, currency, meta, numbers, transactions, holdings, investment_transactions, identity, liability, inflow_model, income].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/owner.rb b/lib/plaid/models/owner.rb deleted file mode 100644 index 652040bec..000000000 --- a/lib/plaid/models/owner.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data returned from the financial institution about the owner or owners of an account. Only the `names` array must be non-empty. - class Owner - # A list of names associated with the account by the financial institution. In the case of a joint account, Plaid will make a best effort to report the names of all account holders. If an Item contains multiple accounts with different owner names, some institutions will report all names associated with the Item in each account's `names` array. - attr_accessor :names - - # A list of phone numbers associated with the account by the financial institution. May be an empty array if no relevant information is returned from the financial institution. - attr_accessor :phone_numbers - - # 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. - attr_accessor :emails - - # 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. - attr_accessor :addresses - - # document_id is the id of the document that this identity belongs to - attr_accessor :document_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'names' => :'names', - :'phone_numbers' => :'phone_numbers', - :'emails' => :'emails', - :'addresses' => :'addresses', - :'document_id' => :'document_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'names' => :'Array', - :'phone_numbers' => :'Array', - :'emails' => :'Array', - :'addresses' => :'Array
', - :'document_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'document_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Owner` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Owner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'names') - if (value = attributes[:'names']).is_a?(Array) - self.names = value - end - end - - if attributes.key?(:'phone_numbers') - if (value = attributes[:'phone_numbers']).is_a?(Array) - self.phone_numbers = value - end - end - - if attributes.key?(:'emails') - if (value = attributes[:'emails']).is_a?(Array) - self.emails = value - end - end - - if attributes.key?(:'addresses') - if (value = attributes[:'addresses']).is_a?(Array) - self.addresses = value - end - end - - if attributes.key?(:'document_id') - self.document_id = attributes[:'document_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @names.nil? - invalid_properties.push('invalid value for "names", names cannot be nil.') - end - - if @phone_numbers.nil? - invalid_properties.push('invalid value for "phone_numbers", phone_numbers cannot be nil.') - end - - if @emails.nil? - invalid_properties.push('invalid value for "emails", emails cannot be nil.') - end - - if @addresses.nil? - invalid_properties.push('invalid value for "addresses", addresses cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @names.nil? - return false if @phone_numbers.nil? - return false if @emails.nil? - return false if @addresses.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - names == o.names && - phone_numbers == o.phone_numbers && - emails == o.emails && - addresses == o.addresses && - document_id == o.document_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [names, phone_numbers, emails, addresses, document_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/owner_override.rb b/lib/plaid/models/owner_override.rb deleted file mode 100644 index c706092be..000000000 --- a/lib/plaid/models/owner_override.rb +++ /dev/null @@ -1,279 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data about the owner or owners of an account. Any fields not specified will be filled in with default Sandbox information. - class OwnerOverride - # A list of names associated with the account by the financial institution. These should always be the names of individuals, even for business accounts. Note that the same name data will be used for all accounts associated with an Item. - attr_accessor :names - - # A list of phone numbers associated with the account. - attr_accessor :phone_numbers - - # A list of email addresses associated with the account. - attr_accessor :emails - - # Data about the various addresses associated with the account. - attr_accessor :addresses - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'names' => :'names', - :'phone_numbers' => :'phone_numbers', - :'emails' => :'emails', - :'addresses' => :'addresses' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'names' => :'Array', - :'phone_numbers' => :'Array', - :'emails' => :'Array', - :'addresses' => :'Array
' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::OwnerOverride` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::OwnerOverride`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'names') - if (value = attributes[:'names']).is_a?(Array) - self.names = value - end - end - - if attributes.key?(:'phone_numbers') - if (value = attributes[:'phone_numbers']).is_a?(Array) - self.phone_numbers = value - end - end - - if attributes.key?(:'emails') - if (value = attributes[:'emails']).is_a?(Array) - self.emails = value - end - end - - if attributes.key?(:'addresses') - if (value = attributes[:'addresses']).is_a?(Array) - self.addresses = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @names.nil? - invalid_properties.push('invalid value for "names", names cannot be nil.') - end - - if @phone_numbers.nil? - invalid_properties.push('invalid value for "phone_numbers", phone_numbers cannot be nil.') - end - - if @emails.nil? - invalid_properties.push('invalid value for "emails", emails cannot be nil.') - end - - if @addresses.nil? - invalid_properties.push('invalid value for "addresses", addresses cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @names.nil? - return false if @phone_numbers.nil? - return false if @emails.nil? - return false if @addresses.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - names == o.names && - phone_numbers == o.phone_numbers && - emails == o.emails && - addresses == o.addresses - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [names, phone_numbers, emails, addresses].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/ownership_type.rb b/lib/plaid/models/ownership_type.rb deleted file mode 100644 index 0521a7b28..000000000 --- a/lib/plaid/models/ownership_type.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class OwnershipType - NULL = "null".freeze - INDIVIDUAL = "individual".freeze - JOINT = "joint".freeze - ASSOCIATION = "association".freeze - TRUST = "trust".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/parties.rb b/lib/plaid/models/parties.rb deleted file mode 100644 index 7b3208127..000000000 --- a/lib/plaid/models/parties.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A collection of objects that define specific parties to a deal. This includes the direct participating parties, such as borrower and seller and the indirect parties such as the credit report provider. - class Parties - attr_accessor :party - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'party' => :'PARTY' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'party' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Parties` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Parties`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'party') - if (value = attributes[:'party']).is_a?(Array) - self.party = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @party.nil? - invalid_properties.push('invalid value for "party", party cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @party.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - party == o.party - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [party].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_customer_create_request.rb b/lib/plaid/models/partner_customer_create_request.rb deleted file mode 100644 index e45f8bdb6..000000000 --- a/lib/plaid/models/partner_customer_create_request.rb +++ /dev/null @@ -1,425 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request schema for `/partner/customer/create`. - class PartnerCustomerCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The company name of the end customer being created. This will be used to display the end customer in the Plaid Dashboard. It will not be shown to end users. - attr_accessor :company_name - - # Denotes whether or not the partner has completed attestation of diligence for the end customer to be created. - attr_accessor :is_diligence_attested - - # The products to be enabled for the end customer. If empty or `null`, this field will default to the products enabled for the reseller at the time this endpoint is called. - attr_accessor :products - - # If `true`, the end customer's default Link customization will be set to match the partner's. You can always change the end customer's Link customization in the Plaid Dashboard. See the [Link Customization docs](https://plaid.com/docs/link/customization/) for more information. - attr_accessor :create_link_customization - - # Base64-encoded representation of the end customer's logo. Must be a PNG of size 1024x1024 under 4MB. The logo will be shared with financial institutions and shown to the end user during Link flows. A logo is required if `create_link_customization` is `true`. If `create_link_customization` is `false` and the logo is omitted, the partner's logo will be used if one exists, otherwise a stock logo will be used. - attr_accessor :logo - - # The end customer's legal name. This will be shared with financial institutions as part of the OAuth registration process. It will not be shown to end users. - attr_accessor :legal_entity_name - - # The end customer's website. - attr_accessor :website - - # The name of the end customer's application. This will be shown to end users when they go through the Plaid Link flow. - attr_accessor :application_name - - attr_accessor :technical_contact - - attr_accessor :billing_contact - - attr_accessor :customer_support_info - - attr_accessor :address - - # Denotes whether the partner has forwarded the Plaid bank addendum to the end customer. - attr_accessor :is_bank_addendum_completed - - attr_accessor :assets_under_management - - # A list of URIs indicating the destination(s) where a user can be forwarded after completing the Link flow; used to support OAuth authentication flows when launching Link in the browser or via a webview. URIs should not contain any query parameters. When used in Production or Development, URIs must use https. To specify any subdomain, use `*` as a wildcard character, e.g. `https://*.example.com/oauth.html`. To modify redirect URIs for an end customer after creating them, go to the end customer's [API page](https://dashboard.plaid.com/team/api) in the Dashboard. - attr_accessor :redirect_uris - - # The unique identifier assigned to a financial institution by regulatory authorities, if applicable. For banks, this is the FDIC Certificate Number. For credit unions, this is the Credit Union Charter Number. - attr_accessor :registration_number - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'company_name' => :'company_name', - :'is_diligence_attested' => :'is_diligence_attested', - :'products' => :'products', - :'create_link_customization' => :'create_link_customization', - :'logo' => :'logo', - :'legal_entity_name' => :'legal_entity_name', - :'website' => :'website', - :'application_name' => :'application_name', - :'technical_contact' => :'technical_contact', - :'billing_contact' => :'billing_contact', - :'customer_support_info' => :'customer_support_info', - :'address' => :'address', - :'is_bank_addendum_completed' => :'is_bank_addendum_completed', - :'assets_under_management' => :'assets_under_management', - :'redirect_uris' => :'redirect_uris', - :'registration_number' => :'registration_number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'company_name' => :'String', - :'is_diligence_attested' => :'Boolean', - :'products' => :'Array', - :'create_link_customization' => :'Boolean', - :'logo' => :'String', - :'legal_entity_name' => :'String', - :'website' => :'String', - :'application_name' => :'String', - :'technical_contact' => :'PartnerEndCustomerTechnicalContact', - :'billing_contact' => :'PartnerEndCustomerBillingContact', - :'customer_support_info' => :'PartnerEndCustomerCustomerSupportInfo', - :'address' => :'PartnerEndCustomerAddress', - :'is_bank_addendum_completed' => :'Boolean', - :'assets_under_management' => :'PartnerEndCustomerAssetsUnderManagement', - :'redirect_uris' => :'Array', - :'registration_number' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerCustomerCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerCustomerCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'company_name') - self.company_name = attributes[:'company_name'] - end - - if attributes.key?(:'is_diligence_attested') - self.is_diligence_attested = attributes[:'is_diligence_attested'] - end - - if attributes.key?(:'products') - if (value = attributes[:'products']).is_a?(Array) - self.products = value - end - end - - if attributes.key?(:'create_link_customization') - self.create_link_customization = attributes[:'create_link_customization'] - end - - if attributes.key?(:'logo') - self.logo = attributes[:'logo'] - end - - if attributes.key?(:'legal_entity_name') - self.legal_entity_name = attributes[:'legal_entity_name'] - end - - if attributes.key?(:'website') - self.website = attributes[:'website'] - end - - if attributes.key?(:'application_name') - self.application_name = attributes[:'application_name'] - end - - if attributes.key?(:'technical_contact') - self.technical_contact = attributes[:'technical_contact'] - end - - if attributes.key?(:'billing_contact') - self.billing_contact = attributes[:'billing_contact'] - end - - if attributes.key?(:'customer_support_info') - self.customer_support_info = attributes[:'customer_support_info'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'is_bank_addendum_completed') - self.is_bank_addendum_completed = attributes[:'is_bank_addendum_completed'] - end - - if attributes.key?(:'assets_under_management') - self.assets_under_management = attributes[:'assets_under_management'] - end - - if attributes.key?(:'redirect_uris') - if (value = attributes[:'redirect_uris']).is_a?(Array) - self.redirect_uris = value - end - end - - if attributes.key?(:'registration_number') - self.registration_number = attributes[:'registration_number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @company_name.nil? - invalid_properties.push('invalid value for "company_name", company_name cannot be nil.') - end - - if @is_diligence_attested.nil? - invalid_properties.push('invalid value for "is_diligence_attested", is_diligence_attested cannot be nil.') - end - - if @legal_entity_name.nil? - invalid_properties.push('invalid value for "legal_entity_name", legal_entity_name cannot be nil.') - end - - if @website.nil? - invalid_properties.push('invalid value for "website", website cannot be nil.') - end - - if @application_name.nil? - invalid_properties.push('invalid value for "application_name", application_name cannot be nil.') - end - - if @address.nil? - invalid_properties.push('invalid value for "address", address cannot be nil.') - end - - if @is_bank_addendum_completed.nil? - invalid_properties.push('invalid value for "is_bank_addendum_completed", is_bank_addendum_completed cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @company_name.nil? - return false if @is_diligence_attested.nil? - return false if @legal_entity_name.nil? - return false if @website.nil? - return false if @application_name.nil? - return false if @address.nil? - return false if @is_bank_addendum_completed.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - company_name == o.company_name && - is_diligence_attested == o.is_diligence_attested && - products == o.products && - create_link_customization == o.create_link_customization && - logo == o.logo && - legal_entity_name == o.legal_entity_name && - website == o.website && - application_name == o.application_name && - technical_contact == o.technical_contact && - billing_contact == o.billing_contact && - customer_support_info == o.customer_support_info && - address == o.address && - is_bank_addendum_completed == o.is_bank_addendum_completed && - assets_under_management == o.assets_under_management && - redirect_uris == o.redirect_uris && - registration_number == o.registration_number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, company_name, is_diligence_attested, products, create_link_customization, logo, legal_entity_name, website, application_name, technical_contact, billing_contact, customer_support_info, address, is_bank_addendum_completed, assets_under_management, redirect_uris, registration_number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_customer_create_response.rb b/lib/plaid/models/partner_customer_create_response.rb deleted file mode 100644 index ee4d2fcc9..000000000 --- a/lib/plaid/models/partner_customer_create_response.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Response schema for `/partner/customer/create`. - class PartnerCustomerCreateResponse - attr_accessor :end_customer - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'end_customer' => :'end_customer', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'end_customer' => :'PartnerEndCustomerWithSecrets', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerCustomerCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerCustomerCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'end_customer') - self.end_customer = attributes[:'end_customer'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - end_customer == o.end_customer && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [end_customer, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_customer_enable_request.rb b/lib/plaid/models/partner_customer_enable_request.rb deleted file mode 100644 index e74c5daaa..000000000 --- a/lib/plaid/models/partner_customer_enable_request.rb +++ /dev/null @@ -1,245 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request schema for `/partner/customer/enable`. - class PartnerCustomerEnableRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - attr_accessor :end_customer_client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'end_customer_client_id' => :'end_customer_client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'end_customer_client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerCustomerEnableRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerCustomerEnableRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'end_customer_client_id') - self.end_customer_client_id = attributes[:'end_customer_client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @end_customer_client_id.nil? - invalid_properties.push('invalid value for "end_customer_client_id", end_customer_client_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @end_customer_client_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - end_customer_client_id == o.end_customer_client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, end_customer_client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_customer_enable_response.rb b/lib/plaid/models/partner_customer_enable_response.rb deleted file mode 100644 index 1d5995923..000000000 --- a/lib/plaid/models/partner_customer_enable_response.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Response schema for `/partner/customer/enable`. - class PartnerCustomerEnableResponse - # The end customer's secret key for the Production environment. - attr_accessor :production_secret - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'production_secret' => :'production_secret', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'production_secret' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerCustomerEnableResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerCustomerEnableResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'production_secret') - self.production_secret = attributes[:'production_secret'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - production_secret == o.production_secret && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [production_secret, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_customer_get_request.rb b/lib/plaid/models/partner_customer_get_request.rb deleted file mode 100644 index 9615df8a5..000000000 --- a/lib/plaid/models/partner_customer_get_request.rb +++ /dev/null @@ -1,245 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request schema for `/partner/customer/get`. - class PartnerCustomerGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - attr_accessor :end_customer_client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'end_customer_client_id' => :'end_customer_client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'end_customer_client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerCustomerGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerCustomerGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'end_customer_client_id') - self.end_customer_client_id = attributes[:'end_customer_client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @end_customer_client_id.nil? - invalid_properties.push('invalid value for "end_customer_client_id", end_customer_client_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @end_customer_client_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - end_customer_client_id == o.end_customer_client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, end_customer_client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_customer_get_response.rb b/lib/plaid/models/partner_customer_get_response.rb deleted file mode 100644 index 2ceacad1c..000000000 --- a/lib/plaid/models/partner_customer_get_response.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Response schema for `/partner/customer/get`. - class PartnerCustomerGetResponse - attr_accessor :end_customer - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'end_customer' => :'end_customer', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'end_customer' => :'PartnerEndCustomer', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerCustomerGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerCustomerGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'end_customer') - self.end_customer = attributes[:'end_customer'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - end_customer == o.end_customer && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [end_customer, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_customer_o_auth_institutions_get_request.rb b/lib/plaid/models/partner_customer_o_auth_institutions_get_request.rb deleted file mode 100644 index ad5c235f3..000000000 --- a/lib/plaid/models/partner_customer_o_auth_institutions_get_request.rb +++ /dev/null @@ -1,245 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request schema for `/partner/customer/oauth_institutions/get`. - class PartnerCustomerOAuthInstitutionsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - attr_accessor :end_customer_client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'end_customer_client_id' => :'end_customer_client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'end_customer_client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerCustomerOAuthInstitutionsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerCustomerOAuthInstitutionsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'end_customer_client_id') - self.end_customer_client_id = attributes[:'end_customer_client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @end_customer_client_id.nil? - invalid_properties.push('invalid value for "end_customer_client_id", end_customer_client_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @end_customer_client_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - end_customer_client_id == o.end_customer_client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, end_customer_client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_customer_o_auth_institutions_get_response.rb b/lib/plaid/models/partner_customer_o_auth_institutions_get_response.rb deleted file mode 100644 index c8cb15143..000000000 --- a/lib/plaid/models/partner_customer_o_auth_institutions_get_response.rb +++ /dev/null @@ -1,273 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Response schema for `/partner/customer/oauth_institutions/get`. - class PartnerCustomerOAuthInstitutionsGetResponse - attr_accessor :flowdown_status - - attr_accessor :questionnaire_status - - # The OAuth institutions with which the end customer's application is being registered. - attr_accessor :institutions - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'flowdown_status' => :'flowdown_status', - :'questionnaire_status' => :'questionnaire_status', - :'institutions' => :'institutions', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'flowdown_status' => :'PartnerEndCustomerFlowdownStatus', - :'questionnaire_status' => :'PartnerEndCustomerQuestionnaireStatus', - :'institutions' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerCustomerOAuthInstitutionsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerCustomerOAuthInstitutionsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'flowdown_status') - self.flowdown_status = attributes[:'flowdown_status'] - end - - if attributes.key?(:'questionnaire_status') - self.questionnaire_status = attributes[:'questionnaire_status'] - end - - if attributes.key?(:'institutions') - if (value = attributes[:'institutions']).is_a?(Array) - self.institutions = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - flowdown_status == o.flowdown_status && - questionnaire_status == o.questionnaire_status && - institutions == o.institutions && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [flowdown_status, questionnaire_status, institutions, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_customer_remove_request.rb b/lib/plaid/models/partner_customer_remove_request.rb deleted file mode 100644 index 8b65c14cc..000000000 --- a/lib/plaid/models/partner_customer_remove_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request schema for `/partner/customer/remove`. - class PartnerCustomerRemoveRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The `client_id` of the end customer to be removed. - attr_accessor :end_customer_client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'end_customer_client_id' => :'end_customer_client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'end_customer_client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerCustomerRemoveRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerCustomerRemoveRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'end_customer_client_id') - self.end_customer_client_id = attributes[:'end_customer_client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @end_customer_client_id.nil? - invalid_properties.push('invalid value for "end_customer_client_id", end_customer_client_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @end_customer_client_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - end_customer_client_id == o.end_customer_client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, end_customer_client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_customer_remove_response.rb b/lib/plaid/models/partner_customer_remove_response.rb deleted file mode 100644 index d1e615ffa..000000000 --- a/lib/plaid/models/partner_customer_remove_response.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Response schema for `/partner/customer/remove`. - class PartnerCustomerRemoveResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerCustomerRemoveResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerCustomerRemoveResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_end_customer.rb b/lib/plaid/models/partner_end_customer.rb deleted file mode 100644 index 46e6c2a62..000000000 --- a/lib/plaid/models/partner_end_customer.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The details for an end customer. - class PartnerEndCustomer - # The `client_id` of the end customer. - attr_accessor :client_id - - # The company name associated with the end customer. - attr_accessor :company_name - - attr_accessor :status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'company_name' => :'company_name', - :'status' => :'status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'company_name' => :'String', - :'status' => :'PartnerEndCustomerStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerEndCustomer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerEndCustomer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'company_name') - self.company_name = attributes[:'company_name'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - company_name == o.company_name && - status == o.status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, company_name, status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_end_customer_address.rb b/lib/plaid/models/partner_end_customer_address.rb deleted file mode 100644 index 9bfe91747..000000000 --- a/lib/plaid/models/partner_end_customer_address.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The end customer's address. - class PartnerEndCustomerAddress - attr_accessor :city - - attr_accessor :street - - attr_accessor :region - - attr_accessor :postal_code - - # ISO-3166-1 alpha-2 country code standard. - attr_accessor :country_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'street' => :'street', - :'region' => :'region', - :'postal_code' => :'postal_code', - :'country_code' => :'country_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'street' => :'String', - :'region' => :'String', - :'postal_code' => :'String', - :'country_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerEndCustomerAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerEndCustomerAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - street == o.street && - region == o.region && - postal_code == o.postal_code && - country_code == o.country_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, street, region, postal_code, country_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_end_customer_assets_under_management.rb b/lib/plaid/models/partner_end_customer_assets_under_management.rb deleted file mode 100644 index 2943ad94b..000000000 --- a/lib/plaid/models/partner_end_customer_assets_under_management.rb +++ /dev/null @@ -1,239 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Assets under management for the given end customer. Required for end customers with monthly service commitments. - class PartnerEndCustomerAssetsUnderManagement - attr_accessor :amount - - attr_accessor :iso_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Float', - :'iso_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerEndCustomerAssetsUnderManagement` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerEndCustomerAssetsUnderManagement`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amount.nil? - return false if @iso_currency_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - iso_currency_code == o.iso_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, iso_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_end_customer_billing_contact.rb b/lib/plaid/models/partner_end_customer_billing_contact.rb deleted file mode 100644 index 112e3bb36..000000000 --- a/lib/plaid/models/partner_end_customer_billing_contact.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The billing contact for the end customer. Defaults to partner's billing contact if omitted. - class PartnerEndCustomerBillingContact - attr_accessor :given_name - - attr_accessor :family_name - - attr_accessor :email - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'given_name', - :'family_name' => :'family_name', - :'email' => :'email' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String', - :'email' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerEndCustomerBillingContact` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerEndCustomerBillingContact`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name && - email == o.email - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name, email].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_end_customer_customer_support_info.rb b/lib/plaid/models/partner_end_customer_customer_support_info.rb deleted file mode 100644 index b439173cb..000000000 --- a/lib/plaid/models/partner_end_customer_customer_support_info.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # This information is public. Users of your app will see this information when managing connections between your app and their bank accounts in Plaid Portal. Defaults to partner's customer support info if omitted. - class PartnerEndCustomerCustomerSupportInfo - attr_accessor :email - - attr_accessor :phone_number - - attr_accessor :contact_url - - attr_accessor :link_update_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'email' => :'email', - :'phone_number' => :'phone_number', - :'contact_url' => :'contact_url', - :'link_update_url' => :'link_update_url' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'email' => :'String', - :'phone_number' => :'String', - :'contact_url' => :'String', - :'link_update_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerEndCustomerCustomerSupportInfo` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerEndCustomerCustomerSupportInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'contact_url') - self.contact_url = attributes[:'contact_url'] - end - - if attributes.key?(:'link_update_url') - self.link_update_url = attributes[:'link_update_url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - email == o.email && - phone_number == o.phone_number && - contact_url == o.contact_url && - link_update_url == o.link_update_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [email, phone_number, contact_url, link_update_url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_end_customer_flowdown_status.rb b/lib/plaid/models/partner_end_customer_flowdown_status.rb deleted file mode 100644 index b864a6378..000000000 --- a/lib/plaid/models/partner_end_customer_flowdown_status.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PartnerEndCustomerFlowdownStatus - NOT_STARTED = "NOT_STARTED".freeze - IN_REVIEW = "IN_REVIEW".freeze - NEGOTIATION = "NEGOTIATION".freeze - COMPLETE = "COMPLETE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/partner_end_customer_o_auth_institution.rb b/lib/plaid/models/partner_end_customer_o_auth_institution.rb deleted file mode 100644 index 4a5fec43d..000000000 --- a/lib/plaid/models/partner_end_customer_o_auth_institution.rb +++ /dev/null @@ -1,260 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The OAuth registration information for an institution. - class PartnerEndCustomerOAuthInstitution - attr_accessor :name - - attr_accessor :institution_id - - attr_accessor :environments - - # The date on which the end customer's application was approved by the institution, or an empty string if their application has not yet been approved. - attr_accessor :production_enablement_date - - # 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. - attr_accessor :classic_disablement_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'institution_id' => :'institution_id', - :'environments' => :'environments', - :'production_enablement_date' => :'production_enablement_date', - :'classic_disablement_date' => :'classic_disablement_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'institution_id' => :'String', - :'environments' => :'PartnerEndCustomerOAuthInstitutionEnvironments', - :'production_enablement_date' => :'String', - :'classic_disablement_date' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'production_enablement_date', - :'classic_disablement_date' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerEndCustomerOAuthInstitution` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerEndCustomerOAuthInstitution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'environments') - self.environments = attributes[:'environments'] - end - - if attributes.key?(:'production_enablement_date') - self.production_enablement_date = attributes[:'production_enablement_date'] - end - - if attributes.key?(:'classic_disablement_date') - self.classic_disablement_date = attributes[:'classic_disablement_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - institution_id == o.institution_id && - environments == o.environments && - production_enablement_date == o.production_enablement_date && - classic_disablement_date == o.classic_disablement_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, institution_id, environments, production_enablement_date, classic_disablement_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_end_customer_o_auth_institution_application_status.rb b/lib/plaid/models/partner_end_customer_o_auth_institution_application_status.rb deleted file mode 100644 index f993989dc..000000000 --- a/lib/plaid/models/partner_end_customer_o_auth_institution_application_status.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PartnerEndCustomerOAuthInstitutionApplicationStatus - NOT_STARTED = "NOT_STARTED".freeze - PROCESSING = "PROCESSING".freeze - APPROVED = "APPROVED".freeze - ENABLED = "ENABLED".freeze - ATTENTION_REQUIRED = "ATTENTION_REQUIRED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/partner_end_customer_o_auth_institution_environments.rb b/lib/plaid/models/partner_end_customer_o_auth_institution_environments.rb deleted file mode 100644 index dffbddb98..000000000 --- a/lib/plaid/models/partner_end_customer_o_auth_institution_environments.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Registration statuses by environment. - class PartnerEndCustomerOAuthInstitutionEnvironments - attr_accessor :development - - attr_accessor :production - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'development' => :'development', - :'production' => :'production' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'development' => :'PartnerEndCustomerOAuthInstitutionApplicationStatus', - :'production' => :'PartnerEndCustomerOAuthInstitutionApplicationStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerEndCustomerOAuthInstitutionEnvironments` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerEndCustomerOAuthInstitutionEnvironments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'development') - self.development = attributes[:'development'] - end - - if attributes.key?(:'production') - self.production = attributes[:'production'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - development == o.development && - production == o.production - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [development, production].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_end_customer_o_auth_status_updated_values.rb b/lib/plaid/models/partner_end_customer_o_auth_status_updated_values.rb deleted file mode 100644 index ca5d90b90..000000000 --- a/lib/plaid/models/partner_end_customer_o_auth_status_updated_values.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PartnerEndCustomerOAuthStatusUpdatedValues - NOT_STARTED = "not-started".freeze - PROCESSING = "processing".freeze - APPROVED = "approved".freeze - ENABLED = "enabled".freeze - ATTENTION_REQUIRED = "attention-required".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/partner_end_customer_o_auth_status_updated_webhook.rb b/lib/plaid/models/partner_end_customer_o_auth_status_updated_webhook.rb deleted file mode 100644 index 921009bf4..000000000 --- a/lib/plaid/models/partner_end_customer_o_auth_status_updated_webhook.rb +++ /dev/null @@ -1,336 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class PartnerEndCustomerOAuthStatusUpdatedWebhook - # `PARTNER` - attr_accessor :webhook_type - - # `END_CUSTOMER_OAUTH_STATUS_UPDATED` - attr_accessor :webhook_code - - # The client ID of the end customer - attr_accessor :end_customer_client_id - - attr_accessor :environment - - # The institution ID - attr_accessor :institution_id - - # The institution name - attr_accessor :institution_name - - attr_accessor :status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'end_customer_client_id' => :'end_customer_client_id', - :'environment' => :'environment', - :'institution_id' => :'institution_id', - :'institution_name' => :'institution_name', - :'status' => :'status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'end_customer_client_id' => :'String', - :'environment' => :'WebhookEnvironmentValues', - :'institution_id' => :'String', - :'institution_name' => :'String', - :'status' => :'PartnerEndCustomerOAuthStatusUpdatedValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerEndCustomerOAuthStatusUpdatedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerEndCustomerOAuthStatusUpdatedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'end_customer_client_id') - self.end_customer_client_id = attributes[:'end_customer_client_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'institution_name') - self.institution_name = attributes[:'institution_name'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @end_customer_client_id.nil? - invalid_properties.push('invalid value for "end_customer_client_id", end_customer_client_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - if @institution_id.nil? - invalid_properties.push('invalid value for "institution_id", institution_id cannot be nil.') - end - - if @institution_name.nil? - invalid_properties.push('invalid value for "institution_name", institution_name cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @end_customer_client_id.nil? - return false if @environment.nil? - return false if @institution_id.nil? - return false if @institution_name.nil? - return false if @status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - end_customer_client_id == o.end_customer_client_id && - environment == o.environment && - institution_id == o.institution_id && - institution_name == o.institution_name && - status == o.status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, end_customer_client_id, environment, institution_id, institution_name, status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_end_customer_questionnaire_status.rb b/lib/plaid/models/partner_end_customer_questionnaire_status.rb deleted file mode 100644 index 6b76f28d8..000000000 --- a/lib/plaid/models/partner_end_customer_questionnaire_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PartnerEndCustomerQuestionnaireStatus - NOT_STARTED = "NOT_STARTED".freeze - RECEIVED = "RECEIVED".freeze - COMPLETE = "COMPLETE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/partner_end_customer_secrets.rb b/lib/plaid/models/partner_end_customer_secrets.rb deleted file mode 100644 index 76e6ca582..000000000 --- a/lib/plaid/models/partner_end_customer_secrets.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The secrets for the newly created end customer in non-Production environments. - class PartnerEndCustomerSecrets - # The end customer's secret key for the Sandbox environment. - attr_accessor :sandbox - - # The end customer's secret key for the Development environment. - attr_accessor :development - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sandbox' => :'sandbox', - :'development' => :'development' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sandbox' => :'String', - :'development' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerEndCustomerSecrets` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerEndCustomerSecrets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sandbox') - self.sandbox = attributes[:'sandbox'] - end - - if attributes.key?(:'development') - self.development = attributes[:'development'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sandbox == o.sandbox && - development == o.development - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sandbox, development].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_end_customer_status.rb b/lib/plaid/models/partner_end_customer_status.rb deleted file mode 100644 index fbe32c5b8..000000000 --- a/lib/plaid/models/partner_end_customer_status.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PartnerEndCustomerStatus - UNDER_REVIEW = "UNDER_REVIEW".freeze - PENDING_ENABLEMENT = "PENDING_ENABLEMENT".freeze - ACTIVE = "ACTIVE".freeze - DENIED = "DENIED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/partner_end_customer_technical_contact.rb b/lib/plaid/models/partner_end_customer_technical_contact.rb deleted file mode 100644 index 24f267b9d..000000000 --- a/lib/plaid/models/partner_end_customer_technical_contact.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The technical contact for the end customer. Defaults to partner's technical contact if omitted. - class PartnerEndCustomerTechnicalContact - attr_accessor :given_name - - attr_accessor :family_name - - attr_accessor :email - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'given_name' => :'given_name', - :'family_name' => :'family_name', - :'email' => :'email' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'given_name' => :'String', - :'family_name' => :'String', - :'email' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerEndCustomerTechnicalContact` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerEndCustomerTechnicalContact`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - given_name == o.given_name && - family_name == o.family_name && - email == o.email - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [given_name, family_name, email].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_end_customer_with_secrets.rb b/lib/plaid/models/partner_end_customer_with_secrets.rb deleted file mode 100644 index a01edbd98..000000000 --- a/lib/plaid/models/partner_end_customer_with_secrets.rb +++ /dev/null @@ -1,279 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The details for the newly created end customer, including secrets for non-Production environments. - class PartnerEndCustomerWithSecrets - # The `client_id` of the end customer. - attr_accessor :client_id - - # The company name associated with the end customer. - attr_accessor :company_name - - attr_accessor :status - - attr_accessor :secrets - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'company_name' => :'company_name', - :'status' => :'status', - :'secrets' => :'secrets' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'company_name' => :'String', - :'status' => :'PartnerEndCustomerStatus', - :'secrets' => :'PartnerEndCustomerSecrets' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'PartnerEndCustomer', - :'PartnerEndCustomerWithSecretsAllOf' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerEndCustomerWithSecrets` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerEndCustomerWithSecrets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'company_name') - self.company_name = attributes[:'company_name'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'secrets') - self.secrets = attributes[:'secrets'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - company_name == o.company_name && - status == o.status && - secrets == o.secrets - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, company_name, status, secrets].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/partner_end_customer_with_secrets_all_of.rb b/lib/plaid/models/partner_end_customer_with_secrets_all_of.rb deleted file mode 100644 index 713844493..000000000 --- a/lib/plaid/models/partner_end_customer_with_secrets_all_of.rb +++ /dev/null @@ -1,219 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PartnerEndCustomerWithSecretsAllOf - attr_accessor :secrets - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'secrets' => :'secrets' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'secrets' => :'PartnerEndCustomerSecrets' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartnerEndCustomerWithSecretsAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartnerEndCustomerWithSecretsAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'secrets') - self.secrets = attributes[:'secrets'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - secrets == o.secrets - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [secrets].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/party.rb b/lib/plaid/models/party.rb deleted file mode 100644 index 10d247c0f..000000000 --- a/lib/plaid/models/party.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class Party - attr_accessor :individual - - attr_accessor :roles - - attr_accessor :taxpayer_identifiers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'individual' => :'INDIVIDUAL', - :'roles' => :'ROLES', - :'taxpayer_identifiers' => :'TAXPAYER_IDENTIFIERS' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'individual' => :'PartyIndividual', - :'roles' => :'Roles', - :'taxpayer_identifiers' => :'TaxpayerIdentifiers' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Party` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Party`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'individual') - self.individual = attributes[:'individual'] - end - - if attributes.key?(:'roles') - self.roles = attributes[:'roles'] - end - - if attributes.key?(:'taxpayer_identifiers') - self.taxpayer_identifiers = attributes[:'taxpayer_identifiers'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @individual.nil? - invalid_properties.push('invalid value for "individual", individual cannot be nil.') - end - - if @roles.nil? - invalid_properties.push('invalid value for "roles", roles cannot be nil.') - end - - if @taxpayer_identifiers.nil? - invalid_properties.push('invalid value for "taxpayer_identifiers", taxpayer_identifiers cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @individual.nil? - return false if @roles.nil? - return false if @taxpayer_identifiers.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - individual == o.individual && - roles == o.roles && - taxpayer_identifiers == o.taxpayer_identifiers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [individual, roles, taxpayer_identifiers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/party_individual.rb b/lib/plaid/models/party_individual.rb deleted file mode 100644 index f3c04e55c..000000000 --- a/lib/plaid/models/party_individual.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class PartyIndividual - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'NAME' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'IndividualName' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PartyIndividual` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PartyIndividual`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/party_role_type.rb b/lib/plaid/models/party_role_type.rb deleted file mode 100644 index 3f12b0a57..000000000 --- a/lib/plaid/models/party_role_type.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PartyRoleType - BORROWER = "Borrower".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/pay.rb b/lib/plaid/models/pay.rb deleted file mode 100644 index 5503048b0..000000000 --- a/lib/plaid/models/pay.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing a monetary amount. - class Pay - # A numerical amount of a specific currency. - attr_accessor :amount - - # Currency code, e.g. USD - attr_accessor :currency - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'currency' => :'currency' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Float', - :'currency' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'amount', - :'currency' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Pay` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Pay`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'currency') - self.currency = attributes[:'currency'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - currency == o.currency - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, currency].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/pay_frequency.rb b/lib/plaid/models/pay_frequency.rb deleted file mode 100644 index 112d72cf6..000000000 --- a/lib/plaid/models/pay_frequency.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The frequency of the pay period. - class PayFrequency - attr_accessor :value - - attr_accessor :verification_status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'verification_status' => :'verification_status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'PayFrequencyValue', - :'verification_status' => :'VerificationStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PayFrequency` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PayFrequency`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @verification_status.nil? - invalid_properties.push('invalid value for "verification_status", verification_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @value.nil? - return false if @verification_status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - verification_status == o.verification_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, verification_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/pay_frequency_value.rb b/lib/plaid/models/pay_frequency_value.rb deleted file mode 100644 index b9506fdd6..000000000 --- a/lib/plaid/models/pay_frequency_value.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PayFrequencyValue - MONTHLY = "monthly".freeze - SEMIMONTHLY = "semimonthly".freeze - WEEKLY = "weekly".freeze - BIWEEKLY = "biweekly".freeze - UNKNOWN = "unknown".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/pay_period_details.rb b/lib/plaid/models/pay_period_details.rb deleted file mode 100644 index 7b42498d1..000000000 --- a/lib/plaid/models/pay_period_details.rb +++ /dev/null @@ -1,320 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Details about the pay period. - class PayPeriodDetails - # The amount of the paycheck. - attr_accessor :check_amount - - attr_accessor :distribution_breakdown - - # The pay period end date, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format: \"yyyy-mm-dd\". - attr_accessor :end_date - - # Total earnings before tax/deductions. - attr_accessor :gross_earnings - - # The date on which the paystub was issued, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (\"yyyy-mm-dd\"). - attr_accessor :pay_date - - attr_accessor :pay_frequency - - # The date on which the paystub was issued, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (\"yyyy-mm-dd\"). - attr_accessor :pay_day - - # The pay period start date, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format: \"yyyy-mm-dd\". - attr_accessor :start_date - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'check_amount' => :'check_amount', - :'distribution_breakdown' => :'distribution_breakdown', - :'end_date' => :'end_date', - :'gross_earnings' => :'gross_earnings', - :'pay_date' => :'pay_date', - :'pay_frequency' => :'pay_frequency', - :'pay_day' => :'pay_day', - :'start_date' => :'start_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'check_amount' => :'Float', - :'distribution_breakdown' => :'Array', - :'end_date' => :'Date', - :'gross_earnings' => :'Float', - :'pay_date' => :'Date', - :'pay_frequency' => :'PayPeriodDetailsPayFrequency', - :'pay_day' => :'Date', - :'start_date' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'check_amount', - :'end_date', - :'gross_earnings', - :'pay_date', - :'pay_frequency', - :'pay_day', - :'start_date' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PayPeriodDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PayPeriodDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'check_amount') - self.check_amount = attributes[:'check_amount'] - end - - if attributes.key?(:'distribution_breakdown') - if (value = attributes[:'distribution_breakdown']).is_a?(Array) - self.distribution_breakdown = value - end - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'gross_earnings') - self.gross_earnings = attributes[:'gross_earnings'] - end - - if attributes.key?(:'pay_date') - self.pay_date = attributes[:'pay_date'] - end - - if attributes.key?(:'pay_frequency') - self.pay_frequency = attributes[:'pay_frequency'] - end - - if attributes.key?(:'pay_day') - self.pay_day = attributes[:'pay_day'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - check_amount == o.check_amount && - distribution_breakdown == o.distribution_breakdown && - end_date == o.end_date && - gross_earnings == o.gross_earnings && - pay_date == o.pay_date && - pay_frequency == o.pay_frequency && - pay_day == o.pay_day && - start_date == o.start_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [check_amount, distribution_breakdown, end_date, gross_earnings, pay_date, pay_frequency, pay_day, start_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/pay_period_details_pay_frequency.rb b/lib/plaid/models/pay_period_details_pay_frequency.rb deleted file mode 100644 index df34469de..000000000 --- a/lib/plaid/models/pay_period_details_pay_frequency.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PayPeriodDetailsPayFrequency - PAY_FREQUENCY_UNKNOWN = "PAY_FREQUENCY_UNKNOWN".freeze - PAY_FREQUENCY_WEEKLY = "PAY_FREQUENCY_WEEKLY".freeze - PAY_FREQUENCY_BIWEEKLY = "PAY_FREQUENCY_BIWEEKLY".freeze - PAY_FREQUENCY_SEMIMONTHLY = "PAY_FREQUENCY_SEMIMONTHLY".freeze - PAY_FREQUENCY_MONTHLY = "PAY_FREQUENCY_MONTHLY".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/pay_stub_deductions_breakdown.rb b/lib/plaid/models/pay_stub_deductions_breakdown.rb deleted file mode 100644 index e8fc749ff..000000000 --- a/lib/plaid/models/pay_stub_deductions_breakdown.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing the deduction line items for the pay period - class PayStubDeductionsBreakdown - # Raw amount of the deduction - attr_accessor :current_amount - - # Description of the deduction line item - attr_accessor :description - - # The ISO-4217 currency code of the line item. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # The unofficial currency code associated with the line item. 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. - attr_accessor :unofficial_currency_code - - # The year-to-date amount of the deduction - attr_accessor :ytd_amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'current_amount' => :'current_amount', - :'description' => :'description', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'ytd_amount' => :'ytd_amount' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'current_amount' => :'Float', - :'description' => :'String', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'ytd_amount' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'current_amount', - :'description', - :'iso_currency_code', - :'unofficial_currency_code', - :'ytd_amount' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PayStubDeductionsBreakdown` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PayStubDeductionsBreakdown`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'current_amount') - self.current_amount = attributes[:'current_amount'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'ytd_amount') - self.ytd_amount = attributes[:'ytd_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - current_amount == o.current_amount && - description == o.description && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - ytd_amount == o.ytd_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [current_amount, description, iso_currency_code, unofficial_currency_code, ytd_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/pay_stub_deductions_total.rb b/lib/plaid/models/pay_stub_deductions_total.rb deleted file mode 100644 index 18d580fd6..000000000 --- a/lib/plaid/models/pay_stub_deductions_total.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing the total deductions for the pay period - class PayStubDeductionsTotal - # Raw amount of the deduction - attr_accessor :current_amount - - # The ISO-4217 currency code of the line item. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # The unofficial currency code associated with the line item. 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. - attr_accessor :unofficial_currency_code - - # The year-to-date total amount of the deductions - attr_accessor :ytd_amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'current_amount' => :'current_amount', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'ytd_amount' => :'ytd_amount' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'current_amount' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'ytd_amount' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'current_amount', - :'iso_currency_code', - :'unofficial_currency_code', - :'ytd_amount' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PayStubDeductionsTotal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PayStubDeductionsTotal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'current_amount') - self.current_amount = attributes[:'current_amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'ytd_amount') - self.ytd_amount = attributes[:'ytd_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - current_amount == o.current_amount && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - ytd_amount == o.ytd_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [current_amount, iso_currency_code, unofficial_currency_code, ytd_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/pay_stub_distribution_breakdown.rb b/lib/plaid/models/pay_stub_distribution_breakdown.rb deleted file mode 100644 index ac6bff6a0..000000000 --- a/lib/plaid/models/pay_stub_distribution_breakdown.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the accounts that the payment was distributed to. - class PayStubDistributionBreakdown - # Name of the account for the given distribution. - attr_accessor :account_name - - # The name of the bank that the payment is being deposited to. - attr_accessor :bank_name - - # The amount distributed to this account. - attr_accessor :current_amount - - # The ISO-4217 currency code of the net pay. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # The last 2-4 alphanumeric characters of an account's official account number. - attr_accessor :mask - - # Type of the account that the paystub was sent to (e.g. 'checking'). - attr_accessor :type - - # 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. - attr_accessor :unofficial_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_name' => :'account_name', - :'bank_name' => :'bank_name', - :'current_amount' => :'current_amount', - :'iso_currency_code' => :'iso_currency_code', - :'mask' => :'mask', - :'type' => :'type', - :'unofficial_currency_code' => :'unofficial_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_name' => :'String', - :'bank_name' => :'String', - :'current_amount' => :'Float', - :'iso_currency_code' => :'String', - :'mask' => :'String', - :'type' => :'String', - :'unofficial_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_name', - :'bank_name', - :'current_amount', - :'iso_currency_code', - :'mask', - :'type', - :'unofficial_currency_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PayStubDistributionBreakdown` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PayStubDistributionBreakdown`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_name') - self.account_name = attributes[:'account_name'] - end - - if attributes.key?(:'bank_name') - self.bank_name = attributes[:'bank_name'] - end - - if attributes.key?(:'current_amount') - self.current_amount = attributes[:'current_amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'mask') - self.mask = attributes[:'mask'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_name == o.account_name && - bank_name == o.bank_name && - current_amount == o.current_amount && - iso_currency_code == o.iso_currency_code && - mask == o.mask && - type == o.type && - unofficial_currency_code == o.unofficial_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_name, bank_name, current_amount, iso_currency_code, mask, type, unofficial_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/pay_stub_earnings_breakdown.rb b/lib/plaid/models/pay_stub_earnings_breakdown.rb deleted file mode 100644 index 234a72ef5..000000000 --- a/lib/plaid/models/pay_stub_earnings_breakdown.rb +++ /dev/null @@ -1,299 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing the earnings line items for the pay period. - class PayStubEarningsBreakdown - # Commonly used term to describe the earning line item. - attr_accessor :canonical_description - - # Raw amount of the earning line item. - attr_accessor :current_amount - - # Description of the earning line item. - attr_accessor :description - - # Number of hours applicable for this earning. - attr_accessor :hours - - # The ISO-4217 currency code of the line item. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # Hourly rate applicable for this earning. - attr_accessor :rate - - # The unofficial currency code associated with the line item. 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. - attr_accessor :unofficial_currency_code - - # The year-to-date amount of the deduction. - attr_accessor :ytd_amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'canonical_description' => :'canonical_description', - :'current_amount' => :'current_amount', - :'description' => :'description', - :'hours' => :'hours', - :'iso_currency_code' => :'iso_currency_code', - :'rate' => :'rate', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'ytd_amount' => :'ytd_amount' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'canonical_description' => :'String', - :'current_amount' => :'Float', - :'description' => :'String', - :'hours' => :'Float', - :'iso_currency_code' => :'String', - :'rate' => :'Float', - :'unofficial_currency_code' => :'String', - :'ytd_amount' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'canonical_description', - :'current_amount', - :'description', - :'hours', - :'iso_currency_code', - :'rate', - :'unofficial_currency_code', - :'ytd_amount' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PayStubEarningsBreakdown` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PayStubEarningsBreakdown`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'canonical_description') - self.canonical_description = attributes[:'canonical_description'] - end - - if attributes.key?(:'current_amount') - self.current_amount = attributes[:'current_amount'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'hours') - self.hours = attributes[:'hours'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'rate') - self.rate = attributes[:'rate'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'ytd_amount') - self.ytd_amount = attributes[:'ytd_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - canonical_description == o.canonical_description && - current_amount == o.current_amount && - description == o.description && - hours == o.hours && - iso_currency_code == o.iso_currency_code && - rate == o.rate && - unofficial_currency_code == o.unofficial_currency_code && - ytd_amount == o.ytd_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [canonical_description, current_amount, description, hours, iso_currency_code, rate, unofficial_currency_code, ytd_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/pay_stub_earnings_total.rb b/lib/plaid/models/pay_stub_earnings_total.rb deleted file mode 100644 index 8e994e131..000000000 --- a/lib/plaid/models/pay_stub_earnings_total.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing both the current pay period and year to date amount for an earning category. - class PayStubEarningsTotal - # Total amount of the earnings for this pay period. - attr_accessor :current_amount - - # Total number of hours worked for this pay period. - attr_accessor :hours - - # The ISO-4217 currency code of the line item. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # The unofficial currency code associated with the security. 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. - attr_accessor :unofficial_currency_code - - # The total year-to-date amount of the earnings. - attr_accessor :ytd_amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'current_amount' => :'current_amount', - :'hours' => :'hours', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'ytd_amount' => :'ytd_amount' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'current_amount' => :'Float', - :'hours' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'ytd_amount' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'current_amount', - :'hours', - :'iso_currency_code', - :'unofficial_currency_code', - :'ytd_amount' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PayStubEarningsTotal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PayStubEarningsTotal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'current_amount') - self.current_amount = attributes[:'current_amount'] - end - - if attributes.key?(:'hours') - self.hours = attributes[:'hours'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'ytd_amount') - self.ytd_amount = attributes[:'ytd_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - current_amount == o.current_amount && - hours == o.hours && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - ytd_amount == o.ytd_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [current_amount, hours, iso_currency_code, unofficial_currency_code, ytd_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/pay_stub_pay_period_details.rb b/lib/plaid/models/pay_stub_pay_period_details.rb deleted file mode 100644 index 77fed4723..000000000 --- a/lib/plaid/models/pay_stub_pay_period_details.rb +++ /dev/null @@ -1,346 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Details about the pay period. - class PayStubPayPeriodDetails - # The amount of the paycheck. - attr_accessor :pay_amount - - attr_accessor :distribution_breakdown - - # The date on which the pay period ended, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (\"yyyy-mm-dd\"). - attr_accessor :end_date - - # Total earnings before tax/deductions. - attr_accessor :gross_earnings - - # The ISO-4217 currency code of the net pay. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # The date on which the pay stub was issued, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (\"yyyy-mm-dd\"). - attr_accessor :pay_date - - # The frequency at which an individual is paid. - attr_accessor :pay_frequency - - attr_accessor :pay_basis - - # The date on which the pay period started, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (\"yyyy-mm-dd\"). - attr_accessor :start_date - - # 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. - attr_accessor :unofficial_currency_code - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pay_amount' => :'pay_amount', - :'distribution_breakdown' => :'distribution_breakdown', - :'end_date' => :'end_date', - :'gross_earnings' => :'gross_earnings', - :'iso_currency_code' => :'iso_currency_code', - :'pay_date' => :'pay_date', - :'pay_frequency' => :'pay_frequency', - :'pay_basis' => :'pay_basis', - :'start_date' => :'start_date', - :'unofficial_currency_code' => :'unofficial_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pay_amount' => :'Float', - :'distribution_breakdown' => :'Array', - :'end_date' => :'Date', - :'gross_earnings' => :'Float', - :'iso_currency_code' => :'String', - :'pay_date' => :'Date', - :'pay_frequency' => :'String', - :'pay_basis' => :'CreditPayStubPayBasisType', - :'start_date' => :'Date', - :'unofficial_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'pay_amount', - :'end_date', - :'gross_earnings', - :'iso_currency_code', - :'pay_date', - :'pay_frequency', - :'start_date', - :'unofficial_currency_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PayStubPayPeriodDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PayStubPayPeriodDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pay_amount') - self.pay_amount = attributes[:'pay_amount'] - end - - if attributes.key?(:'distribution_breakdown') - if (value = attributes[:'distribution_breakdown']).is_a?(Array) - self.distribution_breakdown = value - end - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'gross_earnings') - self.gross_earnings = attributes[:'gross_earnings'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'pay_date') - self.pay_date = attributes[:'pay_date'] - end - - if attributes.key?(:'pay_frequency') - self.pay_frequency = attributes[:'pay_frequency'] - end - - if attributes.key?(:'pay_basis') - self.pay_basis = attributes[:'pay_basis'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @distribution_breakdown.nil? - invalid_properties.push('invalid value for "distribution_breakdown", distribution_breakdown cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @distribution_breakdown.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pay_amount == o.pay_amount && - distribution_breakdown == o.distribution_breakdown && - end_date == o.end_date && - gross_earnings == o.gross_earnings && - iso_currency_code == o.iso_currency_code && - pay_date == o.pay_date && - pay_frequency == o.pay_frequency && - pay_basis == o.pay_basis && - start_date == o.start_date && - unofficial_currency_code == o.unofficial_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pay_amount, distribution_breakdown, end_date, gross_earnings, iso_currency_code, pay_date, pay_frequency, pay_basis, start_date, unofficial_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/pay_stub_taxpayer_id.rb b/lib/plaid/models/pay_stub_taxpayer_id.rb deleted file mode 100644 index fe80bb593..000000000 --- a/lib/plaid/models/pay_stub_taxpayer_id.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Taxpayer ID of the individual receiving the paystub. - class PayStubTaxpayerID - # Type of ID, e.g. 'SSN'. - attr_accessor :id_type - - # ID mask; i.e. last 4 digits of the taxpayer ID. - attr_accessor :id_mask - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id_type' => :'id_type', - :'id_mask' => :'id_mask' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id_type' => :'String', - :'id_mask' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'id_type', - :'id_mask' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PayStubTaxpayerID` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PayStubTaxpayerID`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id_type') - self.id_type = attributes[:'id_type'] - end - - if attributes.key?(:'id_mask') - self.id_mask = attributes[:'id_mask'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id_type == o.id_type && - id_mask == o.id_mask - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id_type, id_mask].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_amount.rb b/lib/plaid/models/payment_amount.rb deleted file mode 100644 index 20c70ec42..000000000 --- a/lib/plaid/models/payment_amount.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The amount and currency of a payment - class PaymentAmount - attr_accessor :currency - - # The amount of the payment. Must contain at most two digits of precision e.g. `1.23`. Minimum accepted value is `1`. - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency' => :'currency', - :'value' => :'value' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency' => :'PaymentAmountCurrency', - :'value' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentAmount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentAmount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency') - self.currency = attributes[:'currency'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @currency.nil? - invalid_properties.push('invalid value for "currency", currency cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @currency.nil? - return false if @value.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency == o.currency && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_amount_currency.rb b/lib/plaid/models/payment_amount_currency.rb deleted file mode 100644 index d4b7651e6..000000000 --- a/lib/plaid/models/payment_amount_currency.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PaymentAmountCurrency - GBP = "GBP".freeze - EUR = "EUR".freeze - PLN = "PLN".freeze - SEK = "SEK".freeze - DKK = "DKK".freeze - NOK = "NOK".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/payment_amount_nullable.rb b/lib/plaid/models/payment_amount_nullable.rb deleted file mode 100644 index 8b55a673a..000000000 --- a/lib/plaid/models/payment_amount_nullable.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The amount and currency of a payment - class PaymentAmountNullable - attr_accessor :currency - - # The amount of the payment. Must contain at most two digits of precision e.g. `1.23`. - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency' => :'currency', - :'value' => :'value' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency' => :'PaymentAmountCurrency', - :'value' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentAmountNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentAmountNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency') - self.currency = attributes[:'currency'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @currency.nil? - invalid_properties.push('invalid value for "currency", currency cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @value < 0.01 - invalid_properties.push('invalid value for "value", must be greater than or equal to 0.01.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @currency.nil? - return false if @value.nil? - return false if @value < 0.01 - true - end - - # Custom attribute writer method with validation - # @param [Object] value Value to be assigned - def value=(value) - if value.nil? - fail ArgumentError, 'value cannot be nil' - end - - if value < 0.01 - fail ArgumentError, 'invalid value for "value", must be greater than or equal to 0.01.' - end - - - @value = value - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency == o.currency && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_amount_refunded.rb b/lib/plaid/models/payment_amount_refunded.rb deleted file mode 100644 index 9ff35bd9c..000000000 --- a/lib/plaid/models/payment_amount_refunded.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The amount and currency of a payment - class PaymentAmountRefunded - attr_accessor :currency - - # The amount of the payment. Must contain at most two digits of precision e.g. `1.23`. - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency' => :'currency', - :'value' => :'value' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency' => :'PaymentAmountCurrency', - :'value' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'PaymentAmountNullable' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentAmountRefunded` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentAmountRefunded`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency') - self.currency = attributes[:'currency'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @currency.nil? - invalid_properties.push('invalid value for "currency", currency cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @value < 0.01 - invalid_properties.push('invalid value for "value", must be greater than or equal to 0.01.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @currency.nil? - return false if @value.nil? - return false if @value < 0.01 - true - end - - # Custom attribute writer method with validation - # @param [Object] value Value to be assigned - def value=(value) - if value.nil? - fail ArgumentError, 'value cannot be nil' - end - - if value < 0.01 - fail ArgumentError, 'invalid value for "value", must be greater than or equal to 0.01.' - end - - - @value = value - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency == o.currency && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_amount_to_refund.rb b/lib/plaid/models/payment_amount_to_refund.rb deleted file mode 100644 index 302a8b095..000000000 --- a/lib/plaid/models/payment_amount_to_refund.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The amount and currency of a payment - class PaymentAmountToRefund - attr_accessor :currency - - # The amount of the payment. Must contain at most two digits of precision e.g. `1.23`. - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency' => :'currency', - :'value' => :'value' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency' => :'PaymentAmountCurrency', - :'value' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'PaymentAmountNullable' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentAmountToRefund` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentAmountToRefund`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency') - self.currency = attributes[:'currency'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @currency.nil? - invalid_properties.push('invalid value for "currency", currency cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @value < 0.01 - invalid_properties.push('invalid value for "value", must be greater than or equal to 0.01.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @currency.nil? - return false if @value.nil? - return false if @value < 0.01 - true - end - - # Custom attribute writer method with validation - # @param [Object] value Value to be assigned - def value=(value) - if value.nil? - fail ArgumentError, 'value cannot be nil' - end - - if value < 0.01 - fail ArgumentError, 'invalid value for "value", must be greater than or equal to 0.01.' - end - - - @value = value - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency == o.currency && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_channel.rb b/lib/plaid/models/payment_channel.rb deleted file mode 100644 index 865da23ab..000000000 --- a/lib/plaid/models/payment_channel.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PaymentChannel - ONLINE = "online".freeze - IN_STORE = "in store".freeze - OTHER = "other".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/payment_consent_max_payment_amount.rb b/lib/plaid/models/payment_consent_max_payment_amount.rb deleted file mode 100644 index 5b71fa41f..000000000 --- a/lib/plaid/models/payment_consent_max_payment_amount.rb +++ /dev/null @@ -1,269 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Maximum amount of a single payment initiated using the payment consent. - class PaymentConsentMaxPaymentAmount - attr_accessor :currency - - # The amount of the payment. Must contain at most two digits of precision e.g. `1.23`. Minimum accepted value is `1`. - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency' => :'currency', - :'value' => :'value' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency' => :'PaymentAmountCurrency', - :'value' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'PaymentAmount' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentConsentMaxPaymentAmount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentConsentMaxPaymentAmount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency') - self.currency = attributes[:'currency'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @currency.nil? - invalid_properties.push('invalid value for "currency", currency cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @currency.nil? - return false if @value.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency == o.currency && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_consent_periodic_alignment.rb b/lib/plaid/models/payment_consent_periodic_alignment.rb deleted file mode 100644 index c1eee8c5a..000000000 --- a/lib/plaid/models/payment_consent_periodic_alignment.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PaymentConsentPeriodicAlignment - CALENDAR = "CALENDAR".freeze - CONSENT = "CONSENT".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/payment_consent_periodic_amount.rb b/lib/plaid/models/payment_consent_periodic_amount.rb deleted file mode 100644 index 0010e3bfc..000000000 --- a/lib/plaid/models/payment_consent_periodic_amount.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines consent payments limitations per period. - class PaymentConsentPeriodicAmount - attr_accessor :amount - - attr_accessor :interval - - attr_accessor :alignment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'interval' => :'interval', - :'alignment' => :'alignment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'PaymentConsentPeriodicAmountAmount', - :'interval' => :'PaymentConsentPeriodicInterval', - :'alignment' => :'PaymentConsentPeriodicAlignment' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentConsentPeriodicAmount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentConsentPeriodicAmount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'interval') - self.interval = attributes[:'interval'] - end - - if attributes.key?(:'alignment') - self.alignment = attributes[:'alignment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @interval.nil? - invalid_properties.push('invalid value for "interval", interval cannot be nil.') - end - - if @alignment.nil? - invalid_properties.push('invalid value for "alignment", alignment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amount.nil? - return false if @interval.nil? - return false if @alignment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - interval == o.interval && - alignment == o.alignment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, interval, alignment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_consent_periodic_amount_amount.rb b/lib/plaid/models/payment_consent_periodic_amount_amount.rb deleted file mode 100644 index 82ada9a17..000000000 --- a/lib/plaid/models/payment_consent_periodic_amount_amount.rb +++ /dev/null @@ -1,269 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Maximum cumulative amount for all payments in the specified interval. - class PaymentConsentPeriodicAmountAmount - attr_accessor :currency - - # The amount of the payment. Must contain at most two digits of precision e.g. `1.23`. Minimum accepted value is `1`. - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currency' => :'currency', - :'value' => :'value' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'currency' => :'PaymentAmountCurrency', - :'value' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'PaymentAmount' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentConsentPeriodicAmountAmount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentConsentPeriodicAmountAmount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currency') - self.currency = attributes[:'currency'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @currency.nil? - invalid_properties.push('invalid value for "currency", currency cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @currency.nil? - return false if @value.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currency == o.currency && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currency, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_consent_periodic_interval.rb b/lib/plaid/models/payment_consent_periodic_interval.rb deleted file mode 100644 index 3b4e8284f..000000000 --- a/lib/plaid/models/payment_consent_periodic_interval.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PaymentConsentPeriodicInterval - DAY = "DAY".freeze - WEEK = "WEEK".freeze - MONTH = "MONTH".freeze - YEAR = "YEAR".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/payment_consent_valid_date_time.rb b/lib/plaid/models/payment_consent_valid_date_time.rb deleted file mode 100644 index bfa7bb289..000000000 --- a/lib/plaid/models/payment_consent_valid_date_time.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Life span for the payment consent. After the `to` date the payment consent expires and can no longer be used for payment initiation. - class PaymentConsentValidDateTime - # The date and time from which the consent should be active, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :from - - # The date and time at which the consent expires, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :to - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'from' => :'from', - :'to' => :'to' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'from' => :'Time', - :'to' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'from', - :'to' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentConsentValidDateTime` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentConsentValidDateTime`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'from') - self.from = attributes[:'from'] - end - - if attributes.key?(:'to') - self.to = attributes[:'to'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - from == o.from && - to == o.to - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [from, to].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_address.rb b/lib/plaid/models/payment_initiation_address.rb deleted file mode 100644 index e5fd59145..000000000 --- a/lib/plaid/models/payment_initiation_address.rb +++ /dev/null @@ -1,384 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The optional address of the payment recipient's bank account. Required by most institutions outside of the UK. - class PaymentInitiationAddress - # An array of length 1-2 representing the street address where the recipient is located. Maximum of 70 characters. - attr_accessor :street - - # The city where the recipient is located. Maximum of 35 characters. - attr_accessor :city - - # The postal code where the recipient is located. Maximum of 16 characters. - attr_accessor :postal_code - - # The ISO 3166-1 alpha-2 country code where the recipient is located. - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'street' => :'street', - :'city' => :'city', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'street' => :'Array', - :'city' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'street') - if (value = attributes[:'street']).is_a?(Array) - self.street = value - end - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @street.nil? - invalid_properties.push('invalid value for "street", street cannot be nil.') - end - - - if @street.length < 1 - invalid_properties.push('invalid value for "street", number of items must be greater than or equal to 1.') - end - - if @city.nil? - invalid_properties.push('invalid value for "city", city cannot be nil.') - end - - if @city.to_s.length > 35 - invalid_properties.push('invalid value for "city", the character length must be smaller than or equal to 35.') - end - - if @city.to_s.length < 1 - invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.') - end - - - if @postal_code.nil? - invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.') - end - - if @postal_code.to_s.length > 16 - invalid_properties.push('invalid value for "postal_code", the character length must be smaller than or equal to 16.') - end - - if @postal_code.to_s.length < 1 - invalid_properties.push('invalid value for "postal_code", the character length must be great than or equal to 1.') - end - - - if @country.nil? - invalid_properties.push('invalid value for "country", country cannot be nil.') - end - - if @country.to_s.length > 2 - invalid_properties.push('invalid value for "country", the character length must be smaller than or equal to 2.') - end - - if @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @street.nil? - return false if @street.length < 1 - return false if @city.nil? - return false if @city.to_s.length > 35 - return false if @city.to_s.length < 1 - return false if @postal_code.nil? - return false if @postal_code.to_s.length > 16 - return false if @postal_code.to_s.length < 1 - return false if @country.nil? - return false if @country.to_s.length > 2 - return false if @country.to_s.length < 2 - true - end - - # Custom attribute writer method with validation - # @param [Object] street Value to be assigned - def street=(street) - if street.nil? - fail ArgumentError, 'street cannot be nil' - end - - - if street.length < 1 - fail ArgumentError, 'invalid value for "street", number of items must be greater than or equal to 1.' - end - - @street = street - end - - # Custom attribute writer method with validation - # @param [Object] city Value to be assigned - def city=(city) - if city.nil? - fail ArgumentError, 'city cannot be nil' - end - - if city.to_s.length > 35 - fail ArgumentError, 'invalid value for "city", the character length must be smaller than or equal to 35.' - end - - if city.to_s.length < 1 - fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.' - end - - - @city = city - end - - # Custom attribute writer method with validation - # @param [Object] postal_code Value to be assigned - def postal_code=(postal_code) - if postal_code.nil? - fail ArgumentError, 'postal_code cannot be nil' - end - - if postal_code.to_s.length > 16 - fail ArgumentError, 'invalid value for "postal_code", the character length must be smaller than or equal to 16.' - end - - if postal_code.to_s.length < 1 - fail ArgumentError, 'invalid value for "postal_code", the character length must be great than or equal to 1.' - end - - - @postal_code = postal_code - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if country.nil? - fail ArgumentError, 'country cannot be nil' - end - - if country.to_s.length > 2 - fail ArgumentError, 'invalid value for "country", the character length must be smaller than or equal to 2.' - end - - if country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - street == o.street && - city == o.city && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [street, city, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_consent.rb b/lib/plaid/models/payment_initiation_consent.rb deleted file mode 100644 index fa65ed8e7..000000000 --- a/lib/plaid/models/payment_initiation_consent.rb +++ /dev/null @@ -1,380 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationConsent defines a payment initiation consent. - class PaymentInitiationConsent - # The consent ID. - attr_accessor :consent_id - - attr_accessor :status - - # Consent creation timestamp, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :created_at - - # The ID of the recipient the payment consent is for. - attr_accessor :recipient_id - - # A reference for the payment consent. - attr_accessor :reference - - attr_accessor :constraints - - # An array of payment consent scopes. - attr_accessor :scopes - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'consent_id' => :'consent_id', - :'status' => :'status', - :'created_at' => :'created_at', - :'recipient_id' => :'recipient_id', - :'reference' => :'reference', - :'constraints' => :'constraints', - :'scopes' => :'scopes' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'consent_id' => :'String', - :'status' => :'PaymentInitiationConsentStatus', - :'created_at' => :'Time', - :'recipient_id' => :'String', - :'reference' => :'String', - :'constraints' => :'PaymentInitiationConsentConstraints', - :'scopes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationConsent` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationConsent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'consent_id') - self.consent_id = attributes[:'consent_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'recipient_id') - self.recipient_id = attributes[:'recipient_id'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'constraints') - self.constraints = attributes[:'constraints'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @consent_id.nil? - invalid_properties.push('invalid value for "consent_id", consent_id cannot be nil.') - end - - if @consent_id.to_s.length < 1 - invalid_properties.push('invalid value for "consent_id", the character length must be great than or equal to 1.') - end - - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @recipient_id.nil? - invalid_properties.push('invalid value for "recipient_id", recipient_id cannot be nil.') - end - - if @recipient_id.to_s.length < 1 - invalid_properties.push('invalid value for "recipient_id", the character length must be great than or equal to 1.') - end - - - if @reference.nil? - invalid_properties.push('invalid value for "reference", reference cannot be nil.') - end - - if @constraints.nil? - invalid_properties.push('invalid value for "constraints", constraints cannot be nil.') - end - - if @scopes.nil? - invalid_properties.push('invalid value for "scopes", scopes cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @consent_id.nil? - return false if @consent_id.to_s.length < 1 - return false if @status.nil? - return false if @created_at.nil? - return false if @recipient_id.nil? - return false if @recipient_id.to_s.length < 1 - return false if @reference.nil? - return false if @constraints.nil? - return false if @scopes.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] consent_id Value to be assigned - def consent_id=(consent_id) - if consent_id.nil? - fail ArgumentError, 'consent_id cannot be nil' - end - - if consent_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "consent_id", the character length must be great than or equal to 1.' - end - - - @consent_id = consent_id - end - - # Custom attribute writer method with validation - # @param [Object] recipient_id Value to be assigned - def recipient_id=(recipient_id) - if recipient_id.nil? - fail ArgumentError, 'recipient_id cannot be nil' - end - - if recipient_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "recipient_id", the character length must be great than or equal to 1.' - end - - - @recipient_id = recipient_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - consent_id == o.consent_id && - status == o.status && - created_at == o.created_at && - recipient_id == o.recipient_id && - reference == o.reference && - constraints == o.constraints && - scopes == o.scopes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [consent_id, status, created_at, recipient_id, reference, constraints, scopes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_consent_constraints.rb b/lib/plaid/models/payment_initiation_consent_constraints.rb deleted file mode 100644 index dda50dd25..000000000 --- a/lib/plaid/models/payment_initiation_consent_constraints.rb +++ /dev/null @@ -1,273 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Limitations that will be applied to payments initiated using the payment consent. - class PaymentInitiationConsentConstraints - attr_accessor :valid_date_time - - attr_accessor :max_payment_amount - - # A list of amount limitations per period of time. - attr_accessor :periodic_amounts - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'valid_date_time' => :'valid_date_time', - :'max_payment_amount' => :'max_payment_amount', - :'periodic_amounts' => :'periodic_amounts' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'valid_date_time' => :'PaymentConsentValidDateTime', - :'max_payment_amount' => :'PaymentConsentMaxPaymentAmount', - :'periodic_amounts' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'valid_date_time', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationConsentConstraints` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationConsentConstraints`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'valid_date_time') - self.valid_date_time = attributes[:'valid_date_time'] - end - - if attributes.key?(:'max_payment_amount') - self.max_payment_amount = attributes[:'max_payment_amount'] - end - - if attributes.key?(:'periodic_amounts') - if (value = attributes[:'periodic_amounts']).is_a?(Array) - self.periodic_amounts = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @max_payment_amount.nil? - invalid_properties.push('invalid value for "max_payment_amount", max_payment_amount cannot be nil.') - end - - if @periodic_amounts.nil? - invalid_properties.push('invalid value for "periodic_amounts", periodic_amounts cannot be nil.') - end - - - if @periodic_amounts.length < 1 - invalid_properties.push('invalid value for "periodic_amounts", number of items must be greater than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @max_payment_amount.nil? - return false if @periodic_amounts.nil? - return false if @periodic_amounts.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] periodic_amounts Value to be assigned - def periodic_amounts=(periodic_amounts) - if periodic_amounts.nil? - fail ArgumentError, 'periodic_amounts cannot be nil' - end - - - if periodic_amounts.length < 1 - fail ArgumentError, 'invalid value for "periodic_amounts", number of items must be greater than or equal to 1.' - end - - @periodic_amounts = periodic_amounts - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - valid_date_time == o.valid_date_time && - max_payment_amount == o.max_payment_amount && - periodic_amounts == o.periodic_amounts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [valid_date_time, max_payment_amount, periodic_amounts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_consent_create_request.rb b/lib/plaid/models/payment_initiation_consent_create_request.rb deleted file mode 100644 index ef6e89461..000000000 --- a/lib/plaid/models/payment_initiation_consent_create_request.rb +++ /dev/null @@ -1,353 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationConsentCreateRequest defines the request schema for `/payment_initiation/consent/create` - class PaymentInitiationConsentCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the recipient the payment consent is for. The created consent can be used to transfer funds to this recipient only. - attr_accessor :recipient_id - - # A reference for the payment consent. This must be an alphanumeric string with at most 18 characters and must not contain any special characters. - attr_accessor :reference - - # An array of payment consent scopes. - attr_accessor :scopes - - attr_accessor :constraints - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'recipient_id' => :'recipient_id', - :'reference' => :'reference', - :'scopes' => :'scopes', - :'constraints' => :'constraints', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'recipient_id' => :'String', - :'reference' => :'String', - :'scopes' => :'Array', - :'constraints' => :'PaymentInitiationConsentConstraints', - :'options' => :'ExternalPaymentInitiationConsentOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'options' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationConsentCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationConsentCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'recipient_id') - self.recipient_id = attributes[:'recipient_id'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - - if attributes.key?(:'constraints') - self.constraints = attributes[:'constraints'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @recipient_id.nil? - invalid_properties.push('invalid value for "recipient_id", recipient_id cannot be nil.') - end - - if @reference.nil? - invalid_properties.push('invalid value for "reference", reference cannot be nil.') - end - - if @reference.to_s.length > 18 - invalid_properties.push('invalid value for "reference", the character length must be smaller than or equal to 18.') - end - - if @reference.to_s.length < 1 - invalid_properties.push('invalid value for "reference", the character length must be great than or equal to 1.') - end - - - if @scopes.nil? - invalid_properties.push('invalid value for "scopes", scopes cannot be nil.') - end - - - if @scopes.length < 1 - invalid_properties.push('invalid value for "scopes", number of items must be greater than or equal to 1.') - end - - if @constraints.nil? - invalid_properties.push('invalid value for "constraints", constraints cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @recipient_id.nil? - return false if @reference.nil? - return false if @reference.to_s.length > 18 - return false if @reference.to_s.length < 1 - return false if @scopes.nil? - return false if @scopes.length < 1 - return false if @constraints.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] reference Value to be assigned - def reference=(reference) - if reference.nil? - fail ArgumentError, 'reference cannot be nil' - end - - if reference.to_s.length > 18 - fail ArgumentError, 'invalid value for "reference", the character length must be smaller than or equal to 18.' - end - - if reference.to_s.length < 1 - fail ArgumentError, 'invalid value for "reference", the character length must be great than or equal to 1.' - end - - - @reference = reference - end - - # Custom attribute writer method with validation - # @param [Object] scopes Value to be assigned - def scopes=(scopes) - if scopes.nil? - fail ArgumentError, 'scopes cannot be nil' - end - - - if scopes.length < 1 - fail ArgumentError, 'invalid value for "scopes", number of items must be greater than or equal to 1.' - end - - @scopes = scopes - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - recipient_id == o.recipient_id && - reference == o.reference && - scopes == o.scopes && - constraints == o.constraints && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, recipient_id, reference, scopes, constraints, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_consent_create_response.rb b/lib/plaid/models/payment_initiation_consent_create_response.rb deleted file mode 100644 index 8a4b2979b..000000000 --- a/lib/plaid/models/payment_initiation_consent_create_response.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationConsentCreateResponse defines the response schema for `/payment_initiation/consent/create` - class PaymentInitiationConsentCreateResponse - # A unique ID identifying the payment consent. - attr_accessor :consent_id - - attr_accessor :status - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'consent_id' => :'consent_id', - :'status' => :'status', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'consent_id' => :'String', - :'status' => :'PaymentInitiationConsentStatus', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationConsentCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationConsentCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'consent_id') - self.consent_id = attributes[:'consent_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @consent_id.nil? - invalid_properties.push('invalid value for "consent_id", consent_id cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @consent_id.nil? - return false if @status.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - consent_id == o.consent_id && - status == o.status && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [consent_id, status, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_consent_get_request.rb b/lib/plaid/models/payment_initiation_consent_get_request.rb deleted file mode 100644 index 46302f452..000000000 --- a/lib/plaid/models/payment_initiation_consent_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationConsentGetRequest defines the request schema for `/payment_initiation/consent/get` - class PaymentInitiationConsentGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The `consent_id` returned from `/payment_initiation/consent/create`. - attr_accessor :consent_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'consent_id' => :'consent_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'consent_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationConsentGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationConsentGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'consent_id') - self.consent_id = attributes[:'consent_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @consent_id.nil? - invalid_properties.push('invalid value for "consent_id", consent_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @consent_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - consent_id == o.consent_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, consent_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_consent_get_response.rb b/lib/plaid/models/payment_initiation_consent_get_response.rb deleted file mode 100644 index 22f96ba8a..000000000 --- a/lib/plaid/models/payment_initiation_consent_get_response.rb +++ /dev/null @@ -1,403 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationConsentGetResponse defines the response schema for `/payment_initation/consent/get` - class PaymentInitiationConsentGetResponse - # The consent ID. - attr_accessor :consent_id - - attr_accessor :status - - # Consent creation timestamp, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :created_at - - # The ID of the recipient the payment consent is for. - attr_accessor :recipient_id - - # A reference for the payment consent. - attr_accessor :reference - - attr_accessor :constraints - - # An array of payment consent scopes. - attr_accessor :scopes - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'consent_id' => :'consent_id', - :'status' => :'status', - :'created_at' => :'created_at', - :'recipient_id' => :'recipient_id', - :'reference' => :'reference', - :'constraints' => :'constraints', - :'scopes' => :'scopes', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'consent_id' => :'String', - :'status' => :'PaymentInitiationConsentStatus', - :'created_at' => :'Time', - :'recipient_id' => :'String', - :'reference' => :'String', - :'constraints' => :'PaymentInitiationConsentConstraints', - :'scopes' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'PaymentInitiationConsent', - :'PaymentInitiationRecipientGetResponseAllOf' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationConsentGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationConsentGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'consent_id') - self.consent_id = attributes[:'consent_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'recipient_id') - self.recipient_id = attributes[:'recipient_id'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'constraints') - self.constraints = attributes[:'constraints'] - end - - if attributes.key?(:'scopes') - if (value = attributes[:'scopes']).is_a?(Array) - self.scopes = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @consent_id.nil? - invalid_properties.push('invalid value for "consent_id", consent_id cannot be nil.') - end - - if @consent_id.to_s.length < 1 - invalid_properties.push('invalid value for "consent_id", the character length must be great than or equal to 1.') - end - - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @recipient_id.nil? - invalid_properties.push('invalid value for "recipient_id", recipient_id cannot be nil.') - end - - if @recipient_id.to_s.length < 1 - invalid_properties.push('invalid value for "recipient_id", the character length must be great than or equal to 1.') - end - - - if @reference.nil? - invalid_properties.push('invalid value for "reference", reference cannot be nil.') - end - - if @constraints.nil? - invalid_properties.push('invalid value for "constraints", constraints cannot be nil.') - end - - if @scopes.nil? - invalid_properties.push('invalid value for "scopes", scopes cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @consent_id.nil? - return false if @consent_id.to_s.length < 1 - return false if @status.nil? - return false if @created_at.nil? - return false if @recipient_id.nil? - return false if @recipient_id.to_s.length < 1 - return false if @reference.nil? - return false if @constraints.nil? - return false if @scopes.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] consent_id Value to be assigned - def consent_id=(consent_id) - if consent_id.nil? - fail ArgumentError, 'consent_id cannot be nil' - end - - if consent_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "consent_id", the character length must be great than or equal to 1.' - end - - - @consent_id = consent_id - end - - # Custom attribute writer method with validation - # @param [Object] recipient_id Value to be assigned - def recipient_id=(recipient_id) - if recipient_id.nil? - fail ArgumentError, 'recipient_id cannot be nil' - end - - if recipient_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "recipient_id", the character length must be great than or equal to 1.' - end - - - @recipient_id = recipient_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - consent_id == o.consent_id && - status == o.status && - created_at == o.created_at && - recipient_id == o.recipient_id && - reference == o.reference && - constraints == o.constraints && - scopes == o.scopes && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [consent_id, status, created_at, recipient_id, reference, constraints, scopes, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_consent_payment_execute_request.rb b/lib/plaid/models/payment_initiation_consent_payment_execute_request.rb deleted file mode 100644 index 8e24b3ad2..000000000 --- a/lib/plaid/models/payment_initiation_consent_payment_execute_request.rb +++ /dev/null @@ -1,351 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationConsentPaymentExecuteRequest defines the request schema for `/payment_initiation/consent/payment/execute` - class PaymentInitiationConsentPaymentExecuteRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The consent ID. - attr_accessor :consent_id - - attr_accessor :amount - - # A random key provided by the client, per unique consent payment. Maximum of 128 characters. The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. If a request to execute a consent payment fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single payment is created. If the request was successfully processed, it will prevent any payment that uses the same idempotency key, and was received within 24 hours of the first request, from being processed. - attr_accessor :idempotency_key - - # A reference for the payment. This must be an alphanumeric string with at most 18 characters and must not contain any special characters (since not all institutions support them). If not provided, Plaid will automatically fall back to the reference from consent. In order to track settlement via Payment Confirmation, each payment must have a unique reference. If the reference provided through the API is not unique, Plaid will adjust it. Some institutions may limit the reference to less than 18 characters. If necessary, Plaid will adjust the reference by truncating it to fit the institution's requirements. Both the originally provided and automatically adjusted references (if any) can be found in the `reference` and `adjusted_reference` fields, respectively. - attr_accessor :reference - - attr_accessor :scope - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'consent_id' => :'consent_id', - :'amount' => :'amount', - :'idempotency_key' => :'idempotency_key', - :'reference' => :'reference', - :'scope' => :'scope' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'consent_id' => :'String', - :'amount' => :'PaymentAmount', - :'idempotency_key' => :'String', - :'reference' => :'String', - :'scope' => :'PaymentInitiationConsentScope' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'reference', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationConsentPaymentExecuteRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationConsentPaymentExecuteRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'consent_id') - self.consent_id = attributes[:'consent_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'idempotency_key') - self.idempotency_key = attributes[:'idempotency_key'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'scope') - self.scope = attributes[:'scope'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @consent_id.nil? - invalid_properties.push('invalid value for "consent_id", consent_id cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @idempotency_key.nil? - invalid_properties.push('invalid value for "idempotency_key", idempotency_key cannot be nil.') - end - - if @idempotency_key.to_s.length > 128 - invalid_properties.push('invalid value for "idempotency_key", the character length must be smaller than or equal to 128.') - end - - if @idempotency_key.to_s.length < 1 - invalid_properties.push('invalid value for "idempotency_key", the character length must be great than or equal to 1.') - end - - - if !@reference.nil? && @reference.to_s.length > 18 - invalid_properties.push('invalid value for "reference", the character length must be smaller than or equal to 18.') - end - - if !@reference.nil? && @reference.to_s.length < 1 - invalid_properties.push('invalid value for "reference", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @consent_id.nil? - return false if @amount.nil? - return false if @idempotency_key.nil? - return false if @idempotency_key.to_s.length > 128 - return false if @idempotency_key.to_s.length < 1 - return false if !@reference.nil? && @reference.to_s.length > 18 - return false if !@reference.nil? && @reference.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] idempotency_key Value to be assigned - def idempotency_key=(idempotency_key) - if idempotency_key.nil? - fail ArgumentError, 'idempotency_key cannot be nil' - end - - if idempotency_key.to_s.length > 128 - fail ArgumentError, 'invalid value for "idempotency_key", the character length must be smaller than or equal to 128.' - end - - if idempotency_key.to_s.length < 1 - fail ArgumentError, 'invalid value for "idempotency_key", the character length must be great than or equal to 1.' - end - - - @idempotency_key = idempotency_key - end - - # Custom attribute writer method with validation - # @param [Object] reference Value to be assigned - def reference=(reference) - if !reference.nil? && reference.to_s.length > 18 - fail ArgumentError, 'invalid value for "reference", the character length must be smaller than or equal to 18.' - end - - if !reference.nil? && reference.to_s.length < 1 - fail ArgumentError, 'invalid value for "reference", the character length must be great than or equal to 1.' - end - - - @reference = reference - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - consent_id == o.consent_id && - amount == o.amount && - idempotency_key == o.idempotency_key && - reference == o.reference && - scope == o.scope - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, consent_id, amount, idempotency_key, reference, scope].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_consent_payment_execute_response.rb b/lib/plaid/models/payment_initiation_consent_payment_execute_response.rb deleted file mode 100644 index 94065eff6..000000000 --- a/lib/plaid/models/payment_initiation_consent_payment_execute_response.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationConsentPaymentExecuteResponse defines the response schema for `/payment_initiation/consent/payment/execute` - class PaymentInitiationConsentPaymentExecuteResponse - # A unique ID identifying the payment - attr_accessor :payment_id - - attr_accessor :status - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payment_id' => :'payment_id', - :'status' => :'status', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'payment_id' => :'String', - :'status' => :'PaymentInitiationPaymentStatus', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationConsentPaymentExecuteResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationConsentPaymentExecuteResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payment_id') - self.payment_id = attributes[:'payment_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment_id.nil? - invalid_properties.push('invalid value for "payment_id", payment_id cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment_id.nil? - return false if @status.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payment_id == o.payment_id && - status == o.status && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payment_id, status, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_consent_revoke_request.rb b/lib/plaid/models/payment_initiation_consent_revoke_request.rb deleted file mode 100644 index cace5f17a..000000000 --- a/lib/plaid/models/payment_initiation_consent_revoke_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationConsentRevokeRequest defines the request schema for `/payment_initiation/consent/revoke` - class PaymentInitiationConsentRevokeRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The consent ID. - attr_accessor :consent_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'consent_id' => :'consent_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'consent_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationConsentRevokeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationConsentRevokeRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'consent_id') - self.consent_id = attributes[:'consent_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @consent_id.nil? - invalid_properties.push('invalid value for "consent_id", consent_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @consent_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - consent_id == o.consent_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, consent_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_consent_revoke_response.rb b/lib/plaid/models/payment_initiation_consent_revoke_response.rb deleted file mode 100644 index 5267c567c..000000000 --- a/lib/plaid/models/payment_initiation_consent_revoke_response.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationConsentRevokeResponse defines the response schema for `/payment_initation/consent/revoke` - class PaymentInitiationConsentRevokeResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationConsentRevokeResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationConsentRevokeResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_consent_scope.rb b/lib/plaid/models/payment_initiation_consent_scope.rb deleted file mode 100644 index 96533b52a..000000000 --- a/lib/plaid/models/payment_initiation_consent_scope.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PaymentInitiationConsentScope - ME_TO_ME = "ME_TO_ME".freeze - EXTERNAL = "EXTERNAL".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/payment_initiation_consent_status.rb b/lib/plaid/models/payment_initiation_consent_status.rb deleted file mode 100644 index e7d3b1ca4..000000000 --- a/lib/plaid/models/payment_initiation_consent_status.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PaymentInitiationConsentStatus - UNAUTHORISED = "UNAUTHORISED".freeze - AUTHORISED = "AUTHORISED".freeze - REVOKED = "REVOKED".freeze - REJECTED = "REJECTED".freeze - EXPIRED = "EXPIRED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/payment_initiation_metadata.rb b/lib/plaid/models/payment_initiation_metadata.rb deleted file mode 100644 index 1170c30e3..000000000 --- a/lib/plaid/models/payment_initiation_metadata.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Metadata that captures what specific payment configurations an institution supports when making Payment Initiation requests. - class PaymentInitiationMetadata - # Indicates whether the institution supports payments from a different country. - attr_accessor :supports_international_payments - - # Indicates whether the institution supports SEPA Instant payments. - attr_accessor :supports_sepa_instant - - # A mapping of currency to maximum payment amount (denominated in the smallest unit of currency) supported by the institution. Example: `{\"GBP\": \"10000\"}` - attr_accessor :maximum_payment_amount - - # Indicates whether the institution supports returning refund details when initiating a payment. - attr_accessor :supports_refund_details - - attr_accessor :standing_order_metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'supports_international_payments' => :'supports_international_payments', - :'supports_sepa_instant' => :'supports_sepa_instant', - :'maximum_payment_amount' => :'maximum_payment_amount', - :'supports_refund_details' => :'supports_refund_details', - :'standing_order_metadata' => :'standing_order_metadata' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'supports_international_payments' => :'Boolean', - :'supports_sepa_instant' => :'Boolean', - :'maximum_payment_amount' => :'Hash', - :'supports_refund_details' => :'Boolean', - :'standing_order_metadata' => :'PaymentInitiationStandingOrderMetadata' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'standing_order_metadata' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'supports_international_payments') - self.supports_international_payments = attributes[:'supports_international_payments'] - end - - if attributes.key?(:'supports_sepa_instant') - self.supports_sepa_instant = attributes[:'supports_sepa_instant'] - end - - if attributes.key?(:'maximum_payment_amount') - if (value = attributes[:'maximum_payment_amount']).is_a?(Hash) - self.maximum_payment_amount = value - end - end - - if attributes.key?(:'supports_refund_details') - self.supports_refund_details = attributes[:'supports_refund_details'] - end - - if attributes.key?(:'standing_order_metadata') - self.standing_order_metadata = attributes[:'standing_order_metadata'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @supports_international_payments.nil? - invalid_properties.push('invalid value for "supports_international_payments", supports_international_payments cannot be nil.') - end - - if @supports_sepa_instant.nil? - invalid_properties.push('invalid value for "supports_sepa_instant", supports_sepa_instant cannot be nil.') - end - - if @maximum_payment_amount.nil? - invalid_properties.push('invalid value for "maximum_payment_amount", maximum_payment_amount cannot be nil.') - end - - if @supports_refund_details.nil? - invalid_properties.push('invalid value for "supports_refund_details", supports_refund_details cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @supports_international_payments.nil? - return false if @supports_sepa_instant.nil? - return false if @maximum_payment_amount.nil? - return false if @supports_refund_details.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - supports_international_payments == o.supports_international_payments && - supports_sepa_instant == o.supports_sepa_instant && - maximum_payment_amount == o.maximum_payment_amount && - supports_refund_details == o.supports_refund_details && - standing_order_metadata == o.standing_order_metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [supports_international_payments, supports_sepa_instant, maximum_payment_amount, supports_refund_details, standing_order_metadata].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_optional_restriction_bacs.rb b/lib/plaid/models/payment_initiation_optional_restriction_bacs.rb deleted file mode 100644 index 63626e5bb..000000000 --- a/lib/plaid/models/payment_initiation_optional_restriction_bacs.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class PaymentInitiationOptionalRestrictionBacs - # The account number of the account. Maximum of 10 characters. - attr_accessor :account - - # The 6-character sort code of the account. - attr_accessor :sort_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account' => :'account', - :'sort_code' => :'sort_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account' => :'String', - :'sort_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'RecipientBACS' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationOptionalRestrictionBacs` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationOptionalRestrictionBacs`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'sort_code') - self.sort_code = attributes[:'sort_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@account.nil? && @account.to_s.length > 10 - invalid_properties.push('invalid value for "account", the character length must be smaller than or equal to 10.') - end - - if !@account.nil? && @account.to_s.length < 1 - invalid_properties.push('invalid value for "account", the character length must be great than or equal to 1.') - end - - - if !@sort_code.nil? && @sort_code.to_s.length > 6 - invalid_properties.push('invalid value for "sort_code", the character length must be smaller than or equal to 6.') - end - - if !@sort_code.nil? && @sort_code.to_s.length < 6 - invalid_properties.push('invalid value for "sort_code", the character length must be great than or equal to 6.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@account.nil? && @account.to_s.length > 10 - return false if !@account.nil? && @account.to_s.length < 1 - return false if !@sort_code.nil? && @sort_code.to_s.length > 6 - return false if !@sort_code.nil? && @sort_code.to_s.length < 6 - true - end - - # Custom attribute writer method with validation - # @param [Object] account Value to be assigned - def account=(account) - if !account.nil? && account.to_s.length > 10 - fail ArgumentError, 'invalid value for "account", the character length must be smaller than or equal to 10.' - end - - if !account.nil? && account.to_s.length < 1 - fail ArgumentError, 'invalid value for "account", the character length must be great than or equal to 1.' - end - - - @account = account - end - - # Custom attribute writer method with validation - # @param [Object] sort_code Value to be assigned - def sort_code=(sort_code) - if !sort_code.nil? && sort_code.to_s.length > 6 - fail ArgumentError, 'invalid value for "sort_code", the character length must be smaller than or equal to 6.' - end - - if !sort_code.nil? && sort_code.to_s.length < 6 - fail ArgumentError, 'invalid value for "sort_code", the character length must be great than or equal to 6.' - end - - - @sort_code = sort_code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account == o.account && - sort_code == o.sort_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account, sort_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_payment.rb b/lib/plaid/models/payment_initiation_payment.rb deleted file mode 100644 index a2d6422ed..000000000 --- a/lib/plaid/models/payment_initiation_payment.rb +++ /dev/null @@ -1,448 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationPayment defines a payment initiation payment - class PaymentInitiationPayment - # The ID of the payment. Like all Plaid identifiers, the `payment_id` is case sensitive. - attr_accessor :payment_id - - attr_accessor :amount - - attr_accessor :status - - # The ID of the recipient - attr_accessor :recipient_id - - # A reference for the payment. - attr_accessor :reference - - # The value of the reference sent to the bank after adjustment to pass bank validation rules. - attr_accessor :adjusted_reference - - # The date and time of the last time the `status` was updated, in IS0 8601 format - attr_accessor :last_status_update - - attr_accessor :schedule - - attr_accessor :refund_details - - attr_accessor :bacs - - # The International Bank Account Number (IBAN) for the sender, if specified in the `/payment_initiation/payment/create` call. - attr_accessor :iban - - # Refund IDs associated with the payment. - attr_accessor :refund_ids - - attr_accessor :amount_refunded - - # 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. - attr_accessor :wallet_id - - attr_accessor :scheme - - attr_accessor :adjusted_scheme - - # The payment consent ID that this payment was initiated with. Is present only when payment was initiated using the payment consent. - attr_accessor :consent_id - - # The transaction ID that this payment is associated with, if any. This is present only when a payment was initiated using virtual accounts. - attr_accessor :transaction_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payment_id' => :'payment_id', - :'amount' => :'amount', - :'status' => :'status', - :'recipient_id' => :'recipient_id', - :'reference' => :'reference', - :'adjusted_reference' => :'adjusted_reference', - :'last_status_update' => :'last_status_update', - :'schedule' => :'schedule', - :'refund_details' => :'refund_details', - :'bacs' => :'bacs', - :'iban' => :'iban', - :'refund_ids' => :'refund_ids', - :'amount_refunded' => :'amount_refunded', - :'wallet_id' => :'wallet_id', - :'scheme' => :'scheme', - :'adjusted_scheme' => :'adjusted_scheme', - :'consent_id' => :'consent_id', - :'transaction_id' => :'transaction_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'payment_id' => :'String', - :'amount' => :'PaymentAmount', - :'status' => :'PaymentInitiationPaymentStatus', - :'recipient_id' => :'String', - :'reference' => :'String', - :'adjusted_reference' => :'String', - :'last_status_update' => :'Time', - :'schedule' => :'ExternalPaymentScheduleGet', - :'refund_details' => :'ExternalPaymentRefundDetails', - :'bacs' => :'SenderBACSNullable', - :'iban' => :'String', - :'refund_ids' => :'Array', - :'amount_refunded' => :'PaymentAmountRefunded', - :'wallet_id' => :'String', - :'scheme' => :'PaymentScheme', - :'adjusted_scheme' => :'PaymentScheme', - :'consent_id' => :'String', - :'transaction_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'adjusted_reference', - :'schedule', - :'refund_details', - :'bacs', - :'iban', - :'refund_ids', - :'wallet_id', - :'scheme', - :'adjusted_scheme', - :'consent_id', - :'transaction_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationPayment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationPayment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payment_id') - self.payment_id = attributes[:'payment_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'recipient_id') - self.recipient_id = attributes[:'recipient_id'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'adjusted_reference') - self.adjusted_reference = attributes[:'adjusted_reference'] - end - - if attributes.key?(:'last_status_update') - self.last_status_update = attributes[:'last_status_update'] - end - - if attributes.key?(:'schedule') - self.schedule = attributes[:'schedule'] - end - - if attributes.key?(:'refund_details') - self.refund_details = attributes[:'refund_details'] - end - - if attributes.key?(:'bacs') - self.bacs = attributes[:'bacs'] - end - - if attributes.key?(:'iban') - self.iban = attributes[:'iban'] - end - - if attributes.key?(:'refund_ids') - if (value = attributes[:'refund_ids']).is_a?(Array) - self.refund_ids = value - end - end - - if attributes.key?(:'amount_refunded') - self.amount_refunded = attributes[:'amount_refunded'] - end - - if attributes.key?(:'wallet_id') - self.wallet_id = attributes[:'wallet_id'] - end - - if attributes.key?(:'scheme') - self.scheme = attributes[:'scheme'] - end - - if attributes.key?(:'adjusted_scheme') - self.adjusted_scheme = attributes[:'adjusted_scheme'] - end - - if attributes.key?(:'consent_id') - self.consent_id = attributes[:'consent_id'] - end - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment_id.nil? - invalid_properties.push('invalid value for "payment_id", payment_id cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @recipient_id.nil? - invalid_properties.push('invalid value for "recipient_id", recipient_id cannot be nil.') - end - - if @reference.nil? - invalid_properties.push('invalid value for "reference", reference cannot be nil.') - end - - if @last_status_update.nil? - invalid_properties.push('invalid value for "last_status_update", last_status_update cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment_id.nil? - return false if @amount.nil? - return false if @status.nil? - return false if @recipient_id.nil? - return false if @reference.nil? - return false if @last_status_update.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payment_id == o.payment_id && - amount == o.amount && - status == o.status && - recipient_id == o.recipient_id && - reference == o.reference && - adjusted_reference == o.adjusted_reference && - last_status_update == o.last_status_update && - schedule == o.schedule && - refund_details == o.refund_details && - bacs == o.bacs && - iban == o.iban && - refund_ids == o.refund_ids && - amount_refunded == o.amount_refunded && - wallet_id == o.wallet_id && - scheme == o.scheme && - adjusted_scheme == o.adjusted_scheme && - consent_id == o.consent_id && - transaction_id == o.transaction_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payment_id, amount, status, recipient_id, reference, adjusted_reference, last_status_update, schedule, refund_details, bacs, iban, refund_ids, amount_refunded, wallet_id, scheme, adjusted_scheme, consent_id, transaction_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_payment_create_request.rb b/lib/plaid/models/payment_initiation_payment_create_request.rb deleted file mode 100644 index 822f71624..000000000 --- a/lib/plaid/models/payment_initiation_payment_create_request.rb +++ /dev/null @@ -1,324 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationPaymentCreateRequest defines the request schema for `/payment_initiation/payment/create` - class PaymentInitiationPaymentCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the recipient the payment is for. - attr_accessor :recipient_id - - # A reference for the payment. This must be an alphanumeric string with at most 18 characters and must not contain any special characters (since not all institutions support them). In order to track settlement via Payment Confirmation, each payment must have a unique reference. If the reference provided through the API is not unique, Plaid will adjust it. Some institutions may limit the reference to less than 18 characters. If necessary, Plaid will adjust the reference by truncating it to fit the institution's requirements. Both the originally provided and automatically adjusted references (if any) can be found in the `reference` and `adjusted_reference` fields, respectively. - attr_accessor :reference - - attr_accessor :amount - - attr_accessor :schedule - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'recipient_id' => :'recipient_id', - :'reference' => :'reference', - :'amount' => :'amount', - :'schedule' => :'schedule', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'recipient_id' => :'String', - :'reference' => :'String', - :'amount' => :'PaymentAmount', - :'schedule' => :'ExternalPaymentScheduleRequest', - :'options' => :'ExternalPaymentOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'options' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationPaymentCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationPaymentCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'recipient_id') - self.recipient_id = attributes[:'recipient_id'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'schedule') - self.schedule = attributes[:'schedule'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @recipient_id.nil? - invalid_properties.push('invalid value for "recipient_id", recipient_id cannot be nil.') - end - - if @reference.nil? - invalid_properties.push('invalid value for "reference", reference cannot be nil.') - end - - if @reference.to_s.length > 18 - invalid_properties.push('invalid value for "reference", the character length must be smaller than or equal to 18.') - end - - if @reference.to_s.length < 1 - invalid_properties.push('invalid value for "reference", the character length must be great than or equal to 1.') - end - - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @recipient_id.nil? - return false if @reference.nil? - return false if @reference.to_s.length > 18 - return false if @reference.to_s.length < 1 - return false if @amount.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] reference Value to be assigned - def reference=(reference) - if reference.nil? - fail ArgumentError, 'reference cannot be nil' - end - - if reference.to_s.length > 18 - fail ArgumentError, 'invalid value for "reference", the character length must be smaller than or equal to 18.' - end - - if reference.to_s.length < 1 - fail ArgumentError, 'invalid value for "reference", the character length must be great than or equal to 1.' - end - - - @reference = reference - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - recipient_id == o.recipient_id && - reference == o.reference && - amount == o.amount && - schedule == o.schedule && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, recipient_id, reference, amount, schedule, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_payment_create_response.rb b/lib/plaid/models/payment_initiation_payment_create_response.rb deleted file mode 100644 index 80e148ec1..000000000 --- a/lib/plaid/models/payment_initiation_payment_create_response.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationPaymentCreateResponse defines the response schema for `/payment_initiation/payment/create` - class PaymentInitiationPaymentCreateResponse - # A unique ID identifying the payment - attr_accessor :payment_id - - attr_accessor :status - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payment_id' => :'payment_id', - :'status' => :'status', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'payment_id' => :'String', - :'status' => :'PaymentInitiationPaymentCreateStatus', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationPaymentCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationPaymentCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payment_id') - self.payment_id = attributes[:'payment_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment_id.nil? - invalid_properties.push('invalid value for "payment_id", payment_id cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment_id.nil? - return false if @status.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payment_id == o.payment_id && - status == o.status && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payment_id, status, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_payment_create_status.rb b/lib/plaid/models/payment_initiation_payment_create_status.rb deleted file mode 100644 index f8b6a63cc..000000000 --- a/lib/plaid/models/payment_initiation_payment_create_status.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PaymentInitiationPaymentCreateStatus - PAYMENT_STATUS_INPUT_NEEDED = "PAYMENT_STATUS_INPUT_NEEDED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/payment_initiation_payment_get_request.rb b/lib/plaid/models/payment_initiation_payment_get_request.rb deleted file mode 100644 index 560bddfb6..000000000 --- a/lib/plaid/models/payment_initiation_payment_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationPaymentGetRequest defines the request schema for `/payment_initiation/payment/get` - class PaymentInitiationPaymentGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The `payment_id` returned from `/payment_initiation/payment/create`. - attr_accessor :payment_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'payment_id' => :'payment_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'payment_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationPaymentGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationPaymentGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'payment_id') - self.payment_id = attributes[:'payment_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment_id.nil? - invalid_properties.push('invalid value for "payment_id", payment_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - payment_id == o.payment_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, payment_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_payment_get_response.rb b/lib/plaid/models/payment_initiation_payment_get_response.rb deleted file mode 100644 index 6ec032be1..000000000 --- a/lib/plaid/models/payment_initiation_payment_get_response.rb +++ /dev/null @@ -1,471 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationPaymentGetResponse defines the response schema for `/payment_initation/payment/get` - class PaymentInitiationPaymentGetResponse - # The ID of the payment. Like all Plaid identifiers, the `payment_id` is case sensitive. - attr_accessor :payment_id - - attr_accessor :amount - - attr_accessor :status - - # The ID of the recipient - attr_accessor :recipient_id - - # A reference for the payment. - attr_accessor :reference - - # The value of the reference sent to the bank after adjustment to pass bank validation rules. - attr_accessor :adjusted_reference - - # The date and time of the last time the `status` was updated, in IS0 8601 format - attr_accessor :last_status_update - - attr_accessor :schedule - - attr_accessor :refund_details - - attr_accessor :bacs - - # The International Bank Account Number (IBAN) for the sender, if specified in the `/payment_initiation/payment/create` call. - attr_accessor :iban - - # Refund IDs associated with the payment. - attr_accessor :refund_ids - - attr_accessor :amount_refunded - - # 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. - attr_accessor :wallet_id - - attr_accessor :scheme - - attr_accessor :adjusted_scheme - - # The payment consent ID that this payment was initiated with. Is present only when payment was initiated using the payment consent. - attr_accessor :consent_id - - # The transaction ID that this payment is associated with, if any. This is present only when a payment was initiated using virtual accounts. - attr_accessor :transaction_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payment_id' => :'payment_id', - :'amount' => :'amount', - :'status' => :'status', - :'recipient_id' => :'recipient_id', - :'reference' => :'reference', - :'adjusted_reference' => :'adjusted_reference', - :'last_status_update' => :'last_status_update', - :'schedule' => :'schedule', - :'refund_details' => :'refund_details', - :'bacs' => :'bacs', - :'iban' => :'iban', - :'refund_ids' => :'refund_ids', - :'amount_refunded' => :'amount_refunded', - :'wallet_id' => :'wallet_id', - :'scheme' => :'scheme', - :'adjusted_scheme' => :'adjusted_scheme', - :'consent_id' => :'consent_id', - :'transaction_id' => :'transaction_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'payment_id' => :'String', - :'amount' => :'PaymentAmount', - :'status' => :'PaymentInitiationPaymentStatus', - :'recipient_id' => :'String', - :'reference' => :'String', - :'adjusted_reference' => :'String', - :'last_status_update' => :'Time', - :'schedule' => :'ExternalPaymentScheduleGet', - :'refund_details' => :'ExternalPaymentRefundDetails', - :'bacs' => :'SenderBACSNullable', - :'iban' => :'String', - :'refund_ids' => :'Array', - :'amount_refunded' => :'PaymentAmountRefunded', - :'wallet_id' => :'String', - :'scheme' => :'PaymentScheme', - :'adjusted_scheme' => :'PaymentScheme', - :'consent_id' => :'String', - :'transaction_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'adjusted_reference', - :'schedule', - :'refund_details', - :'bacs', - :'iban', - :'refund_ids', - :'wallet_id', - :'scheme', - :'adjusted_scheme', - :'consent_id', - :'transaction_id', - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'PaymentInitiationPayment', - :'PaymentInitiationRecipientGetResponseAllOf' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationPaymentGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationPaymentGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payment_id') - self.payment_id = attributes[:'payment_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'recipient_id') - self.recipient_id = attributes[:'recipient_id'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'adjusted_reference') - self.adjusted_reference = attributes[:'adjusted_reference'] - end - - if attributes.key?(:'last_status_update') - self.last_status_update = attributes[:'last_status_update'] - end - - if attributes.key?(:'schedule') - self.schedule = attributes[:'schedule'] - end - - if attributes.key?(:'refund_details') - self.refund_details = attributes[:'refund_details'] - end - - if attributes.key?(:'bacs') - self.bacs = attributes[:'bacs'] - end - - if attributes.key?(:'iban') - self.iban = attributes[:'iban'] - end - - if attributes.key?(:'refund_ids') - if (value = attributes[:'refund_ids']).is_a?(Array) - self.refund_ids = value - end - end - - if attributes.key?(:'amount_refunded') - self.amount_refunded = attributes[:'amount_refunded'] - end - - if attributes.key?(:'wallet_id') - self.wallet_id = attributes[:'wallet_id'] - end - - if attributes.key?(:'scheme') - self.scheme = attributes[:'scheme'] - end - - if attributes.key?(:'adjusted_scheme') - self.adjusted_scheme = attributes[:'adjusted_scheme'] - end - - if attributes.key?(:'consent_id') - self.consent_id = attributes[:'consent_id'] - end - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment_id.nil? - invalid_properties.push('invalid value for "payment_id", payment_id cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @recipient_id.nil? - invalid_properties.push('invalid value for "recipient_id", recipient_id cannot be nil.') - end - - if @reference.nil? - invalid_properties.push('invalid value for "reference", reference cannot be nil.') - end - - if @last_status_update.nil? - invalid_properties.push('invalid value for "last_status_update", last_status_update cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment_id.nil? - return false if @amount.nil? - return false if @status.nil? - return false if @recipient_id.nil? - return false if @reference.nil? - return false if @last_status_update.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payment_id == o.payment_id && - amount == o.amount && - status == o.status && - recipient_id == o.recipient_id && - reference == o.reference && - adjusted_reference == o.adjusted_reference && - last_status_update == o.last_status_update && - schedule == o.schedule && - refund_details == o.refund_details && - bacs == o.bacs && - iban == o.iban && - refund_ids == o.refund_ids && - amount_refunded == o.amount_refunded && - wallet_id == o.wallet_id && - scheme == o.scheme && - adjusted_scheme == o.adjusted_scheme && - consent_id == o.consent_id && - transaction_id == o.transaction_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payment_id, amount, status, recipient_id, reference, adjusted_reference, last_status_update, schedule, refund_details, bacs, iban, refund_ids, amount_refunded, wallet_id, scheme, adjusted_scheme, consent_id, transaction_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_payment_list_request.rb b/lib/plaid/models/payment_initiation_payment_list_request.rb deleted file mode 100644 index 0039ddfd7..000000000 --- a/lib/plaid/models/payment_initiation_payment_list_request.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationPaymentListRequest defines the request schema for `/payment_initiation/payment/list` - class PaymentInitiationPaymentListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The maximum number of payments to return. If `count` is not specified, a maximum of 10 payments will be returned, beginning with the most recent payment before the cursor (if specified). - attr_accessor :count - - # A string in RFC 3339 format (i.e. \"2019-12-06T22:35:49Z\"). Only payments created before the cursor will be returned. - attr_accessor :cursor - - # The consent ID. If specified, only payments, executed using this consent, will be returned. - attr_accessor :consent_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'count' => :'count', - :'cursor' => :'cursor', - :'consent_id' => :'consent_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'count' => :'Integer', - :'cursor' => :'Time', - :'consent_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'count', - :'cursor', - :'consent_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationPaymentListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationPaymentListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 10 - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - - if attributes.key?(:'consent_id') - self.consent_id = attributes[:'consent_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@count.nil? && @count > 200 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 200.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@count.nil? && @count > 200 - return false if !@count.nil? && @count < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 200 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 200.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - count == o.count && - cursor == o.cursor && - consent_id == o.consent_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, count, cursor, consent_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_payment_list_response.rb b/lib/plaid/models/payment_initiation_payment_list_response.rb deleted file mode 100644 index d2beb8d0f..000000000 --- a/lib/plaid/models/payment_initiation_payment_list_response.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationPaymentListResponse defines the response schema for `/payment_initiation/payment/list` - class PaymentInitiationPaymentListResponse - # An array of payments that have been created, associated with the given `client_id`. - attr_accessor :payments - - # The value that, when used as the optional `cursor` parameter to `/payment_initiation/payment/list`, will return the next unreturned payment as its first payment. - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payments' => :'payments', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'payments' => :'Array', - :'next_cursor' => :'Time', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationPaymentListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationPaymentListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payments') - if (value = attributes[:'payments']).is_a?(Array) - self.payments = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payments.nil? - invalid_properties.push('invalid value for "payments", payments cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payments.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payments == o.payments && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payments, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_payment_reverse_request.rb b/lib/plaid/models/payment_initiation_payment_reverse_request.rb deleted file mode 100644 index 8c35bd2fd..000000000 --- a/lib/plaid/models/payment_initiation_payment_reverse_request.rb +++ /dev/null @@ -1,345 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationPaymentReverseRequest defines the request schema for `/payment_initiation/payment/reverse` - class PaymentInitiationPaymentReverseRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the payment to reverse - attr_accessor :payment_id - - # A random key provided by the client, per unique wallet transaction. Maximum of 128 characters. The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. If a request to execute a wallet transaction fails due to a network connection error, then after a minimum delay of one minute, you can retry the request with the same idempotency key to guarantee that only a single wallet transaction is created. If the request was successfully processed, it will prevent any transaction that uses the same idempotency key, and was received within 24 hours of the first request, from being processed. - attr_accessor :idempotency_key - - # A reference for the refund. This must be an alphanumeric string with 6 to 18 characters and must not contain any special characters or spaces. - attr_accessor :reference - - attr_accessor :amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'payment_id' => :'payment_id', - :'idempotency_key' => :'idempotency_key', - :'reference' => :'reference', - :'amount' => :'amount' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'payment_id' => :'String', - :'idempotency_key' => :'String', - :'reference' => :'String', - :'amount' => :'PaymentAmountToRefund' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationPaymentReverseRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationPaymentReverseRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'payment_id') - self.payment_id = attributes[:'payment_id'] - end - - if attributes.key?(:'idempotency_key') - self.idempotency_key = attributes[:'idempotency_key'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment_id.nil? - invalid_properties.push('invalid value for "payment_id", payment_id cannot be nil.') - end - - if @idempotency_key.nil? - invalid_properties.push('invalid value for "idempotency_key", idempotency_key cannot be nil.') - end - - if @idempotency_key.to_s.length > 128 - invalid_properties.push('invalid value for "idempotency_key", the character length must be smaller than or equal to 128.') - end - - if @idempotency_key.to_s.length < 1 - invalid_properties.push('invalid value for "idempotency_key", the character length must be great than or equal to 1.') - end - - - if @reference.nil? - invalid_properties.push('invalid value for "reference", reference cannot be nil.') - end - - if @reference.to_s.length > 18 - invalid_properties.push('invalid value for "reference", the character length must be smaller than or equal to 18.') - end - - if @reference.to_s.length < 6 - invalid_properties.push('invalid value for "reference", the character length must be great than or equal to 6.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment_id.nil? - return false if @idempotency_key.nil? - return false if @idempotency_key.to_s.length > 128 - return false if @idempotency_key.to_s.length < 1 - return false if @reference.nil? - return false if @reference.to_s.length > 18 - return false if @reference.to_s.length < 6 - true - end - - # Custom attribute writer method with validation - # @param [Object] idempotency_key Value to be assigned - def idempotency_key=(idempotency_key) - if idempotency_key.nil? - fail ArgumentError, 'idempotency_key cannot be nil' - end - - if idempotency_key.to_s.length > 128 - fail ArgumentError, 'invalid value for "idempotency_key", the character length must be smaller than or equal to 128.' - end - - if idempotency_key.to_s.length < 1 - fail ArgumentError, 'invalid value for "idempotency_key", the character length must be great than or equal to 1.' - end - - - @idempotency_key = idempotency_key - end - - # Custom attribute writer method with validation - # @param [Object] reference Value to be assigned - def reference=(reference) - if reference.nil? - fail ArgumentError, 'reference cannot be nil' - end - - if reference.to_s.length > 18 - fail ArgumentError, 'invalid value for "reference", the character length must be smaller than or equal to 18.' - end - - if reference.to_s.length < 6 - fail ArgumentError, 'invalid value for "reference", the character length must be great than or equal to 6.' - end - - - @reference = reference - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - payment_id == o.payment_id && - idempotency_key == o.idempotency_key && - reference == o.reference && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, payment_id, idempotency_key, reference, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_payment_reverse_response.rb b/lib/plaid/models/payment_initiation_payment_reverse_response.rb deleted file mode 100644 index a35bb2b4b..000000000 --- a/lib/plaid/models/payment_initiation_payment_reverse_response.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationPaymentReverseResponse defines the response schema for `/payment_initation/payment/reverse` - class PaymentInitiationPaymentReverseResponse - # A unique ID identifying the refund - attr_accessor :refund_id - - attr_accessor :status - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'refund_id' => :'refund_id', - :'status' => :'status', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'refund_id' => :'String', - :'status' => :'WalletTransactionStatus', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationPaymentReverseResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationPaymentReverseResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'refund_id') - self.refund_id = attributes[:'refund_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @refund_id.nil? - invalid_properties.push('invalid value for "refund_id", refund_id cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @refund_id.nil? - return false if @status.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - refund_id == o.refund_id && - status == o.status && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [refund_id, status, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_payment_status.rb b/lib/plaid/models/payment_initiation_payment_status.rb deleted file mode 100644 index e6ebba7d0..000000000 --- a/lib/plaid/models/payment_initiation_payment_status.rb +++ /dev/null @@ -1,51 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PaymentInitiationPaymentStatus - INPUT_NEEDED = "PAYMENT_STATUS_INPUT_NEEDED".freeze - PROCESSING = "PAYMENT_STATUS_PROCESSING".freeze - INITIATED = "PAYMENT_STATUS_INITIATED".freeze - COMPLETED = "PAYMENT_STATUS_COMPLETED".freeze - INSUFFICIENT_FUNDS = "PAYMENT_STATUS_INSUFFICIENT_FUNDS".freeze - FAILED = "PAYMENT_STATUS_FAILED".freeze - BLOCKED = "PAYMENT_STATUS_BLOCKED".freeze - UNKNOWN = "PAYMENT_STATUS_UNKNOWN".freeze - EXECUTED = "PAYMENT_STATUS_EXECUTED".freeze - SETTLED = "PAYMENT_STATUS_SETTLED".freeze - AUTHORISING = "PAYMENT_STATUS_AUTHORISING".freeze - CANCELLED = "PAYMENT_STATUS_CANCELLED".freeze - ESTABLISHED = "PAYMENT_STATUS_ESTABLISHED".freeze - REJECTED = "PAYMENT_STATUS_REJECTED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/payment_initiation_payment_token_create_request.rb b/lib/plaid/models/payment_initiation_payment_token_create_request.rb deleted file mode 100644 index c32678f24..000000000 --- a/lib/plaid/models/payment_initiation_payment_token_create_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationPaymentTokenCreateRequest defines the request schema for `/payment_initiation/payment/token/create` - class PaymentInitiationPaymentTokenCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The `payment_id` returned from `/payment_initiation/payment/create`. - attr_accessor :payment_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'payment_id' => :'payment_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'payment_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationPaymentTokenCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationPaymentTokenCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'payment_id') - self.payment_id = attributes[:'payment_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment_id.nil? - invalid_properties.push('invalid value for "payment_id", payment_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - payment_id == o.payment_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, payment_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_payment_token_create_response.rb b/lib/plaid/models/payment_initiation_payment_token_create_response.rb deleted file mode 100644 index 30b798a49..000000000 --- a/lib/plaid/models/payment_initiation_payment_token_create_response.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationPaymentTokenCreateResponse defines the response schema for `/payment_initiation/payment/token/create` - class PaymentInitiationPaymentTokenCreateResponse - # A `payment_token` that can be provided to Link initialization to enter the payment initiation flow - attr_accessor :payment_token - - # The date and time at which the token will expire, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. A `payment_token` expires after 15 minutes. - attr_accessor :payment_token_expiration_time - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payment_token' => :'payment_token', - :'payment_token_expiration_time' => :'payment_token_expiration_time', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'payment_token' => :'String', - :'payment_token_expiration_time' => :'Time', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationPaymentTokenCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationPaymentTokenCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payment_token') - self.payment_token = attributes[:'payment_token'] - end - - if attributes.key?(:'payment_token_expiration_time') - self.payment_token_expiration_time = attributes[:'payment_token_expiration_time'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment_token.nil? - invalid_properties.push('invalid value for "payment_token", payment_token cannot be nil.') - end - - if @payment_token_expiration_time.nil? - invalid_properties.push('invalid value for "payment_token_expiration_time", payment_token_expiration_time cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment_token.nil? - return false if @payment_token_expiration_time.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payment_token == o.payment_token && - payment_token_expiration_time == o.payment_token_expiration_time && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payment_token, payment_token_expiration_time, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_recipient.rb b/lib/plaid/models/payment_initiation_recipient.rb deleted file mode 100644 index 184fd76f6..000000000 --- a/lib/plaid/models/payment_initiation_recipient.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationRecipient defines a payment initiation recipient - class PaymentInitiationRecipient - # The ID of the recipient. - attr_accessor :recipient_id - - # The name of the recipient. - attr_accessor :name - - attr_accessor :address - - # The International Bank Account Number (IBAN) for the recipient. - attr_accessor :iban - - attr_accessor :bacs - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'recipient_id' => :'recipient_id', - :'name' => :'name', - :'address' => :'address', - :'iban' => :'iban', - :'bacs' => :'bacs' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'recipient_id' => :'String', - :'name' => :'String', - :'address' => :'PaymentInitiationAddress', - :'iban' => :'String', - :'bacs' => :'RecipientBACSNullable' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'address', - :'iban', - :'bacs' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationRecipient` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationRecipient`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'recipient_id') - self.recipient_id = attributes[:'recipient_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'iban') - self.iban = attributes[:'iban'] - end - - if attributes.key?(:'bacs') - self.bacs = attributes[:'bacs'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @recipient_id.nil? - invalid_properties.push('invalid value for "recipient_id", recipient_id cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @recipient_id.nil? - return false if @name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - recipient_id == o.recipient_id && - name == o.name && - address == o.address && - iban == o.iban && - bacs == o.bacs - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [recipient_id, name, address, iban, bacs].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_recipient_create_request.rb b/lib/plaid/models/payment_initiation_recipient_create_request.rb deleted file mode 100644 index af1f8f699..000000000 --- a/lib/plaid/models/payment_initiation_recipient_create_request.rb +++ /dev/null @@ -1,324 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationRecipientCreateRequest defines the request schema for `/payment_initiation/recipient/create` - class PaymentInitiationRecipientCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The name of the recipient. We recommend using strings of length 18 or less and avoid special characters to ensure compatibility with all institutions. - attr_accessor :name - - # The International Bank Account Number (IBAN) for the recipient. If BACS data is not provided, an IBAN is required. - attr_accessor :iban - - attr_accessor :bacs - - attr_accessor :address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'name' => :'name', - :'iban' => :'iban', - :'bacs' => :'bacs', - :'address' => :'address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'name' => :'String', - :'iban' => :'String', - :'bacs' => :'RecipientBACSNullable', - :'address' => :'PaymentInitiationAddress' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'iban', - :'bacs', - :'address' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationRecipientCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationRecipientCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'iban') - self.iban = attributes[:'iban'] - end - - if attributes.key?(:'bacs') - self.bacs = attributes[:'bacs'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @name.to_s.length < 1 - invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') - end - - - if !@iban.nil? && @iban.to_s.length > 34 - invalid_properties.push('invalid value for "iban", the character length must be smaller than or equal to 34.') - end - - if !@iban.nil? && @iban.to_s.length < 15 - invalid_properties.push('invalid value for "iban", the character length must be great than or equal to 15.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @name.to_s.length < 1 - return false if !@iban.nil? && @iban.to_s.length > 34 - return false if !@iban.nil? && @iban.to_s.length < 15 - true - end - - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if name.nil? - fail ArgumentError, 'name cannot be nil' - end - - if name.to_s.length < 1 - fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' - end - - - @name = name - end - - # Custom attribute writer method with validation - # @param [Object] iban Value to be assigned - def iban=(iban) - if !iban.nil? && iban.to_s.length > 34 - fail ArgumentError, 'invalid value for "iban", the character length must be smaller than or equal to 34.' - end - - if !iban.nil? && iban.to_s.length < 15 - fail ArgumentError, 'invalid value for "iban", the character length must be great than or equal to 15.' - end - - - @iban = iban - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - name == o.name && - iban == o.iban && - bacs == o.bacs && - address == o.address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, name, iban, bacs, address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_recipient_create_response.rb b/lib/plaid/models/payment_initiation_recipient_create_response.rb deleted file mode 100644 index d934172d9..000000000 --- a/lib/plaid/models/payment_initiation_recipient_create_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationRecipientCreateResponse defines the response schema for `/payment_initation/recipient/create` - class PaymentInitiationRecipientCreateResponse - # A unique ID identifying the recipient - attr_accessor :recipient_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'recipient_id' => :'recipient_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'recipient_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationRecipientCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationRecipientCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'recipient_id') - self.recipient_id = attributes[:'recipient_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @recipient_id.nil? - invalid_properties.push('invalid value for "recipient_id", recipient_id cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @recipient_id.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - recipient_id == o.recipient_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [recipient_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_recipient_get_request.rb b/lib/plaid/models/payment_initiation_recipient_get_request.rb deleted file mode 100644 index 8678e3f0e..000000000 --- a/lib/plaid/models/payment_initiation_recipient_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationRecipientGetRequest defines the request schema for `/payment_initiation/recipient/get` - class PaymentInitiationRecipientGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the recipient - attr_accessor :recipient_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'recipient_id' => :'recipient_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'recipient_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationRecipientGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationRecipientGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'recipient_id') - self.recipient_id = attributes[:'recipient_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @recipient_id.nil? - invalid_properties.push('invalid value for "recipient_id", recipient_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @recipient_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - recipient_id == o.recipient_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, recipient_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_recipient_get_response.rb b/lib/plaid/models/payment_initiation_recipient_get_response.rb deleted file mode 100644 index 43d5dce97..000000000 --- a/lib/plaid/models/payment_initiation_recipient_get_response.rb +++ /dev/null @@ -1,295 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationRecipientGetResponse defines the response schema for `/payment_initiation/recipient/get` - class PaymentInitiationRecipientGetResponse - # The ID of the recipient. - attr_accessor :recipient_id - - # The name of the recipient. - attr_accessor :name - - attr_accessor :address - - # The International Bank Account Number (IBAN) for the recipient. - attr_accessor :iban - - attr_accessor :bacs - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'recipient_id' => :'recipient_id', - :'name' => :'name', - :'address' => :'address', - :'iban' => :'iban', - :'bacs' => :'bacs', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'recipient_id' => :'String', - :'name' => :'String', - :'address' => :'PaymentInitiationAddress', - :'iban' => :'String', - :'bacs' => :'RecipientBACSNullable', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'address', - :'iban', - :'bacs', - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'PaymentInitiationRecipient', - :'PaymentInitiationRecipientGetResponseAllOf' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationRecipientGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationRecipientGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'recipient_id') - self.recipient_id = attributes[:'recipient_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'iban') - self.iban = attributes[:'iban'] - end - - if attributes.key?(:'bacs') - self.bacs = attributes[:'bacs'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @recipient_id.nil? - invalid_properties.push('invalid value for "recipient_id", recipient_id cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @recipient_id.nil? - return false if @name.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - recipient_id == o.recipient_id && - name == o.name && - address == o.address && - iban == o.iban && - bacs == o.bacs && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [recipient_id, name, address, iban, bacs, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_recipient_get_response_all_of.rb b/lib/plaid/models/payment_initiation_recipient_get_response_all_of.rb deleted file mode 100644 index 4f65f8d38..000000000 --- a/lib/plaid/models/payment_initiation_recipient_get_response_all_of.rb +++ /dev/null @@ -1,220 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PaymentInitiationRecipientGetResponseAllOf - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationRecipientGetResponseAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationRecipientGetResponseAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_recipient_list_request.rb b/lib/plaid/models/payment_initiation_recipient_list_request.rb deleted file mode 100644 index 48ede3831..000000000 --- a/lib/plaid/models/payment_initiation_recipient_list_request.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationRecipientListRequest defines the request schema for `/payment_initiation/recipient/list` - class PaymentInitiationRecipientListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationRecipientListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationRecipientListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_recipient_list_response.rb b/lib/plaid/models/payment_initiation_recipient_list_response.rb deleted file mode 100644 index 6d9d9344a..000000000 --- a/lib/plaid/models/payment_initiation_recipient_list_response.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentInitiationRecipientListResponse defines the response schema for `/payment_initiation/recipient/list` - class PaymentInitiationRecipientListResponse - # An array of payment recipients created for Payment Initiation - attr_accessor :recipients - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'recipients' => :'recipients', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'recipients' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationRecipientListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationRecipientListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'recipients') - if (value = attributes[:'recipients']).is_a?(Array) - self.recipients = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @recipients.nil? - invalid_properties.push('invalid value for "recipients", recipients cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @recipients.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - recipients == o.recipients && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [recipients, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_initiation_standing_order_metadata.rb b/lib/plaid/models/payment_initiation_standing_order_metadata.rb deleted file mode 100644 index a3f981ea1..000000000 --- a/lib/plaid/models/payment_initiation_standing_order_metadata.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Metadata specifically related to valid Payment Initiation standing order configurations for the institution. - class PaymentInitiationStandingOrderMetadata - # Indicates whether the institution supports closed-ended standing orders by providing an end date. - attr_accessor :supports_standing_order_end_date - - # This is only applicable to `MONTHLY` standing orders. Indicates whether the institution supports negative integers (-1 to -5) for setting up a `MONTHLY` standing order relative to the end of the month. - attr_accessor :supports_standing_order_negative_execution_days - - # A list of the valid standing order intervals supported by the institution. - attr_accessor :valid_standing_order_intervals - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'supports_standing_order_end_date' => :'supports_standing_order_end_date', - :'supports_standing_order_negative_execution_days' => :'supports_standing_order_negative_execution_days', - :'valid_standing_order_intervals' => :'valid_standing_order_intervals' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'supports_standing_order_end_date' => :'Boolean', - :'supports_standing_order_negative_execution_days' => :'Boolean', - :'valid_standing_order_intervals' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationStandingOrderMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationStandingOrderMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'supports_standing_order_end_date') - self.supports_standing_order_end_date = attributes[:'supports_standing_order_end_date'] - end - - if attributes.key?(:'supports_standing_order_negative_execution_days') - self.supports_standing_order_negative_execution_days = attributes[:'supports_standing_order_negative_execution_days'] - end - - if attributes.key?(:'valid_standing_order_intervals') - if (value = attributes[:'valid_standing_order_intervals']).is_a?(Array) - self.valid_standing_order_intervals = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @supports_standing_order_end_date.nil? - invalid_properties.push('invalid value for "supports_standing_order_end_date", supports_standing_order_end_date cannot be nil.') - end - - if @supports_standing_order_negative_execution_days.nil? - invalid_properties.push('invalid value for "supports_standing_order_negative_execution_days", supports_standing_order_negative_execution_days cannot be nil.') - end - - if @valid_standing_order_intervals.nil? - invalid_properties.push('invalid value for "valid_standing_order_intervals", valid_standing_order_intervals cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @supports_standing_order_end_date.nil? - return false if @supports_standing_order_negative_execution_days.nil? - return false if @valid_standing_order_intervals.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - supports_standing_order_end_date == o.supports_standing_order_end_date && - supports_standing_order_negative_execution_days == o.supports_standing_order_negative_execution_days && - valid_standing_order_intervals == o.valid_standing_order_intervals - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [supports_standing_order_end_date, supports_standing_order_negative_execution_days, valid_standing_order_intervals].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_meta.rb b/lib/plaid/models/payment_meta.rb deleted file mode 100644 index 26f751dcc..000000000 --- a/lib/plaid/models/payment_meta.rb +++ /dev/null @@ -1,299 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Transaction information specific to inter-bank transfers. If the transaction was not an inter-bank transfer, all fields will be `null`. 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. - class PaymentMeta - # The transaction reference number supplied by the financial institution. - attr_accessor :reference_number - - # The ACH PPD ID for the payer. - attr_accessor :ppd_id - - # For transfers, the party that is receiving the transaction. - attr_accessor :payee - - # The party initiating a wire transfer. Will be `null` if the transaction is not a wire transfer. - attr_accessor :by_order_of - - # For transfers, the party that is paying the transaction. - attr_accessor :payer - - # The type of transfer, e.g. 'ACH' - attr_accessor :payment_method - - # The name of the payment processor - attr_accessor :payment_processor - - # The payer-supplied description of the transfer. - attr_accessor :reason - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reference_number' => :'reference_number', - :'ppd_id' => :'ppd_id', - :'payee' => :'payee', - :'by_order_of' => :'by_order_of', - :'payer' => :'payer', - :'payment_method' => :'payment_method', - :'payment_processor' => :'payment_processor', - :'reason' => :'reason' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'reference_number' => :'String', - :'ppd_id' => :'String', - :'payee' => :'String', - :'by_order_of' => :'String', - :'payer' => :'String', - :'payment_method' => :'String', - :'payment_processor' => :'String', - :'reason' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'reference_number', - :'ppd_id', - :'payee', - :'by_order_of', - :'payer', - :'payment_method', - :'payment_processor', - :'reason' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentMeta` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentMeta`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reference_number') - self.reference_number = attributes[:'reference_number'] - end - - if attributes.key?(:'ppd_id') - self.ppd_id = attributes[:'ppd_id'] - end - - if attributes.key?(:'payee') - self.payee = attributes[:'payee'] - end - - if attributes.key?(:'by_order_of') - self.by_order_of = attributes[:'by_order_of'] - end - - if attributes.key?(:'payer') - self.payer = attributes[:'payer'] - end - - if attributes.key?(:'payment_method') - self.payment_method = attributes[:'payment_method'] - end - - if attributes.key?(:'payment_processor') - self.payment_processor = attributes[:'payment_processor'] - end - - if attributes.key?(:'reason') - self.reason = attributes[:'reason'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reference_number == o.reference_number && - ppd_id == o.ppd_id && - payee == o.payee && - by_order_of == o.by_order_of && - payer == o.payer && - payment_method == o.payment_method && - payment_processor == o.payment_processor && - reason == o.reason - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reference_number, ppd_id, payee, by_order_of, payer, payment_method, payment_processor, reason].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_profile_create_request.rb b/lib/plaid/models/payment_profile_create_request.rb deleted file mode 100644 index 5a425ab5f..000000000 --- a/lib/plaid/models/payment_profile_create_request.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentProfileCreateRequest defines the request schema for `/payment_profile/create` - class PaymentProfileCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentProfileCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentProfileCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_profile_create_response.rb b/lib/plaid/models/payment_profile_create_response.rb deleted file mode 100644 index d49730c6d..000000000 --- a/lib/plaid/models/payment_profile_create_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentProfileCreateResponse defines the response schema for `/payment_profile/create` - class PaymentProfileCreateResponse - # A payment profile token associated with the Payment Profile data that is being requested. - attr_accessor :payment_profile_token - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payment_profile_token' => :'payment_profile_token', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'payment_profile_token' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentProfileCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentProfileCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payment_profile_token') - self.payment_profile_token = attributes[:'payment_profile_token'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment_profile_token.nil? - invalid_properties.push('invalid value for "payment_profile_token", payment_profile_token cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment_profile_token.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payment_profile_token == o.payment_profile_token && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payment_profile_token, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_profile_get_request.rb b/lib/plaid/models/payment_profile_get_request.rb deleted file mode 100644 index f03aaaca3..000000000 --- a/lib/plaid/models/payment_profile_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentProfileGetRequest defines the request schema for `/payment_profile/get` - class PaymentProfileGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A payment profile token associated with the Payment Profile data that is being requested. - attr_accessor :payment_profile_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'payment_profile_token' => :'payment_profile_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'payment_profile_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentProfileGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentProfileGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'payment_profile_token') - self.payment_profile_token = attributes[:'payment_profile_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment_profile_token.nil? - invalid_properties.push('invalid value for "payment_profile_token", payment_profile_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment_profile_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - payment_profile_token == o.payment_profile_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, payment_profile_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_profile_get_response.rb b/lib/plaid/models/payment_profile_get_response.rb deleted file mode 100644 index e022d138f..000000000 --- a/lib/plaid/models/payment_profile_get_response.rb +++ /dev/null @@ -1,303 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentProfileGetResponse defines the response schema for `/payment_profile/get` - class PaymentProfileGetResponse - # 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 - attr_accessor :updated_at - - # 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 - attr_accessor :created_at - - # Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the time the given Payment Profile was deleted at. Always `null` if the Payment Profile has not been deleted - attr_accessor :deleted_at - - attr_accessor :status - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'updated_at' => :'updated_at', - :'created_at' => :'created_at', - :'deleted_at' => :'deleted_at', - :'status' => :'status', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'updated_at' => :'Time', - :'created_at' => :'Time', - :'deleted_at' => :'Time', - :'status' => :'PaymentProfileStatus', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'deleted_at', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentProfileGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentProfileGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'updated_at') - self.updated_at = attributes[:'updated_at'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'deleted_at') - self.deleted_at = attributes[:'deleted_at'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @updated_at.nil? - invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @updated_at.nil? - return false if @created_at.nil? - return false if @status.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - updated_at == o.updated_at && - created_at == o.created_at && - deleted_at == o.deleted_at && - status == o.status && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [updated_at, created_at, deleted_at, status, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_profile_remove_request.rb b/lib/plaid/models/payment_profile_remove_request.rb deleted file mode 100644 index 3d66303ff..000000000 --- a/lib/plaid/models/payment_profile_remove_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentProfileRemoveRequest defines the request schema for `/payment_profile/remove` - class PaymentProfileRemoveRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A payment profile token associated with the Payment Profile data that is being requested. - attr_accessor :payment_profile_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'payment_profile_token' => :'payment_profile_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'payment_profile_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentProfileRemoveRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentProfileRemoveRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'payment_profile_token') - self.payment_profile_token = attributes[:'payment_profile_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment_profile_token.nil? - invalid_properties.push('invalid value for "payment_profile_token", payment_profile_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment_profile_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - payment_profile_token == o.payment_profile_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, payment_profile_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_profile_remove_response.rb b/lib/plaid/models/payment_profile_remove_response.rb deleted file mode 100644 index b60c26eef..000000000 --- a/lib/plaid/models/payment_profile_remove_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # PaymentProfileRemoveResponse defines the response schema for `/payment_profile/remove` - class PaymentProfileRemoveResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentProfileRemoveResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentProfileRemoveResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payment_profile_status.rb b/lib/plaid/models/payment_profile_status.rb deleted file mode 100644 index 05e5555e3..000000000 --- a/lib/plaid/models/payment_profile_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PaymentProfileStatus - PENDING = "PENDING".freeze - READY = "READY".freeze - REMOVED = "REMOVED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/payment_schedule_interval.rb b/lib/plaid/models/payment_schedule_interval.rb deleted file mode 100644 index a6b261442..000000000 --- a/lib/plaid/models/payment_schedule_interval.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PaymentScheduleInterval - WEEKLY = "WEEKLY".freeze - MONTHLY = "MONTHLY".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/payment_scheme.rb b/lib/plaid/models/payment_scheme.rb deleted file mode 100644 index 34af951ee..000000000 --- a/lib/plaid/models/payment_scheme.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PaymentScheme - NULL = "null".freeze - LOCAL_DEFAULT = "LOCAL_DEFAULT".freeze - LOCAL_INSTANT = "LOCAL_INSTANT".freeze - SEPA_CREDIT_TRANSFER = "SEPA_CREDIT_TRANSFER".freeze - SEPA_CREDIT_TRANSFER_INSTANT = "SEPA_CREDIT_TRANSFER_INSTANT".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/payment_status_update_webhook.rb b/lib/plaid/models/payment_status_update_webhook.rb deleted file mode 100644 index 19d46ebdf..000000000 --- a/lib/plaid/models/payment_status_update_webhook.rb +++ /dev/null @@ -1,400 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when the status of a payment has changed. - class PaymentStatusUpdateWebhook - # `PAYMENT_INITIATION` - attr_accessor :webhook_type - - # `PAYMENT_STATUS_UPDATE` - attr_accessor :webhook_code - - # The `payment_id` for the payment being updated - attr_accessor :payment_id - - # The transaction ID that this payment is associated with, if any. This is present only when a payment was initiated using virtual accounts. - attr_accessor :transaction_id - - attr_accessor :new_payment_status - - attr_accessor :old_payment_status - - # The original value of the reference when creating the payment. - attr_accessor :original_reference - - # The value of the reference sent to the bank after adjustment to pass bank validation rules. - attr_accessor :adjusted_reference - - # The original value of the `start_date` provided during the creation of a standing order. If the payment is not a standing order, this field will be `null`. - attr_accessor :original_start_date - - # 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, or if the payment is not a standing order, this field will be `null`. - attr_accessor :adjusted_start_date - - # The timestamp of the update, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format, e.g. `\"2017-09-14T14:42:19.350Z\"` - attr_accessor :timestamp - - attr_accessor :error - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'payment_id' => :'payment_id', - :'transaction_id' => :'transaction_id', - :'new_payment_status' => :'new_payment_status', - :'old_payment_status' => :'old_payment_status', - :'original_reference' => :'original_reference', - :'adjusted_reference' => :'adjusted_reference', - :'original_start_date' => :'original_start_date', - :'adjusted_start_date' => :'adjusted_start_date', - :'timestamp' => :'timestamp', - :'error' => :'error', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'payment_id' => :'String', - :'transaction_id' => :'String', - :'new_payment_status' => :'PaymentInitiationPaymentStatus', - :'old_payment_status' => :'PaymentInitiationPaymentStatus', - :'original_reference' => :'String', - :'adjusted_reference' => :'String', - :'original_start_date' => :'Date', - :'adjusted_start_date' => :'Date', - :'timestamp' => :'Time', - :'error' => :'PlaidError', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'transaction_id', - :'original_reference', - :'adjusted_reference', - :'original_start_date', - :'adjusted_start_date', - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentStatusUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentStatusUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'payment_id') - self.payment_id = attributes[:'payment_id'] - end - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - - if attributes.key?(:'new_payment_status') - self.new_payment_status = attributes[:'new_payment_status'] - end - - if attributes.key?(:'old_payment_status') - self.old_payment_status = attributes[:'old_payment_status'] - end - - if attributes.key?(:'original_reference') - self.original_reference = attributes[:'original_reference'] - end - - if attributes.key?(:'adjusted_reference') - self.adjusted_reference = attributes[:'adjusted_reference'] - end - - if attributes.key?(:'original_start_date') - self.original_start_date = attributes[:'original_start_date'] - end - - if attributes.key?(:'adjusted_start_date') - self.adjusted_start_date = attributes[:'adjusted_start_date'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @payment_id.nil? - invalid_properties.push('invalid value for "payment_id", payment_id cannot be nil.') - end - - if @new_payment_status.nil? - invalid_properties.push('invalid value for "new_payment_status", new_payment_status cannot be nil.') - end - - if @old_payment_status.nil? - invalid_properties.push('invalid value for "old_payment_status", old_payment_status cannot be nil.') - end - - if @timestamp.nil? - invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @payment_id.nil? - return false if @new_payment_status.nil? - return false if @old_payment_status.nil? - return false if @timestamp.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - payment_id == o.payment_id && - transaction_id == o.transaction_id && - new_payment_status == o.new_payment_status && - old_payment_status == o.old_payment_status && - original_reference == o.original_reference && - adjusted_reference == o.adjusted_reference && - original_start_date == o.original_start_date && - adjusted_start_date == o.adjusted_start_date && - timestamp == o.timestamp && - error == o.error && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, payment_id, transaction_id, new_payment_status, old_payment_status, original_reference, adjusted_reference, original_start_date, adjusted_start_date, timestamp, error, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payroll_income_account_data.rb b/lib/plaid/models/payroll_income_account_data.rb deleted file mode 100644 index 01007c7b1..000000000 --- a/lib/plaid/models/payroll_income_account_data.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing account level data. - class PayrollIncomeAccountData - # ID of the payroll provider account. - attr_accessor :account_id - - attr_accessor :rate_of_pay - - # The frequency at which an individual is paid. - attr_accessor :pay_frequency - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'rate_of_pay' => :'rate_of_pay', - :'pay_frequency' => :'pay_frequency' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'rate_of_pay' => :'PayrollIncomeRateOfPay', - :'pay_frequency' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_id', - :'pay_frequency' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PayrollIncomeAccountData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PayrollIncomeAccountData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'rate_of_pay') - self.rate_of_pay = attributes[:'rate_of_pay'] - end - - if attributes.key?(:'pay_frequency') - self.pay_frequency = attributes[:'pay_frequency'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @rate_of_pay.nil? - invalid_properties.push('invalid value for "rate_of_pay", rate_of_pay cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @rate_of_pay.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - rate_of_pay == o.rate_of_pay && - pay_frequency == o.pay_frequency - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, rate_of_pay, pay_frequency].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payroll_income_object.rb b/lib/plaid/models/payroll_income_object.rb deleted file mode 100644 index 6c0d0d023..000000000 --- a/lib/plaid/models/payroll_income_object.rb +++ /dev/null @@ -1,273 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing payroll data. - class PayrollIncomeObject - # ID of the payroll provider account. - attr_accessor :account_id - - # Array of pay stubs for the user. - attr_accessor :pay_stubs - - # Array of tax form W-2s. - attr_accessor :w2s - - # Array of tax form 1099s. - attr_accessor :form1099s - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'pay_stubs' => :'pay_stubs', - :'w2s' => :'w2s', - :'form1099s' => :'form1099s' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'pay_stubs' => :'Array', - :'w2s' => :'Array', - :'form1099s' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PayrollIncomeObject` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PayrollIncomeObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'pay_stubs') - if (value = attributes[:'pay_stubs']).is_a?(Array) - self.pay_stubs = value - end - end - - if attributes.key?(:'w2s') - if (value = attributes[:'w2s']).is_a?(Array) - self.w2s = value - end - end - - if attributes.key?(:'form1099s') - if (value = attributes[:'form1099s']).is_a?(Array) - self.form1099s = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @pay_stubs.nil? - invalid_properties.push('invalid value for "pay_stubs", pay_stubs cannot be nil.') - end - - if @w2s.nil? - invalid_properties.push('invalid value for "w2s", w2s cannot be nil.') - end - - if @form1099s.nil? - invalid_properties.push('invalid value for "form1099s", form1099s cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @pay_stubs.nil? - return false if @w2s.nil? - return false if @form1099s.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - pay_stubs == o.pay_stubs && - w2s == o.w2s && - form1099s == o.form1099s - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, pay_stubs, w2s, form1099s].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payroll_income_rate_of_pay.rb b/lib/plaid/models/payroll_income_rate_of_pay.rb deleted file mode 100644 index d56e24c65..000000000 --- a/lib/plaid/models/payroll_income_rate_of_pay.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing the rate at which an individual is paid. - class PayrollIncomeRateOfPay - # The rate at which an employee is paid. - attr_accessor :pay_rate - - # The amount at which an employee is paid. - attr_accessor :pay_amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pay_rate' => :'pay_rate', - :'pay_amount' => :'pay_amount' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pay_rate' => :'String', - :'pay_amount' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'pay_rate', - :'pay_amount' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PayrollIncomeRateOfPay` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PayrollIncomeRateOfPay`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pay_rate') - self.pay_rate = attributes[:'pay_rate'] - end - - if attributes.key?(:'pay_amount') - self.pay_amount = attributes[:'pay_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pay_rate == o.pay_rate && - pay_amount == o.pay_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pay_rate, pay_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payroll_item.rb b/lib/plaid/models/payroll_item.rb deleted file mode 100644 index 29a6b275d..000000000 --- a/lib/plaid/models/payroll_item.rb +++ /dev/null @@ -1,309 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing information about the payroll item. - class PayrollItem - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - # The unique identifier of the institution associated with the Item. - attr_accessor :institution_id - - # The name of the institution associated with the Item. - attr_accessor :institution_name - - attr_accessor :accounts - - attr_accessor :payroll_income - - attr_accessor :status - - # Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DDTHH:mm:ssZ) indicating the last time that the Item was updated. - attr_accessor :updated_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_id' => :'item_id', - :'institution_id' => :'institution_id', - :'institution_name' => :'institution_name', - :'accounts' => :'accounts', - :'payroll_income' => :'payroll_income', - :'status' => :'status', - :'updated_at' => :'updated_at' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_id' => :'String', - :'institution_id' => :'String', - :'institution_name' => :'String', - :'accounts' => :'Array', - :'payroll_income' => :'Array', - :'status' => :'PayrollItemStatus', - :'updated_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'status', - :'updated_at' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PayrollItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PayrollItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'institution_name') - self.institution_name = attributes[:'institution_name'] - end - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - - if attributes.key?(:'payroll_income') - if (value = attributes[:'payroll_income']).is_a?(Array) - self.payroll_income = value - end - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'updated_at') - self.updated_at = attributes[:'updated_at'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @institution_id.nil? - invalid_properties.push('invalid value for "institution_id", institution_id cannot be nil.') - end - - if @institution_name.nil? - invalid_properties.push('invalid value for "institution_name", institution_name cannot be nil.') - end - - if @accounts.nil? - invalid_properties.push('invalid value for "accounts", accounts cannot be nil.') - end - - if @payroll_income.nil? - invalid_properties.push('invalid value for "payroll_income", payroll_income cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_id.nil? - return false if @institution_id.nil? - return false if @institution_name.nil? - return false if @accounts.nil? - return false if @payroll_income.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_id == o.item_id && - institution_id == o.institution_id && - institution_name == o.institution_name && - accounts == o.accounts && - payroll_income == o.payroll_income && - status == o.status && - updated_at == o.updated_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_id, institution_id, institution_name, accounts, payroll_income, status, updated_at].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payroll_item_status.rb b/lib/plaid/models/payroll_item_status.rb deleted file mode 100644 index bff4ee0e4..000000000 --- a/lib/plaid/models/payroll_item_status.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Details about the status of the payroll item. - class PayrollItemStatus - # Denotes the processing status for the verification. `UNKNOWN`: The processing status could not be determined. `PROCESSING_COMPLETE`: The processing has completed and the user has approved for sharing. The data is available to be retrieved. `PROCESSING`: The verification is still processing. The data is not available yet. `FAILED`: The processing failed to complete successfully. `APPROVAL_STATUS_PENDING`: The processing has completed but the user has not yet approved the sharing of the data. - attr_accessor :processing_status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'processing_status' => :'processing_status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'processing_status' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'processing_status' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PayrollItemStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PayrollItemStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'processing_status') - self.processing_status = attributes[:'processing_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - processing_status == o.processing_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [processing_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/payroll_risk_signals_item.rb b/lib/plaid/models/payroll_risk_signals_item.rb deleted file mode 100644 index 01e1186ef..000000000 --- a/lib/plaid/models/payroll_risk_signals_item.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Object containing fraud risk data pertaining to the Item linked as part of the verification. - class PayrollRiskSignalsItem - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - # Array of payroll income document authenticity data retrieved for each of the user's accounts. - attr_accessor :verification_risk_signals - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_id' => :'item_id', - :'verification_risk_signals' => :'verification_risk_signals' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_id' => :'String', - :'verification_risk_signals' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PayrollRiskSignalsItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PayrollRiskSignalsItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'verification_risk_signals') - if (value = attributes[:'verification_risk_signals']).is_a?(Array) - self.verification_risk_signals = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @verification_risk_signals.nil? - invalid_properties.push('invalid value for "verification_risk_signals", verification_risk_signals cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_id.nil? - return false if @verification_risk_signals.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_id == o.item_id && - verification_risk_signals == o.verification_risk_signals - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_id, verification_risk_signals].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/paystub.rb b/lib/plaid/models/paystub.rb deleted file mode 100644 index 66ca02307..000000000 --- a/lib/plaid/models/paystub.rb +++ /dev/null @@ -1,348 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing data extracted from the end user's paystub. - class Paystub - attr_accessor :deductions - - # An identifier of the document referenced by the document metadata. - attr_accessor :doc_id - - attr_accessor :earnings - - attr_accessor :employee - - attr_accessor :employer - - attr_accessor :employment_details - - attr_accessor :net_pay - - attr_accessor :pay_period_details - - attr_accessor :paystub_details - - attr_accessor :income_breakdown - - attr_accessor :ytd_earnings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'deductions' => :'deductions', - :'doc_id' => :'doc_id', - :'earnings' => :'earnings', - :'employee' => :'employee', - :'employer' => :'employer', - :'employment_details' => :'employment_details', - :'net_pay' => :'net_pay', - :'pay_period_details' => :'pay_period_details', - :'paystub_details' => :'paystub_details', - :'income_breakdown' => :'income_breakdown', - :'ytd_earnings' => :'ytd_earnings' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'deductions' => :'Deductions', - :'doc_id' => :'String', - :'earnings' => :'Earnings', - :'employee' => :'Employee', - :'employer' => :'PaystubEmployer', - :'employment_details' => :'EmploymentDetails', - :'net_pay' => :'NetPay', - :'pay_period_details' => :'PayPeriodDetails', - :'paystub_details' => :'PaystubDetails', - :'income_breakdown' => :'Array', - :'ytd_earnings' => :'PaystubYTDDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Paystub` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Paystub`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'deductions') - self.deductions = attributes[:'deductions'] - end - - if attributes.key?(:'doc_id') - self.doc_id = attributes[:'doc_id'] - end - - if attributes.key?(:'earnings') - self.earnings = attributes[:'earnings'] - end - - if attributes.key?(:'employee') - self.employee = attributes[:'employee'] - end - - if attributes.key?(:'employer') - self.employer = attributes[:'employer'] - end - - if attributes.key?(:'employment_details') - self.employment_details = attributes[:'employment_details'] - end - - if attributes.key?(:'net_pay') - self.net_pay = attributes[:'net_pay'] - end - - if attributes.key?(:'pay_period_details') - self.pay_period_details = attributes[:'pay_period_details'] - end - - if attributes.key?(:'paystub_details') - self.paystub_details = attributes[:'paystub_details'] - end - - if attributes.key?(:'income_breakdown') - if (value = attributes[:'income_breakdown']).is_a?(Array) - self.income_breakdown = value - end - end - - if attributes.key?(:'ytd_earnings') - self.ytd_earnings = attributes[:'ytd_earnings'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @deductions.nil? - invalid_properties.push('invalid value for "deductions", deductions cannot be nil.') - end - - if @doc_id.nil? - invalid_properties.push('invalid value for "doc_id", doc_id cannot be nil.') - end - - if @earnings.nil? - invalid_properties.push('invalid value for "earnings", earnings cannot be nil.') - end - - if @employee.nil? - invalid_properties.push('invalid value for "employee", employee cannot be nil.') - end - - if @employer.nil? - invalid_properties.push('invalid value for "employer", employer cannot be nil.') - end - - if @net_pay.nil? - invalid_properties.push('invalid value for "net_pay", net_pay cannot be nil.') - end - - if @pay_period_details.nil? - invalid_properties.push('invalid value for "pay_period_details", pay_period_details cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @deductions.nil? - return false if @doc_id.nil? - return false if @earnings.nil? - return false if @employee.nil? - return false if @employer.nil? - return false if @net_pay.nil? - return false if @pay_period_details.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - deductions == o.deductions && - doc_id == o.doc_id && - earnings == o.earnings && - employee == o.employee && - employer == o.employer && - employment_details == o.employment_details && - net_pay == o.net_pay && - pay_period_details == o.pay_period_details && - paystub_details == o.paystub_details && - income_breakdown == o.income_breakdown && - ytd_earnings == o.ytd_earnings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [deductions, doc_id, earnings, employee, employer, employment_details, net_pay, pay_period_details, paystub_details, income_breakdown, ytd_earnings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/paystub_address.rb b/lib/plaid/models/paystub_address.rb deleted file mode 100644 index b6b2da507..000000000 --- a/lib/plaid/models/paystub_address.rb +++ /dev/null @@ -1,299 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Address on the paystub - class PaystubAddress - # The full city name. - attr_accessor :city - - # The ISO 3166-1 alpha-2 country code. - attr_accessor :country - - # The postal code of the address. - attr_accessor :postal_code - - # The region or state Example: `\"NC\"` - attr_accessor :region - - # The full street address. - attr_accessor :street - - # Street address line 1. - attr_accessor :line1 - - # Street address line 2. - attr_accessor :line2 - - # The region or state Example: `\"NC\"` - attr_accessor :state_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'country' => :'country', - :'postal_code' => :'postal_code', - :'region' => :'region', - :'street' => :'street', - :'line1' => :'line1', - :'line2' => :'line2', - :'state_code' => :'state_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'country' => :'String', - :'postal_code' => :'String', - :'region' => :'String', - :'street' => :'String', - :'line1' => :'String', - :'line2' => :'String', - :'state_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'city', - :'country', - :'postal_code', - :'region', - :'street', - :'line1', - :'line2', - :'state_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaystubAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaystubAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'line1') - self.line1 = attributes[:'line1'] - end - - if attributes.key?(:'line2') - self.line2 = attributes[:'line2'] - end - - if attributes.key?(:'state_code') - self.state_code = attributes[:'state_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - country == o.country && - postal_code == o.postal_code && - region == o.region && - street == o.street && - line1 == o.line1 && - line2 == o.line2 && - state_code == o.state_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, country, postal_code, region, street, line1, line2, state_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/paystub_deduction.rb b/lib/plaid/models/paystub_deduction.rb deleted file mode 100644 index b09b78dd9..000000000 --- a/lib/plaid/models/paystub_deduction.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Deduction on the paystub - class PaystubDeduction - # The description of the deduction, as provided on the paystub. For example: `\"401(k)\"`, `\"FICA MED TAX\"`. - attr_accessor :type - - # `true` if the deduction is pre-tax; `false` otherwise. - attr_accessor :is_pretax - - # The amount of the deduction. - attr_accessor :total - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'is_pretax' => :'is_pretax', - :'total' => :'total' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'is_pretax' => :'Boolean', - :'total' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'type', - :'is_pretax', - :'total' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaystubDeduction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaystubDeduction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'is_pretax') - self.is_pretax = attributes[:'is_pretax'] - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - is_pretax == o.is_pretax && - total == o.total - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, is_pretax, total].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/paystub_details.rb b/lib/plaid/models/paystub_details.rb deleted file mode 100644 index 56b3995e1..000000000 --- a/lib/plaid/models/paystub_details.rb +++ /dev/null @@ -1,287 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing details that can be found on the paystub. - class PaystubDetails - # Beginning date of the pay period on the paystub in the 'YYYY-MM-DD' format. - attr_accessor :pay_period_start_date - - # Ending date of the pay period on the paystub in the 'YYYY-MM-DD' format. - attr_accessor :pay_period_end_date - - # Pay date on the paystub in the 'YYYY-MM-DD' format. - attr_accessor :pay_date - - # The name of the payroll provider that generated the paystub, e.g. ADP - attr_accessor :paystub_provider - - attr_accessor :pay_frequency - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pay_period_start_date' => :'pay_period_start_date', - :'pay_period_end_date' => :'pay_period_end_date', - :'pay_date' => :'pay_date', - :'paystub_provider' => :'paystub_provider', - :'pay_frequency' => :'pay_frequency' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'pay_period_start_date' => :'Date', - :'pay_period_end_date' => :'Date', - :'pay_date' => :'Date', - :'paystub_provider' => :'String', - :'pay_frequency' => :'PaystubPayFrequency' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'pay_period_start_date', - :'pay_period_end_date', - :'pay_date', - :'paystub_provider', - :'pay_frequency' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaystubDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaystubDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pay_period_start_date') - self.pay_period_start_date = attributes[:'pay_period_start_date'] - end - - if attributes.key?(:'pay_period_end_date') - self.pay_period_end_date = attributes[:'pay_period_end_date'] - end - - if attributes.key?(:'pay_date') - self.pay_date = attributes[:'pay_date'] - end - - if attributes.key?(:'paystub_provider') - self.paystub_provider = attributes[:'paystub_provider'] - end - - if attributes.key?(:'pay_frequency') - self.pay_frequency = attributes[:'pay_frequency'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pay_period_start_date == o.pay_period_start_date && - pay_period_end_date == o.pay_period_end_date && - pay_date == o.pay_date && - paystub_provider == o.paystub_provider && - pay_frequency == o.pay_frequency - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pay_period_start_date, pay_period_end_date, pay_date, paystub_provider, pay_frequency].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/paystub_employer.rb b/lib/plaid/models/paystub_employer.rb deleted file mode 100644 index 2bf0f40fc..000000000 --- a/lib/plaid/models/paystub_employer.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the employer on the paystub - class PaystubEmployer - attr_accessor :address - - # The name of the employer on the paystub. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'address' => :'address', - :'name' => :'name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'address' => :'PaystubAddress', - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaystubEmployer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaystubEmployer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - address == o.address && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [address, name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/paystub_override.rb b/lib/plaid/models/paystub_override.rb deleted file mode 100644 index e68b04c71..000000000 --- a/lib/plaid/models/paystub_override.rb +++ /dev/null @@ -1,249 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing data from a paystub. - class PaystubOverride - attr_accessor :employer - - attr_accessor :employee - - attr_accessor :income_breakdown - - attr_accessor :pay_period_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'employer' => :'employer', - :'employee' => :'employee', - :'income_breakdown' => :'income_breakdown', - :'pay_period_details' => :'pay_period_details' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'employer' => :'PaystubOverrideEmployer', - :'employee' => :'PaystubOverrideEmployee', - :'income_breakdown' => :'Array', - :'pay_period_details' => :'PaystubOverridePayPeriodDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaystubOverride` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaystubOverride`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'employer') - self.employer = attributes[:'employer'] - end - - if attributes.key?(:'employee') - self.employee = attributes[:'employee'] - end - - if attributes.key?(:'income_breakdown') - if (value = attributes[:'income_breakdown']).is_a?(Array) - self.income_breakdown = value - end - end - - if attributes.key?(:'pay_period_details') - self.pay_period_details = attributes[:'pay_period_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - employer == o.employer && - employee == o.employee && - income_breakdown == o.income_breakdown && - pay_period_details == o.pay_period_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [employer, employee, income_breakdown, pay_period_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/paystub_override_distribution_breakdown.rb b/lib/plaid/models/paystub_override_distribution_breakdown.rb deleted file mode 100644 index e69d43775..000000000 --- a/lib/plaid/models/paystub_override_distribution_breakdown.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the accounts that the payment was distributed to. - class PaystubOverrideDistributionBreakdown - # Name of the account for the given distribution. - attr_accessor :account_name - - # The name of the bank that the payment is being deposited to. - attr_accessor :bank_name - - # The amount distributed to this account. - attr_accessor :current_amount - - # The ISO-4217 currency code of the net pay. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :currency - - # The last 2-4 alphanumeric characters of an account's official account number. - attr_accessor :mask - - # Type of the account that the paystub was sent to (e.g. 'checking'). - attr_accessor :type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_name' => :'account_name', - :'bank_name' => :'bank_name', - :'current_amount' => :'current_amount', - :'currency' => :'currency', - :'mask' => :'mask', - :'type' => :'type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_name' => :'String', - :'bank_name' => :'String', - :'current_amount' => :'Float', - :'currency' => :'String', - :'mask' => :'String', - :'type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_name', - :'bank_name', - :'current_amount', - :'currency', - :'mask', - :'type' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaystubOverrideDistributionBreakdown` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaystubOverrideDistributionBreakdown`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_name') - self.account_name = attributes[:'account_name'] - end - - if attributes.key?(:'bank_name') - self.bank_name = attributes[:'bank_name'] - end - - if attributes.key?(:'current_amount') - self.current_amount = attributes[:'current_amount'] - end - - if attributes.key?(:'currency') - self.currency = attributes[:'currency'] - end - - if attributes.key?(:'mask') - self.mask = attributes[:'mask'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_name == o.account_name && - bank_name == o.bank_name && - current_amount == o.current_amount && - currency == o.currency && - mask == o.mask && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_name, bank_name, current_amount, currency, mask, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/paystub_override_employee.rb b/lib/plaid/models/paystub_override_employee.rb deleted file mode 100644 index cbdf0e7e2..000000000 --- a/lib/plaid/models/paystub_override_employee.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The employee on the paystub. - class PaystubOverrideEmployee - # The name of the employee. - attr_accessor :name - - attr_accessor :address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'address' => :'address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'address' => :'PaystubOverrideEmployeeAddress' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaystubOverrideEmployee` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaystubOverrideEmployee`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address == o.address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/paystub_override_employee_address.rb b/lib/plaid/models/paystub_override_employee_address.rb deleted file mode 100644 index 1d36f6ab4..000000000 --- a/lib/plaid/models/paystub_override_employee_address.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The address of the employee. - class PaystubOverrideEmployeeAddress - # The full city name. - attr_accessor :city - - # The region or state Example: `\"NC\"` - attr_accessor :region - - # The full street address Example: `\"564 Main Street, APT 15\"` - attr_accessor :street - - # 5 digit postal code. - attr_accessor :postal_code - - # The country of the address. - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'region' => :'region', - :'street' => :'street', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'region' => :'String', - :'street' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaystubOverrideEmployeeAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaystubOverrideEmployeeAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - region == o.region && - street == o.street && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, region, street, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/paystub_override_employer.rb b/lib/plaid/models/paystub_override_employer.rb deleted file mode 100644 index e232201e2..000000000 --- a/lib/plaid/models/paystub_override_employer.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The employer on the paystub. - class PaystubOverrideEmployer - # The name of the employer. - attr_accessor :name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaystubOverrideEmployer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaystubOverrideEmployer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/paystub_override_pay_period_details.rb b/lib/plaid/models/paystub_override_pay_period_details.rb deleted file mode 100644 index 7a15397fd..000000000 --- a/lib/plaid/models/paystub_override_pay_period_details.rb +++ /dev/null @@ -1,320 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Details about the pay period. - class PaystubOverridePayPeriodDetails - # The amount of the paycheck. - attr_accessor :check_amount - - attr_accessor :distribution_breakdown - - # The pay period end date, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format: \"yyyy-mm-dd\". - attr_accessor :end_date - - # Total earnings before tax/deductions. - attr_accessor :gross_earnings - - # The date on which the paystub was issued, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (\"yyyy-mm-dd\"). - attr_accessor :pay_date - - attr_accessor :pay_frequency - - # The date on which the paystub was issued, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (\"yyyy-mm-dd\"). - attr_accessor :pay_day - - # The pay period start date, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format: \"yyyy-mm-dd\". - attr_accessor :start_date - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'check_amount' => :'check_amount', - :'distribution_breakdown' => :'distribution_breakdown', - :'end_date' => :'end_date', - :'gross_earnings' => :'gross_earnings', - :'pay_date' => :'pay_date', - :'pay_frequency' => :'pay_frequency', - :'pay_day' => :'pay_day', - :'start_date' => :'start_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'check_amount' => :'Float', - :'distribution_breakdown' => :'Array', - :'end_date' => :'Date', - :'gross_earnings' => :'Float', - :'pay_date' => :'Date', - :'pay_frequency' => :'PayPeriodDetailsPayFrequency', - :'pay_day' => :'Date', - :'start_date' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'check_amount', - :'end_date', - :'gross_earnings', - :'pay_date', - :'pay_frequency', - :'pay_day', - :'start_date' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaystubOverridePayPeriodDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaystubOverridePayPeriodDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'check_amount') - self.check_amount = attributes[:'check_amount'] - end - - if attributes.key?(:'distribution_breakdown') - if (value = attributes[:'distribution_breakdown']).is_a?(Array) - self.distribution_breakdown = value - end - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'gross_earnings') - self.gross_earnings = attributes[:'gross_earnings'] - end - - if attributes.key?(:'pay_date') - self.pay_date = attributes[:'pay_date'] - end - - if attributes.key?(:'pay_frequency') - self.pay_frequency = attributes[:'pay_frequency'] - end - - if attributes.key?(:'pay_day') - self.pay_day = attributes[:'pay_day'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - check_amount == o.check_amount && - distribution_breakdown == o.distribution_breakdown && - end_date == o.end_date && - gross_earnings == o.gross_earnings && - pay_date == o.pay_date && - pay_frequency == o.pay_frequency && - pay_day == o.pay_day && - start_date == o.start_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [check_amount, distribution_breakdown, end_date, gross_earnings, pay_date, pay_frequency, pay_day, start_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/paystub_pay_frequency.rb b/lib/plaid/models/paystub_pay_frequency.rb deleted file mode 100644 index 55c2b6f7d..000000000 --- a/lib/plaid/models/paystub_pay_frequency.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PaystubPayFrequency - MONTHLY = "MONTHLY".freeze - BI_WEEKLY = "BI-WEEKLY".freeze - WEEKLY = "WEEKLY".freeze - SEMI_MONTHLY = "SEMI-MONTHLY".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/paystub_ytd_details.rb b/lib/plaid/models/paystub_ytd_details.rb deleted file mode 100644 index de94c2d6e..000000000 --- a/lib/plaid/models/paystub_ytd_details.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The amount of income earned year to date, as based on paystub data. - class PaystubYTDDetails - # Year-to-date gross earnings. - attr_accessor :gross_earnings - - # Year-to-date net (take home) earnings. - attr_accessor :net_earnings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'gross_earnings' => :'gross_earnings', - :'net_earnings' => :'net_earnings' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'gross_earnings' => :'Float', - :'net_earnings' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'gross_earnings', - :'net_earnings' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaystubYTDDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaystubYTDDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'gross_earnings') - self.gross_earnings = attributes[:'gross_earnings'] - end - - if attributes.key?(:'net_earnings') - self.net_earnings = attributes[:'net_earnings'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - gross_earnings == o.gross_earnings && - net_earnings == o.net_earnings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [gross_earnings, net_earnings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/pending_expiration_webhook.rb b/lib/plaid/models/pending_expiration_webhook.rb deleted file mode 100644 index 4ef250b2c..000000000 --- a/lib/plaid/models/pending_expiration_webhook.rb +++ /dev/null @@ -1,307 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class PendingExpirationWebhook - # `ITEM` - attr_accessor :webhook_type - - # `PENDING_EXPIRATION` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - # The date and time at which the Item's access consent will expire, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format - attr_accessor :consent_expiration_time - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'consent_expiration_time' => :'consent_expiration_time', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'consent_expiration_time' => :'Time', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PendingExpirationWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PendingExpirationWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'consent_expiration_time') - self.consent_expiration_time = attributes[:'consent_expiration_time'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @consent_expiration_time.nil? - invalid_properties.push('invalid value for "consent_expiration_time", consent_expiration_time cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @consent_expiration_time.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - consent_expiration_time == o.consent_expiration_time && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, consent_expiration_time, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/personal_finance_category.rb b/lib/plaid/models/personal_finance_category.rb deleted file mode 100644 index ac4379040..000000000 --- a/lib/plaid/models/personal_finance_category.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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/). - class PersonalFinanceCategory - # A high level category that communicates the broad category of the transaction. - attr_accessor :primary - - # A granular category conveying the transaction's intent. This field can also be used as a unique identifier for the category. - attr_accessor :detailed - - # A description of how confident we are that the provided categories accurately describe the transaction intent. `VERY_HIGH`: We are more than 98% confident that this category reflects the intent of the transaction. `HIGH`: We are more than 90% confident that this category reflects the intent of the transaction. `MEDIUM`: We are moderately confident that this category reflects the intent of the transaction. `LOW`: This category may reflect the intent, but there may be other categories that are more accurate. `UNKNOWN`: We don’t know the confidence level for this category. - attr_accessor :confidence_level - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'primary' => :'primary', - :'detailed' => :'detailed', - :'confidence_level' => :'confidence_level' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'primary' => :'String', - :'detailed' => :'String', - :'confidence_level' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'confidence_level' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PersonalFinanceCategory` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PersonalFinanceCategory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'primary') - self.primary = attributes[:'primary'] - end - - if attributes.key?(:'detailed') - self.detailed = attributes[:'detailed'] - end - - if attributes.key?(:'confidence_level') - self.confidence_level = attributes[:'confidence_level'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @primary.nil? - invalid_properties.push('invalid value for "primary", primary cannot be nil.') - end - - if @detailed.nil? - invalid_properties.push('invalid value for "detailed", detailed cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @primary.nil? - return false if @detailed.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - primary == o.primary && - detailed == o.detailed && - confidence_level == o.confidence_level - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [primary, detailed, confidence_level].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/phone_number.rb b/lib/plaid/models/phone_number.rb deleted file mode 100644 index 30b66b576..000000000 --- a/lib/plaid/models/phone_number.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A phone number - class PhoneNumber - # The phone number. - attr_accessor :data - - # When `true`, identifies the phone number as the primary number on an account. - attr_accessor :primary - - # The type of phone number. - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'data' => :'data', - :'primary' => :'primary', - :'type' => :'type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'data' => :'String', - :'primary' => :'Boolean', - :'type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PhoneNumber` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PhoneNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - - if attributes.key?(:'primary') - self.primary = attributes[:'primary'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @data.nil? - invalid_properties.push('invalid value for "data", data cannot be nil.') - end - - if @primary.nil? - invalid_properties.push('invalid value for "primary", primary cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @data.nil? - return false if @primary.nil? - return false if @type.nil? - type_validator = EnumAttributeValidator.new('String', ["home", "work", "office", "mobile", "mobile1", "other"]) - return false unless type_validator.valid?(@type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["home", "work", "office", "mobile", "mobile1", "other"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - data == o.data && - primary == o.primary && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [data, primary, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/phone_number_match_score.rb b/lib/plaid/models/phone_number_match_score.rb deleted file mode 100644 index 4f436d162..000000000 --- a/lib/plaid/models/phone_number_match_score.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Score found by matching phone number provided by the API with the phone number on the account at the financial institution. 100 is a perfect match and 0 is a no match. If the account contains multiple owners, the maximum match score is filled. - class PhoneNumberMatchScore - # Match score for normalized phone number. 100 is a perfect match, 99-70 is a partial match (matching the same phone number with extension against one without extension, etc.), anything below 70 is considered a mismatch. Typically, the match threshold should be set to a score of 70 or higher. If the phone number is missing from either the API or financial institution, this is null. - attr_accessor :score - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'score' => :'score' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'score' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'score' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PhoneNumberMatchScore` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PhoneNumberMatchScore`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'score') - self.score = attributes[:'score'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - score == o.score - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [score].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/phone_type.rb b/lib/plaid/models/phone_type.rb deleted file mode 100644 index ace928d5e..000000000 --- a/lib/plaid/models/phone_type.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PhoneType - PHONE = "phone".freeze - FAX = "fax".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/physical_document_category.rb b/lib/plaid/models/physical_document_category.rb deleted file mode 100644 index 4597a077e..000000000 --- a/lib/plaid/models/physical_document_category.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PhysicalDocumentCategory - DRIVERS_LICENSE = "drivers_license".freeze - ID_CARD = "id_card".freeze - PASSPORT = "passport".freeze - RESIDENCE_PERMIT_CARD = "residence_permit_card".freeze - RESIDENT_CARD = "resident_card".freeze - VISA = "visa".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/physical_document_extracted_data.rb b/lib/plaid/models/physical_document_extracted_data.rb deleted file mode 100644 index a38bf2275..000000000 --- a/lib/plaid/models/physical_document_extracted_data.rb +++ /dev/null @@ -1,337 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data extracted from a user-submitted document. - class PhysicalDocumentExtractedData - # Alpha-numeric ID number extracted via OCR from the user's document image. - attr_accessor :id_number - - attr_accessor :category - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :expiration_date - - # Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :issuing_country - - # An ISO 3166-2 subdivision code. Related terms would be \"state\", \"province\", \"prefecture\", \"zone\", \"subdivision\", etc. - attr_accessor :issuing_region - - # A date extracted from the document in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :date_of_birth - - attr_accessor :address - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id_number' => :'id_number', - :'category' => :'category', - :'expiration_date' => :'expiration_date', - :'issuing_country' => :'issuing_country', - :'issuing_region' => :'issuing_region', - :'date_of_birth' => :'date_of_birth', - :'address' => :'address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id_number' => :'String', - :'category' => :'PhysicalDocumentCategory', - :'expiration_date' => :'Date', - :'issuing_country' => :'String', - :'issuing_region' => :'String', - :'date_of_birth' => :'Date', - :'address' => :'IdentityVerificationDocumentAddressResponse' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'id_number', - :'expiration_date', - :'issuing_region', - :'date_of_birth', - :'address' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PhysicalDocumentExtractedData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PhysicalDocumentExtractedData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id_number') - self.id_number = attributes[:'id_number'] - end - - if attributes.key?(:'category') - self.category = attributes[:'category'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - - if attributes.key?(:'issuing_country') - self.issuing_country = attributes[:'issuing_country'] - end - - if attributes.key?(:'issuing_region') - self.issuing_region = attributes[:'issuing_region'] - end - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @category.nil? - invalid_properties.push('invalid value for "category", category cannot be nil.') - end - - if @issuing_country.nil? - invalid_properties.push('invalid value for "issuing_country", issuing_country cannot be nil.') - end - - if @issuing_country.to_s.length < 2 - invalid_properties.push('invalid value for "issuing_country", the character length must be great than or equal to 2.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @category.nil? - return false if @issuing_country.nil? - return false if @issuing_country.to_s.length < 2 - true - end - - # Custom attribute writer method with validation - # @param [Object] issuing_country Value to be assigned - def issuing_country=(issuing_country) - if issuing_country.nil? - fail ArgumentError, 'issuing_country cannot be nil' - end - - if issuing_country.to_s.length < 2 - fail ArgumentError, 'invalid value for "issuing_country", the character length must be great than or equal to 2.' - end - - - @issuing_country = issuing_country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id_number == o.id_number && - category == o.category && - expiration_date == o.expiration_date && - issuing_country == o.issuing_country && - issuing_region == o.issuing_region && - date_of_birth == o.date_of_birth && - address == o.address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id_number, category, expiration_date, issuing_country, issuing_region, date_of_birth, address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/physical_document_extracted_data_analysis.rb b/lib/plaid/models/physical_document_extracted_data_analysis.rb deleted file mode 100644 index 1fdbf94c1..000000000 --- a/lib/plaid/models/physical_document_extracted_data_analysis.rb +++ /dev/null @@ -1,289 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Analysis of the data extracted from the submitted document. - class PhysicalDocumentExtractedDataAnalysis - attr_accessor :name - - attr_accessor :date_of_birth - - attr_accessor :expiration_date - - attr_accessor :issuing_country - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'date_of_birth' => :'date_of_birth', - :'expiration_date' => :'expiration_date', - :'issuing_country' => :'issuing_country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'DocumentNameMatchCode', - :'date_of_birth' => :'DocumentDateOfBirthMatchCode', - :'expiration_date' => :'ExpirationDate', - :'issuing_country' => :'IssuingCountry' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PhysicalDocumentExtractedDataAnalysis` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PhysicalDocumentExtractedDataAnalysis`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'expiration_date') - self.expiration_date = attributes[:'expiration_date'] - end - - if attributes.key?(:'issuing_country') - self.issuing_country = attributes[:'issuing_country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @date_of_birth.nil? - invalid_properties.push('invalid value for "date_of_birth", date_of_birth cannot be nil.') - end - - if @expiration_date.nil? - invalid_properties.push('invalid value for "expiration_date", expiration_date cannot be nil.') - end - - if @issuing_country.nil? - invalid_properties.push('invalid value for "issuing_country", issuing_country cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @date_of_birth.nil? - return false if @expiration_date.nil? - return false if @issuing_country.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - date_of_birth == o.date_of_birth && - expiration_date == o.expiration_date && - issuing_country == o.issuing_country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, date_of_birth, expiration_date, issuing_country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/physical_document_images.rb b/lib/plaid/models/physical_document_images.rb deleted file mode 100644 index 6131b88a1..000000000 --- a/lib/plaid/models/physical_document_images.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # URLs for downloading original and cropped images for this document submission. The URLs are designed to only allow downloading, not hot linking, so the URL will only serve the document image for 60 seconds before expiring. The expiration time is 60 seconds after the `GET` request for the associated Identity Verification attempt. A new expiring URL is generated with each request, so you can always rerequest the Identity Verification attempt if one of your URLs expires. - class PhysicalDocumentImages - # Temporary URL that expires after 60 seconds for downloading the uncropped original image of the front of the document. - attr_accessor :original_front - - # Temporary URL that expires after 60 seconds for downloading the original image of the back of the document. Might be null if the back of the document was not collected. - attr_accessor :original_back - - # Temporary URL that expires after 60 seconds for downloading a cropped image containing just the front of the document. - attr_accessor :cropped_front - - # Temporary URL that expires after 60 seconds for downloading a cropped image containing just the back of the document. Might be null if the back of the document was not collected. - attr_accessor :cropped_back - - # Temporary URL that expires after 60 seconds for downloading a crop of just the user's face from the document image. Might be null if the document does not contain a face photo. - attr_accessor :face - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'original_front' => :'original_front', - :'original_back' => :'original_back', - :'cropped_front' => :'cropped_front', - :'cropped_back' => :'cropped_back', - :'face' => :'face' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'original_front' => :'String', - :'original_back' => :'String', - :'cropped_front' => :'String', - :'cropped_back' => :'String', - :'face' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'original_front', - :'original_back', - :'cropped_front', - :'cropped_back', - :'face' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PhysicalDocumentImages` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PhysicalDocumentImages`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'original_front') - self.original_front = attributes[:'original_front'] - end - - if attributes.key?(:'original_back') - self.original_back = attributes[:'original_back'] - end - - if attributes.key?(:'cropped_front') - self.cropped_front = attributes[:'cropped_front'] - end - - if attributes.key?(:'cropped_back') - self.cropped_back = attributes[:'cropped_back'] - end - - if attributes.key?(:'face') - self.face = attributes[:'face'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - original_front == o.original_front && - original_back == o.original_back && - cropped_front == o.cropped_front && - cropped_back == o.cropped_back && - face == o.face - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [original_front, original_back, cropped_front, cropped_back, face].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/plaid_error.rb b/lib/plaid/models/plaid_error.rb deleted file mode 100644 index 68eead261..000000000 --- a/lib/plaid/models/plaid_error.rb +++ /dev/null @@ -1,342 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class PlaidError - attr_accessor :error_type - - # The particular error code. Safe for programmatic use. - attr_accessor :error_code - - # A developer-friendly representation of the error code. This may change over time and is not safe for programmatic use. - attr_accessor :error_message - - # 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. - attr_accessor :display_message - - # A unique ID identifying the request, to be used for troubleshooting purposes. This field will be omitted in errors provided by webhooks. - attr_accessor :request_id - - # 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. `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. - attr_accessor :causes - - # The HTTP status code associated with the error. This will only be returned in the response body when the error information is provided via a webhook. - attr_accessor :status - - # The URL of a Plaid documentation page with more information about the error - attr_accessor :documentation_url - - # Suggested steps for resolving the error - attr_accessor :suggested_action - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'error_type' => :'error_type', - :'error_code' => :'error_code', - :'error_message' => :'error_message', - :'display_message' => :'display_message', - :'request_id' => :'request_id', - :'causes' => :'causes', - :'status' => :'status', - :'documentation_url' => :'documentation_url', - :'suggested_action' => :'suggested_action' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'error_type' => :'PlaidErrorType', - :'error_code' => :'String', - :'error_message' => :'String', - :'display_message' => :'String', - :'request_id' => :'String', - :'causes' => :'Array', - :'status' => :'Integer', - :'documentation_url' => :'String', - :'suggested_action' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'display_message', - :'status', - :'suggested_action' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PlaidError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PlaidError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'error_type') - self.error_type = attributes[:'error_type'] - end - - if attributes.key?(:'error_code') - self.error_code = attributes[:'error_code'] - end - - if attributes.key?(:'error_message') - self.error_message = attributes[:'error_message'] - end - - if attributes.key?(:'display_message') - self.display_message = attributes[:'display_message'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'causes') - if (value = attributes[:'causes']).is_a?(Array) - self.causes = value - end - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'documentation_url') - self.documentation_url = attributes[:'documentation_url'] - end - - if attributes.key?(:'suggested_action') - self.suggested_action = attributes[:'suggested_action'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @error_type.nil? - invalid_properties.push('invalid value for "error_type", error_type cannot be nil.') - end - - if @error_code.nil? - invalid_properties.push('invalid value for "error_code", error_code cannot be nil.') - end - - if @error_message.nil? - invalid_properties.push('invalid value for "error_message", error_message cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @error_type.nil? - return false if @error_code.nil? - return false if @error_message.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - error_type == o.error_type && - error_code == o.error_code && - error_message == o.error_message && - display_message == o.display_message && - request_id == o.request_id && - causes == o.causes && - status == o.status && - documentation_url == o.documentation_url && - suggested_action == o.suggested_action - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [error_type, error_code, error_message, display_message, request_id, causes, status, documentation_url, suggested_action].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/plaid_error_type.rb b/lib/plaid/models/plaid_error_type.rb deleted file mode 100644 index bf77d811a..000000000 --- a/lib/plaid/models/plaid_error_type.rb +++ /dev/null @@ -1,51 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PlaidErrorType - INVALID_REQUEST = "INVALID_REQUEST".freeze - INVALID_RESULT = "INVALID_RESULT".freeze - INVALID_INPUT = "INVALID_INPUT".freeze - INSTITUTION_ERROR = "INSTITUTION_ERROR".freeze - RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED".freeze - API_ERROR = "API_ERROR".freeze - ITEM_ERROR = "ITEM_ERROR".freeze - ASSET_REPORT_ERROR = "ASSET_REPORT_ERROR".freeze - RECAPTCHA_ERROR = "RECAPTCHA_ERROR".freeze - OAUTH_ERROR = "OAUTH_ERROR".freeze - PAYMENT_ERROR = "PAYMENT_ERROR".freeze - BANK_TRANSFER_ERROR = "BANK_TRANSFER_ERROR".freeze - INCOME_VERIFICATION_ERROR = "INCOME_VERIFICATION_ERROR".freeze - MICRODEPOSITS_ERROR = "MICRODEPOSITS_ERROR".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/platform_ids.rb b/lib/plaid/models/platform_ids.rb deleted file mode 100644 index 330f0e592..000000000 --- a/lib/plaid/models/platform_ids.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing a set of ids related to an employee - class PlatformIds - # The ID of an employee as given by their employer - attr_accessor :employee_id - - # The ID of an employee as given by their payroll - attr_accessor :payroll_id - - # The ID of the position of the employee - attr_accessor :position_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'employee_id' => :'employee_id', - :'payroll_id' => :'payroll_id', - :'position_id' => :'position_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'employee_id' => :'String', - :'payroll_id' => :'String', - :'position_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'employee_id', - :'payroll_id', - :'position_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PlatformIds` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PlatformIds`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'employee_id') - self.employee_id = attributes[:'employee_id'] - end - - if attributes.key?(:'payroll_id') - self.payroll_id = attributes[:'payroll_id'] - end - - if attributes.key?(:'position_id') - self.position_id = attributes[:'position_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - employee_id == o.employee_id && - payroll_id == o.payroll_id && - position_id == o.position_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [employee_id, payroll_id, position_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/po_box_status.rb b/lib/plaid/models/po_box_status.rb deleted file mode 100644 index d4caea126..000000000 --- a/lib/plaid/models/po_box_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class POBoxStatus - YES = "yes".freeze - NO = "no".freeze - NO_DATA = "no_data".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/prism_cash_score.rb b/lib/plaid/models/prism_cash_score.rb deleted file mode 100644 index 2bc23e9eb..000000000 --- a/lib/plaid/models/prism_cash_score.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The data from the Cash Score product returned by Prism. - class PrismCashScore - # The version of Prism's cash score model used. - attr_accessor :version - - # The score returned by Prism. Ranges from 1-999, with higher score indicating lower risk. - attr_accessor :score - - # The reasons for an individual having risk according to the cash score. - attr_accessor :reason_codes - - attr_accessor :metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'version' => :'version', - :'score' => :'score', - :'reason_codes' => :'reason_codes', - :'metadata' => :'metadata' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'version' => :'Integer', - :'score' => :'Integer', - :'reason_codes' => :'Array', - :'metadata' => :'PrismCashScoreMetadata' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PrismCashScore` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PrismCashScore`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - - if attributes.key?(:'score') - self.score = attributes[:'score'] - end - - if attributes.key?(:'reason_codes') - if (value = attributes[:'reason_codes']).is_a?(Array) - self.reason_codes = value - end - end - - if attributes.key?(:'metadata') - self.metadata = attributes[:'metadata'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @version.nil? - invalid_properties.push('invalid value for "version", version cannot be nil.') - end - - if @score.nil? - invalid_properties.push('invalid value for "score", score cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @version.nil? - return false if @score.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - version == o.version && - score == o.score && - reason_codes == o.reason_codes && - metadata == o.metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [version, score, reason_codes, metadata].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/prism_cash_score_metadata.rb b/lib/plaid/models/prism_cash_score_metadata.rb deleted file mode 100644 index abe3e27d1..000000000 --- a/lib/plaid/models/prism_cash_score_metadata.rb +++ /dev/null @@ -1,321 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing metadata about the provided transactions. - class PrismCashScoreMetadata - # Number of days since the oldest transaction. - attr_accessor :max_age - - # Number of days since the latest transaction. - attr_accessor :min_age - - # Number of days since the latest credit transaction. - attr_accessor :min_age_credit - - # Number of days since the latest debit transaction. - attr_accessor :min_age_debit - - # Number of days since the oldest debit transaction. - attr_accessor :max_age_debit - - # Number of days since the oldest credit transaction. - attr_accessor :max_age_credit - - # Number of credit transactions. - attr_accessor :num_trxn_credit - - # Number of debit transactions. - attr_accessor :num_trxn_debit - - # Number of credit transactions in the last 30 days. - attr_accessor :l1m_credit_value_cnt - - # Number of debit transactions in the last 30 days. - attr_accessor :l1m_debit_value_cnt - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'max_age' => :'max_age', - :'min_age' => :'min_age', - :'min_age_credit' => :'min_age_credit', - :'min_age_debit' => :'min_age_debit', - :'max_age_debit' => :'max_age_debit', - :'max_age_credit' => :'max_age_credit', - :'num_trxn_credit' => :'num_trxn_credit', - :'num_trxn_debit' => :'num_trxn_debit', - :'l1m_credit_value_cnt' => :'l1m_credit_value_cnt', - :'l1m_debit_value_cnt' => :'l1m_debit_value_cnt' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'max_age' => :'Integer', - :'min_age' => :'Integer', - :'min_age_credit' => :'Integer', - :'min_age_debit' => :'Integer', - :'max_age_debit' => :'Integer', - :'max_age_credit' => :'Integer', - :'num_trxn_credit' => :'Integer', - :'num_trxn_debit' => :'Integer', - :'l1m_credit_value_cnt' => :'Integer', - :'l1m_debit_value_cnt' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'max_age', - :'min_age', - :'min_age_credit', - :'min_age_debit', - :'max_age_debit', - :'max_age_credit', - :'num_trxn_credit', - :'num_trxn_debit', - :'l1m_credit_value_cnt', - :'l1m_debit_value_cnt' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PrismCashScoreMetadata` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PrismCashScoreMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'max_age') - self.max_age = attributes[:'max_age'] - end - - if attributes.key?(:'min_age') - self.min_age = attributes[:'min_age'] - end - - if attributes.key?(:'min_age_credit') - self.min_age_credit = attributes[:'min_age_credit'] - end - - if attributes.key?(:'min_age_debit') - self.min_age_debit = attributes[:'min_age_debit'] - end - - if attributes.key?(:'max_age_debit') - self.max_age_debit = attributes[:'max_age_debit'] - end - - if attributes.key?(:'max_age_credit') - self.max_age_credit = attributes[:'max_age_credit'] - end - - if attributes.key?(:'num_trxn_credit') - self.num_trxn_credit = attributes[:'num_trxn_credit'] - end - - if attributes.key?(:'num_trxn_debit') - self.num_trxn_debit = attributes[:'num_trxn_debit'] - end - - if attributes.key?(:'l1m_credit_value_cnt') - self.l1m_credit_value_cnt = attributes[:'l1m_credit_value_cnt'] - end - - if attributes.key?(:'l1m_debit_value_cnt') - self.l1m_debit_value_cnt = attributes[:'l1m_debit_value_cnt'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - max_age == o.max_age && - min_age == o.min_age && - min_age_credit == o.min_age_credit && - min_age_debit == o.min_age_debit && - max_age_debit == o.max_age_debit && - max_age_credit == o.max_age_credit && - num_trxn_credit == o.num_trxn_credit && - num_trxn_debit == o.num_trxn_debit && - l1m_credit_value_cnt == o.l1m_credit_value_cnt && - l1m_debit_value_cnt == o.l1m_debit_value_cnt - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [max_age, min_age, min_age_credit, min_age_debit, max_age_debit, max_age_credit, num_trxn_credit, num_trxn_debit, l1m_credit_value_cnt, l1m_debit_value_cnt].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/prism_detect.rb b/lib/plaid/models/prism_detect.rb deleted file mode 100644 index 63635c51c..000000000 --- a/lib/plaid/models/prism_detect.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The data from the Detect product returned by Prism. - class PrismDetect - # The version of Prism's detect model used. - attr_accessor :version - - # The score returned by Prism. Ranges from 1-999, with higher score indicating lower risk. - attr_accessor :score - - # The reasons for an individual having risk according to the detect cash score. - attr_accessor :reason_codes - - attr_accessor :metadata - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'version' => :'version', - :'score' => :'score', - :'reason_codes' => :'reason_codes', - :'metadata' => :'metadata' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'version' => :'Integer', - :'score' => :'Integer', - :'reason_codes' => :'Array', - :'metadata' => :'PrismCashScoreMetadata' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PrismDetect` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PrismDetect`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - - if attributes.key?(:'score') - self.score = attributes[:'score'] - end - - if attributes.key?(:'reason_codes') - if (value = attributes[:'reason_codes']).is_a?(Array) - self.reason_codes = value - end - end - - if attributes.key?(:'metadata') - self.metadata = attributes[:'metadata'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @version.nil? - invalid_properties.push('invalid value for "version", version cannot be nil.') - end - - if @score.nil? - invalid_properties.push('invalid value for "score", score cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @version.nil? - return false if @score.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - version == o.version && - score == o.score && - reason_codes == o.reason_codes && - metadata == o.metadata - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [version, score, reason_codes, metadata].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/prism_insights.rb b/lib/plaid/models/prism_insights.rb deleted file mode 100644 index 47b95b1e1..000000000 --- a/lib/plaid/models/prism_insights.rb +++ /dev/null @@ -1,236 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The data from the Insights product returned by Prism. - class PrismInsights - # The version of Prism's insights model used. - attr_accessor :version - - # The Insights Result object is a map of cash flow attributes, in string to float format. - attr_accessor :result - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'version' => :'version', - :'result' => :'result' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'version' => :'Integer', - :'result' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PrismInsights` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PrismInsights`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - - if attributes.key?(:'result') - self.result = attributes[:'result'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @version.nil? - invalid_properties.push('invalid value for "version", version cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @version.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - version == o.version && - result == o.result - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [version, result].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/prism_product.rb b/lib/plaid/models/prism_product.rb deleted file mode 100644 index 7daed08f5..000000000 --- a/lib/plaid/models/prism_product.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class PrismProduct - DETECT = "detect".freeze - SCORES = "scores".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/processor_account_get_request.rb b/lib/plaid/models/processor_account_get_request.rb deleted file mode 100644 index f3b73f0fc..000000000 --- a/lib/plaid/models/processor_account_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorAccountGetRequest defines the request schema for `/processor/account/get` - class ProcessorAccountGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'processor_token' => :'processor_token', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'processor_token' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorAccountGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorAccountGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - processor_token == o.processor_token && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, processor_token, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_account_get_response.rb b/lib/plaid/models/processor_account_get_response.rb deleted file mode 100644 index 073eef8de..000000000 --- a/lib/plaid/models/processor_account_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorAccountGetResponse defines the response schema for `/processor/account/get` - class ProcessorAccountGetResponse - attr_accessor :account - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account' => :'account', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account' => :'AccountBase', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorAccountGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorAccountGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account.nil? - invalid_properties.push('invalid value for "account", account cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account == o.account && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_apex_processor_token_create_request.rb b/lib/plaid/models/processor_apex_processor_token_create_request.rb deleted file mode 100644 index 93fe3eabf..000000000 --- a/lib/plaid/models/processor_apex_processor_token_create_request.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorApexProcessorTokenCreateRequest defines the request schema for `/processor/apex/processor_token/create` - class ProcessorApexProcessorTokenCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # The `account_id` value obtained from the `onSuccess` callback in Link - attr_accessor :account_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'account_id' => :'account_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'account_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorApexProcessorTokenCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorApexProcessorTokenCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @account_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - account_id == o.account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_auth_get_request.rb b/lib/plaid/models/processor_auth_get_request.rb deleted file mode 100644 index 869e6151c..000000000 --- a/lib/plaid/models/processor_auth_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorAuthGetRequest defines the request schema for `/processor/auth/get` - class ProcessorAuthGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'processor_token' => :'processor_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'processor_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorAuthGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorAuthGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - processor_token == o.processor_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, processor_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_auth_get_response.rb b/lib/plaid/models/processor_auth_get_response.rb deleted file mode 100644 index 7a8340417..000000000 --- a/lib/plaid/models/processor_auth_get_response.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorAuthGetResponse defines the response schema for `/processor/auth/get` - class ProcessorAuthGetResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - attr_accessor :numbers - - attr_accessor :account - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id', - :'numbers' => :'numbers', - :'account' => :'account' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String', - :'numbers' => :'ProcessorNumber', - :'account' => :'AccountBase' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorAuthGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorAuthGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'numbers') - self.numbers = attributes[:'numbers'] - end - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - if @numbers.nil? - invalid_properties.push('invalid value for "numbers", numbers cannot be nil.') - end - - if @account.nil? - invalid_properties.push('invalid value for "account", account cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - return false if @numbers.nil? - return false if @account.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id && - numbers == o.numbers && - account == o.account - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id, numbers, account].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_balance_get_request.rb b/lib/plaid/models/processor_balance_get_request.rb deleted file mode 100644 index 5ea786be0..000000000 --- a/lib/plaid/models/processor_balance_get_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorBalanceGetRequest defines the request schema for `/processor/balance/get` - class ProcessorBalanceGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'processor_token' => :'processor_token', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'processor_token' => :'String', - :'options' => :'ProcessorBalanceGetRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorBalanceGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorBalanceGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - processor_token == o.processor_token && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, processor_token, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_balance_get_request_options.rb b/lib/plaid/models/processor_balance_get_request_options.rb deleted file mode 100644 index 5e1ab488e..000000000 --- a/lib/plaid/models/processor_balance_get_request_options.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to filter `/processor/balance/get` results. - class 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`. This field is only necessary when the institution is `ins_128026` (Capital One), *and* the account type is a non-depository account (such as a credit card) 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, as well as for depository accounts at Capital One (including all checking and savings accounts) 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. - attr_accessor :min_last_updated_datetime - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'min_last_updated_datetime' => :'min_last_updated_datetime' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'min_last_updated_datetime' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorBalanceGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorBalanceGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'min_last_updated_datetime') - self.min_last_updated_datetime = attributes[:'min_last_updated_datetime'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - min_last_updated_datetime == o.min_last_updated_datetime - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [min_last_updated_datetime].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_balance_get_response.rb b/lib/plaid/models/processor_balance_get_response.rb deleted file mode 100644 index bff6ce211..000000000 --- a/lib/plaid/models/processor_balance_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorBalanceGetResponse defines the response schema for `/processor/balance/get` - class ProcessorBalanceGetResponse - attr_accessor :account - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account' => :'account', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account' => :'AccountBase', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorBalanceGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorBalanceGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account.nil? - invalid_properties.push('invalid value for "account", account cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account == o.account && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_bank_transfer_create_request.rb b/lib/plaid/models/processor_bank_transfer_create_request.rb deleted file mode 100644 index edd835bc0..000000000 --- a/lib/plaid/models/processor_bank_transfer_create_request.rb +++ /dev/null @@ -1,482 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/processor/bank_transfer/create` - class ProcessorBankTransferCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A random key provided by the client, per unique bank transfer. Maximum of 50 characters. The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. For example, if a request to create a bank transfer fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single bank transfer is created. - attr_accessor :idempotency_key - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - attr_accessor :type - - attr_accessor :network - - # The amount of the bank transfer (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :amount - - # The currency of the transfer amount – should be set to \"USD\". - attr_accessor :iso_currency_code - - # The transfer description. Maximum of 10 characters. - attr_accessor :description - - attr_accessor :ach_class - - attr_accessor :user - - # An arbitrary string provided by the client for storage with the bank transfer. May be up to 100 characters. - attr_accessor :custom_tag - - # 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 - attr_accessor :metadata - - # Plaid’s unique identifier for the origination account for this transfer. If you have more than one origination account, this value must be specified. - attr_accessor :origination_account_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'idempotency_key' => :'idempotency_key', - :'processor_token' => :'processor_token', - :'type' => :'type', - :'network' => :'network', - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code', - :'description' => :'description', - :'ach_class' => :'ach_class', - :'user' => :'user', - :'custom_tag' => :'custom_tag', - :'metadata' => :'metadata', - :'origination_account_id' => :'origination_account_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'idempotency_key' => :'String', - :'processor_token' => :'String', - :'type' => :'BankTransferType', - :'network' => :'BankTransferNetwork', - :'amount' => :'String', - :'iso_currency_code' => :'String', - :'description' => :'String', - :'ach_class' => :'ACHClass', - :'user' => :'BankTransferUser', - :'custom_tag' => :'String', - :'metadata' => :'Hash', - :'origination_account_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'custom_tag', - :'metadata', - :'origination_account_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorBankTransferCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorBankTransferCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'idempotency_key') - self.idempotency_key = attributes[:'idempotency_key'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'network') - self.network = attributes[:'network'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'ach_class') - self.ach_class = attributes[:'ach_class'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'custom_tag') - self.custom_tag = attributes[:'custom_tag'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Hash) - self.metadata = value - end - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @idempotency_key.nil? - invalid_properties.push('invalid value for "idempotency_key", idempotency_key cannot be nil.') - end - - if @idempotency_key.to_s.length > 50 - invalid_properties.push('invalid value for "idempotency_key", the character length must be smaller than or equal to 50.') - end - - - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @network.nil? - invalid_properties.push('invalid value for "network", network cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @description.to_s.length > 10 - invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 10.') - end - - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if !@custom_tag.nil? && @custom_tag.to_s.length > 100 - invalid_properties.push('invalid value for "custom_tag", the character length must be smaller than or equal to 100.') - end - - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @idempotency_key.nil? - return false if @idempotency_key.to_s.length > 50 - return false if @processor_token.nil? - return false if @type.nil? - return false if @network.nil? - return false if @amount.nil? - return false if @iso_currency_code.nil? - return false if @description.nil? - return false if @description.to_s.length > 10 - return false if @user.nil? - return false if !@custom_tag.nil? && @custom_tag.to_s.length > 100 - return false if !@metadata.nil? && @metadata.length > 50 - true - end - - # Custom attribute writer method with validation - # @param [Object] idempotency_key Value to be assigned - def idempotency_key=(idempotency_key) - if idempotency_key.nil? - fail ArgumentError, 'idempotency_key cannot be nil' - end - - if idempotency_key.to_s.length > 50 - fail ArgumentError, 'invalid value for "idempotency_key", the character length must be smaller than or equal to 50.' - end - - - @idempotency_key = idempotency_key - end - - # Custom attribute writer method with validation - # @param [Object] description Value to be assigned - def description=(description) - if description.nil? - fail ArgumentError, 'description cannot be nil' - end - - if description.to_s.length > 10 - fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 10.' - end - - - @description = description - end - - # Custom attribute writer method with validation - # @param [Object] custom_tag Value to be assigned - def custom_tag=(custom_tag) - if !custom_tag.nil? && custom_tag.to_s.length > 100 - fail ArgumentError, 'invalid value for "custom_tag", the character length must be smaller than or equal to 100.' - end - - - @custom_tag = custom_tag - end - - # Custom attribute writer method with validation - # @param [Object] metadata Value to be assigned - def metadata=(metadata) - - @metadata = metadata - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - idempotency_key == o.idempotency_key && - processor_token == o.processor_token && - type == o.type && - network == o.network && - amount == o.amount && - iso_currency_code == o.iso_currency_code && - description == o.description && - ach_class == o.ach_class && - user == o.user && - custom_tag == o.custom_tag && - metadata == o.metadata && - origination_account_id == o.origination_account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, idempotency_key, processor_token, type, network, amount, iso_currency_code, description, ach_class, user, custom_tag, metadata, origination_account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_bank_transfer_create_response.rb b/lib/plaid/models/processor_bank_transfer_create_response.rb deleted file mode 100644 index 14f0363e6..000000000 --- a/lib/plaid/models/processor_bank_transfer_create_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/processor/bank_transfer/create` - class ProcessorBankTransferCreateResponse - attr_accessor :bank_transfer - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_transfer' => :'bank_transfer', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_transfer' => :'BankTransfer', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorBankTransferCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorBankTransferCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_transfer') - self.bank_transfer = attributes[:'bank_transfer'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @bank_transfer.nil? - invalid_properties.push('invalid value for "bank_transfer", bank_transfer cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @bank_transfer.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_transfer == o.bank_transfer && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_transfer, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_default_update_webhook.rb b/lib/plaid/models/processor_default_update_webhook.rb deleted file mode 100644 index 0c2026daf..000000000 --- a/lib/plaid/models/processor_default_update_webhook.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class ProcessorDefaultUpdateWebhook - # `TRANSACTIONS` - attr_accessor :webhook_type - - # `DEFAULT_UPDATE` - attr_accessor :webhook_code - - attr_accessor :error - - # The number of new transactions detected since the last time this webhook was fired. - attr_accessor :new_transactions - - # The ID of the account. - attr_accessor :account_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'error' => :'error', - :'new_transactions' => :'new_transactions', - :'account_id' => :'account_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'error' => :'PlaidError', - :'new_transactions' => :'Float', - :'account_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorDefaultUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorDefaultUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'new_transactions') - self.new_transactions = attributes[:'new_transactions'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @new_transactions.nil? - invalid_properties.push('invalid value for "new_transactions", new_transactions cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @new_transactions.nil? - return false if @account_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - error == o.error && - new_transactions == o.new_transactions && - account_id == o.account_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, error, new_transactions, account_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_historical_update_webhook.rb b/lib/plaid/models/processor_historical_update_webhook.rb deleted file mode 100644 index 9c9a37f2c..000000000 --- a/lib/plaid/models/processor_historical_update_webhook.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. 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. - class ProcessorHistoricalUpdateWebhook - # `TRANSACTIONS` - attr_accessor :webhook_type - - # `HISTORICAL_UPDATE` - attr_accessor :webhook_code - - attr_accessor :error - - # The number of new, unfetched transactions available - attr_accessor :new_transactions - - # The ID of the account. - attr_accessor :account_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'error' => :'error', - :'new_transactions' => :'new_transactions', - :'account_id' => :'account_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'error' => :'PlaidError', - :'new_transactions' => :'Float', - :'account_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorHistoricalUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorHistoricalUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'new_transactions') - self.new_transactions = attributes[:'new_transactions'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @new_transactions.nil? - invalid_properties.push('invalid value for "new_transactions", new_transactions cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @new_transactions.nil? - return false if @account_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - error == o.error && - new_transactions == o.new_transactions && - account_id == o.account_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, error, new_transactions, account_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_identity_get_request.rb b/lib/plaid/models/processor_identity_get_request.rb deleted file mode 100644 index 16c61d225..000000000 --- a/lib/plaid/models/processor_identity_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorIdentityGetRequest defines the request schema for `/processor/identity/get` - class ProcessorIdentityGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'processor_token' => :'processor_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'processor_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorIdentityGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorIdentityGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - processor_token == o.processor_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, processor_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_identity_get_response.rb b/lib/plaid/models/processor_identity_get_response.rb deleted file mode 100644 index 61b7cec50..000000000 --- a/lib/plaid/models/processor_identity_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorIdentityGetResponse defines the response schema for `/processor/identity/get` - class ProcessorIdentityGetResponse - attr_accessor :account - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account' => :'account', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account' => :'AccountIdentity', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorIdentityGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorIdentityGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account.nil? - invalid_properties.push('invalid value for "account", account cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account == o.account && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_identity_match_request.rb b/lib/plaid/models/processor_identity_match_request.rb deleted file mode 100644 index 0e8090cb4..000000000 --- a/lib/plaid/models/processor_identity_match_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorIdentityMatchRequest defines the request schema for `/processor/identity/match` - class ProcessorIdentityMatchRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - attr_accessor :user - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'processor_token' => :'processor_token', - :'user' => :'user' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'processor_token' => :'String', - :'user' => :'IdentityMatchUser' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorIdentityMatchRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorIdentityMatchRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - processor_token == o.processor_token && - user == o.user - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, processor_token, user].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_identity_match_response.rb b/lib/plaid/models/processor_identity_match_response.rb deleted file mode 100644 index f06e4e86b..000000000 --- a/lib/plaid/models/processor_identity_match_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorIdentityMatchResponse defines the response schema for `/processor/identity/match` - class ProcessorIdentityMatchResponse - attr_accessor :account - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account' => :'account', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account' => :'AccountIdentityMatchScore', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorIdentityMatchResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorIdentityMatchResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account.nil? - invalid_properties.push('invalid value for "account", account cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account == o.account && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_initial_update_webhook.rb b/lib/plaid/models/processor_initial_update_webhook.rb deleted file mode 100644 index b313f0d80..000000000 --- a/lib/plaid/models/processor_initial_update_webhook.rb +++ /dev/null @@ -1,318 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. 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. - class ProcessorInitialUpdateWebhook - # `TRANSACTIONS` - attr_accessor :webhook_type - - # `INITIAL_UPDATE` - attr_accessor :webhook_code - - # The error code associated with the webhook. - attr_accessor :error - - # The number of new, unfetched transactions available. - attr_accessor :new_transactions - - # The ID of the account. - attr_accessor :account_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'error' => :'error', - :'new_transactions' => :'new_transactions', - :'account_id' => :'account_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'error' => :'String', - :'new_transactions' => :'Float', - :'account_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorInitialUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorInitialUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'new_transactions') - self.new_transactions = attributes[:'new_transactions'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @new_transactions.nil? - invalid_properties.push('invalid value for "new_transactions", new_transactions cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @new_transactions.nil? - return false if @account_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - error == o.error && - new_transactions == o.new_transactions && - account_id == o.account_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, error, new_transactions, account_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_liabilities_get_request.rb b/lib/plaid/models/processor_liabilities_get_request.rb deleted file mode 100644 index ed4cfd70c..000000000 --- a/lib/plaid/models/processor_liabilities_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorLiabilitiesGetRequest defines the request schema for `/processor/liabilities/get` - class ProcessorLiabilitiesGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'processor_token' => :'processor_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'processor_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorLiabilitiesGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorLiabilitiesGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - processor_token == o.processor_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, processor_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_liabilities_get_response.rb b/lib/plaid/models/processor_liabilities_get_response.rb deleted file mode 100644 index 495350f6c..000000000 --- a/lib/plaid/models/processor_liabilities_get_response.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorLiabilitiesGetResponse defines the response schema for `/processor/liabilities/get` - class ProcessorLiabilitiesGetResponse - attr_accessor :account - - attr_accessor :liabilities - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account' => :'account', - :'liabilities' => :'liabilities', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account' => :'AccountBase', - :'liabilities' => :'LiabilitiesObject', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorLiabilitiesGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorLiabilitiesGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'liabilities') - self.liabilities = attributes[:'liabilities'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account.nil? - invalid_properties.push('invalid value for "account", account cannot be nil.') - end - - if @liabilities.nil? - invalid_properties.push('invalid value for "liabilities", liabilities cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account.nil? - return false if @liabilities.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account == o.account && - liabilities == o.liabilities && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account, liabilities, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_number.rb b/lib/plaid/models/processor_number.rb deleted file mode 100644 index d92f467da..000000000 --- a/lib/plaid/models/processor_number.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing identifying numbers used for making electronic transfers to and from the `account`. The identifying number type (ACH, EFT, IBAN, or BACS) used will depend on the country of the account. An account may have more than one number type. If a particular identifying number type is not used by the `account` for which auth data has been requested, a null value will be returned. - class ProcessorNumber - attr_accessor :ach - - attr_accessor :eft - - attr_accessor :international - - attr_accessor :bacs - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ach' => :'ach', - :'eft' => :'eft', - :'international' => :'international', - :'bacs' => :'bacs' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ach' => :'NumbersACHNullable', - :'eft' => :'NumbersEFTNullable', - :'international' => :'NumbersInternationalNullable', - :'bacs' => :'NumbersBACSNullable' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'ach', - :'eft', - :'international', - :'bacs' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorNumber` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ach') - self.ach = attributes[:'ach'] - end - - if attributes.key?(:'eft') - self.eft = attributes[:'eft'] - end - - if attributes.key?(:'international') - self.international = attributes[:'international'] - end - - if attributes.key?(:'bacs') - self.bacs = attributes[:'bacs'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ach == o.ach && - eft == o.eft && - international == o.international && - bacs == o.bacs - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ach, eft, international, bacs].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_recurring_transactions_update_webhook.rb b/lib/plaid/models/processor_recurring_transactions_update_webhook.rb deleted file mode 100644 index 9e1554058..000000000 --- a/lib/plaid/models/processor_recurring_transactions_update_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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`. - class ProcessorRecurringTransactionsUpdateWebhook - # `TRANSACTIONS` - attr_accessor :webhook_type - - # `RECURRING_TRANSACTIONS_UPDATE` - attr_accessor :webhook_code - - # The ID of the account. - attr_accessor :account_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'account_id' => :'account_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'account_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorRecurringTransactionsUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorRecurringTransactionsUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @account_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - account_id == o.account_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, account_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_signal_decision_report_request.rb b/lib/plaid/models/processor_signal_decision_report_request.rb deleted file mode 100644 index 37afe3ae4..000000000 --- a/lib/plaid/models/processor_signal_decision_report_request.rb +++ /dev/null @@ -1,387 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorSignalDecisionReportRequest defines the request schema for `/processor/signal/decision/report` - class ProcessorSignalDecisionReportRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - # Must be the same as the `client_transaction_id` supplied when calling `/signal/evaluate` - attr_accessor :client_transaction_id - - # `true` if the ACH transaction was initiated, `false` otherwise. This field must be returned as a boolean. If formatted incorrectly, this will result in an [`INVALID_FIELD`](/docs/errors/invalid-request/#invalid_field) error. - attr_accessor :initiated - - # The actual number of days (hold time) since the ACH debit transaction that you wait before making funds available to your customers. The holding time could affect the ACH return rate. For example, use 0 if you make funds available to your customers instantly or the same day following the debit transaction, or 1 if you make funds available the next day following the debit initialization. - attr_accessor :days_funds_on_hold - - attr_accessor :decision_outcome - - attr_accessor :payment_method - - # The amount (in USD) made available to your customers instantly following the debit transaction. It could be a partial amount of the requested transaction (example: 102.05). - attr_accessor :amount_instantly_available - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'processor_token' => :'processor_token', - :'client_transaction_id' => :'client_transaction_id', - :'initiated' => :'initiated', - :'days_funds_on_hold' => :'days_funds_on_hold', - :'decision_outcome' => :'decision_outcome', - :'payment_method' => :'payment_method', - :'amount_instantly_available' => :'amount_instantly_available' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'processor_token' => :'String', - :'client_transaction_id' => :'String', - :'initiated' => :'Boolean', - :'days_funds_on_hold' => :'Integer', - :'decision_outcome' => :'SignalDecisionOutcome', - :'payment_method' => :'SignalPaymentMethod', - :'amount_instantly_available' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'days_funds_on_hold', - :'decision_outcome', - :'payment_method', - :'amount_instantly_available' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorSignalDecisionReportRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorSignalDecisionReportRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - - if attributes.key?(:'client_transaction_id') - self.client_transaction_id = attributes[:'client_transaction_id'] - end - - if attributes.key?(:'initiated') - self.initiated = attributes[:'initiated'] - end - - if attributes.key?(:'days_funds_on_hold') - self.days_funds_on_hold = attributes[:'days_funds_on_hold'] - end - - if attributes.key?(:'decision_outcome') - self.decision_outcome = attributes[:'decision_outcome'] - end - - if attributes.key?(:'payment_method') - self.payment_method = attributes[:'payment_method'] - end - - if attributes.key?(:'amount_instantly_available') - self.amount_instantly_available = attributes[:'amount_instantly_available'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - if @client_transaction_id.nil? - invalid_properties.push('invalid value for "client_transaction_id", client_transaction_id cannot be nil.') - end - - if @client_transaction_id.to_s.length > 36 - invalid_properties.push('invalid value for "client_transaction_id", the character length must be smaller than or equal to 36.') - end - - if @client_transaction_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_transaction_id", the character length must be great than or equal to 1.') - end - - - if @initiated.nil? - invalid_properties.push('invalid value for "initiated", initiated cannot be nil.') - end - - if !@days_funds_on_hold.nil? && @days_funds_on_hold < 0 - invalid_properties.push('invalid value for "days_funds_on_hold", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - return false if @client_transaction_id.nil? - return false if @client_transaction_id.to_s.length > 36 - return false if @client_transaction_id.to_s.length < 1 - return false if @initiated.nil? - return false if !@days_funds_on_hold.nil? && @days_funds_on_hold < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] client_transaction_id Value to be assigned - def client_transaction_id=(client_transaction_id) - if client_transaction_id.nil? - fail ArgumentError, 'client_transaction_id cannot be nil' - end - - if client_transaction_id.to_s.length > 36 - fail ArgumentError, 'invalid value for "client_transaction_id", the character length must be smaller than or equal to 36.' - end - - if client_transaction_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_transaction_id", the character length must be great than or equal to 1.' - end - - - @client_transaction_id = client_transaction_id - end - - # Custom attribute writer method with validation - # @param [Object] days_funds_on_hold Value to be assigned - def days_funds_on_hold=(days_funds_on_hold) - if !days_funds_on_hold.nil? && days_funds_on_hold < 0 - fail ArgumentError, 'invalid value for "days_funds_on_hold", must be greater than or equal to 0.' - end - - - @days_funds_on_hold = days_funds_on_hold - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - processor_token == o.processor_token && - client_transaction_id == o.client_transaction_id && - initiated == o.initiated && - days_funds_on_hold == o.days_funds_on_hold && - decision_outcome == o.decision_outcome && - payment_method == o.payment_method && - amount_instantly_available == o.amount_instantly_available - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, processor_token, client_transaction_id, initiated, days_funds_on_hold, decision_outcome, payment_method, amount_instantly_available].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_signal_decision_report_response.rb b/lib/plaid/models/processor_signal_decision_report_response.rb deleted file mode 100644 index 4b98c1f54..000000000 --- a/lib/plaid/models/processor_signal_decision_report_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorSignalDecisionReportResponse defines the response schema for `/processor/signal/decision/report` - class ProcessorSignalDecisionReportResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorSignalDecisionReportResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorSignalDecisionReportResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_signal_evaluate_request.rb b/lib/plaid/models/processor_signal_evaluate_request.rb deleted file mode 100644 index b1f0da587..000000000 --- a/lib/plaid/models/processor_signal_evaluate_request.rb +++ /dev/null @@ -1,367 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorSignalEvaluateRequest defines the request schema for `/processor/signal/evaluate` - class ProcessorSignalEvaluateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - # 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 ID/identifier for this transaction. The max length for this field is 36 characters. - attr_accessor :client_transaction_id - - # The transaction amount, in USD (e.g. `102.05`) - attr_accessor :amount - - # `true` if the end user is present while initiating the ACH transfer and the endpoint is being called; `false` otherwise (for example, when the ACH transfer is scheduled and the end user is not present, or you call this endpoint after the ACH transfer but before submitting the Nacha file for ACH processing). - attr_accessor :user_present - - # A unique ID that identifies the end user in your system. This ID is used to correlate requests by a user with multiple Items. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`. - attr_accessor :client_user_id - - # **true** if the ACH transaction is a recurring transaction; **false** otherwise - attr_accessor :is_recurring - - # The default ACH or non-ACH payment method to complete the transaction. `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` - attr_accessor :default_payment_method - - attr_accessor :user - - attr_accessor :device - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'processor_token' => :'processor_token', - :'client_transaction_id' => :'client_transaction_id', - :'amount' => :'amount', - :'user_present' => :'user_present', - :'client_user_id' => :'client_user_id', - :'is_recurring' => :'is_recurring', - :'default_payment_method' => :'default_payment_method', - :'user' => :'user', - :'device' => :'device' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'processor_token' => :'String', - :'client_transaction_id' => :'String', - :'amount' => :'Float', - :'user_present' => :'Boolean', - :'client_user_id' => :'String', - :'is_recurring' => :'Boolean', - :'default_payment_method' => :'String', - :'user' => :'SignalUser', - :'device' => :'SignalDevice' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'user_present', - :'is_recurring', - :'default_payment_method', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorSignalEvaluateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorSignalEvaluateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - - if attributes.key?(:'client_transaction_id') - self.client_transaction_id = attributes[:'client_transaction_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'user_present') - self.user_present = attributes[:'user_present'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'is_recurring') - self.is_recurring = attributes[:'is_recurring'] - end - - if attributes.key?(:'default_payment_method') - self.default_payment_method = attributes[:'default_payment_method'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'device') - self.device = attributes[:'device'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - if @client_transaction_id.nil? - invalid_properties.push('invalid value for "client_transaction_id", client_transaction_id cannot be nil.') - end - - if @client_transaction_id.to_s.length > 36 - invalid_properties.push('invalid value for "client_transaction_id", the character length must be smaller than or equal to 36.') - end - - if @client_transaction_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_transaction_id", the character length must be great than or equal to 1.') - end - - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - return false if @client_transaction_id.nil? - return false if @client_transaction_id.to_s.length > 36 - return false if @client_transaction_id.to_s.length < 1 - return false if @amount.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_transaction_id Value to be assigned - def client_transaction_id=(client_transaction_id) - if client_transaction_id.nil? - fail ArgumentError, 'client_transaction_id cannot be nil' - end - - if client_transaction_id.to_s.length > 36 - fail ArgumentError, 'invalid value for "client_transaction_id", the character length must be smaller than or equal to 36.' - end - - if client_transaction_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_transaction_id", the character length must be great than or equal to 1.' - end - - - @client_transaction_id = client_transaction_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - processor_token == o.processor_token && - client_transaction_id == o.client_transaction_id && - amount == o.amount && - user_present == o.user_present && - client_user_id == o.client_user_id && - is_recurring == o.is_recurring && - default_payment_method == o.default_payment_method && - user == o.user && - device == o.device - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, processor_token, client_transaction_id, amount, user_present, client_user_id, is_recurring, default_payment_method, user, device].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_signal_evaluate_response.rb b/lib/plaid/models/processor_signal_evaluate_response.rb deleted file mode 100644 index d13bd50b3..000000000 --- a/lib/plaid/models/processor_signal_evaluate_response.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorSignalEvaluateResponse defines the response schema for `/processor/signal/evaluate` - class ProcessorSignalEvaluateResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - attr_accessor :scores - - attr_accessor :core_attributes - - # 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. - attr_accessor :warnings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id', - :'scores' => :'scores', - :'core_attributes' => :'core_attributes', - :'warnings' => :'warnings' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String', - :'scores' => :'SignalScores', - :'core_attributes' => :'SignalEvaluateCoreAttributes', - :'warnings' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorSignalEvaluateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorSignalEvaluateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'scores') - self.scores = attributes[:'scores'] - end - - if attributes.key?(:'core_attributes') - self.core_attributes = attributes[:'core_attributes'] - end - - if attributes.key?(:'warnings') - if (value = attributes[:'warnings']).is_a?(Array) - self.warnings = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - if @scores.nil? - invalid_properties.push('invalid value for "scores", scores cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - return false if @scores.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id && - scores == o.scores && - core_attributes == o.core_attributes && - warnings == o.warnings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id, scores, core_attributes, warnings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_signal_prepare_request.rb b/lib/plaid/models/processor_signal_prepare_request.rb deleted file mode 100644 index a6c680713..000000000 --- a/lib/plaid/models/processor_signal_prepare_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorSignalPrepareRequest defines the request schema for `/processor/signal/prepare` - class ProcessorSignalPrepareRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'processor_token' => :'processor_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'processor_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorSignalPrepareRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorSignalPrepareRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - processor_token == o.processor_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, processor_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_signal_prepare_response.rb b/lib/plaid/models/processor_signal_prepare_response.rb deleted file mode 100644 index 18bac1ef4..000000000 --- a/lib/plaid/models/processor_signal_prepare_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorSignalPrepareResponse defines the response schema for `/processor/signal/prepare` - class ProcessorSignalPrepareResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorSignalPrepareResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorSignalPrepareResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_signal_return_report_request.rb b/lib/plaid/models/processor_signal_return_report_request.rb deleted file mode 100644 index a307916dc..000000000 --- a/lib/plaid/models/processor_signal_return_report_request.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorSignalReturnReportRequest defines the request schema for `/processor/signal/return/report` - class ProcessorSignalReturnReportRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - # Must be the same as the `client_transaction_id` supplied when calling `/processor/signal/evaluate` - attr_accessor :client_transaction_id - - # Must be a valid ACH return code (e.g. \"R01\") If formatted incorrectly, this will result in an [`INVALID_FIELD`](/docs/errors/invalid-request/#invalid_field) error. - attr_accessor :return_code - - # Date and time when you receive the returns from your payment processors, in ISO 8601 format (`YYYY-MM-DDTHH:mm:ssZ`). - attr_accessor :returned_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'processor_token' => :'processor_token', - :'client_transaction_id' => :'client_transaction_id', - :'return_code' => :'return_code', - :'returned_at' => :'returned_at' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'processor_token' => :'String', - :'client_transaction_id' => :'String', - :'return_code' => :'String', - :'returned_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'returned_at' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorSignalReturnReportRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorSignalReturnReportRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - - if attributes.key?(:'client_transaction_id') - self.client_transaction_id = attributes[:'client_transaction_id'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'returned_at') - self.returned_at = attributes[:'returned_at'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - if @client_transaction_id.nil? - invalid_properties.push('invalid value for "client_transaction_id", client_transaction_id cannot be nil.') - end - - if @client_transaction_id.to_s.length > 36 - invalid_properties.push('invalid value for "client_transaction_id", the character length must be smaller than or equal to 36.') - end - - if @client_transaction_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_transaction_id", the character length must be great than or equal to 1.') - end - - - if @return_code.nil? - invalid_properties.push('invalid value for "return_code", return_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - return false if @client_transaction_id.nil? - return false if @client_transaction_id.to_s.length > 36 - return false if @client_transaction_id.to_s.length < 1 - return false if @return_code.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_transaction_id Value to be assigned - def client_transaction_id=(client_transaction_id) - if client_transaction_id.nil? - fail ArgumentError, 'client_transaction_id cannot be nil' - end - - if client_transaction_id.to_s.length > 36 - fail ArgumentError, 'invalid value for "client_transaction_id", the character length must be smaller than or equal to 36.' - end - - if client_transaction_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_transaction_id", the character length must be great than or equal to 1.' - end - - - @client_transaction_id = client_transaction_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - processor_token == o.processor_token && - client_transaction_id == o.client_transaction_id && - return_code == o.return_code && - returned_at == o.returned_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, processor_token, client_transaction_id, return_code, returned_at].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_signal_return_report_response.rb b/lib/plaid/models/processor_signal_return_report_response.rb deleted file mode 100644 index 313deb014..000000000 --- a/lib/plaid/models/processor_signal_return_report_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorSignalReturnReportResponse defines the response schema for `/processor/signal/return/report` - class ProcessorSignalReturnReportResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorSignalReturnReportResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorSignalReturnReportResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_stripe_bank_account_token_create_request.rb b/lib/plaid/models/processor_stripe_bank_account_token_create_request.rb deleted file mode 100644 index 9f0e3af7a..000000000 --- a/lib/plaid/models/processor_stripe_bank_account_token_create_request.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorStripeBankAccountTokenCreateRequest defines the request schema for `/processor/stripe/bank_account/create` - class ProcessorStripeBankAccountTokenCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # The `account_id` value obtained from the `onSuccess` callback in Link - attr_accessor :account_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'account_id' => :'account_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'account_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorStripeBankAccountTokenCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorStripeBankAccountTokenCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @account_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - account_id == o.account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_stripe_bank_account_token_create_response.rb b/lib/plaid/models/processor_stripe_bank_account_token_create_response.rb deleted file mode 100644 index aa465f902..000000000 --- a/lib/plaid/models/processor_stripe_bank_account_token_create_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorStripeBankAccountTokenCreateResponse defines the response schema for `/processor/stripe/bank_account/create` - class ProcessorStripeBankAccountTokenCreateResponse - # A token that can be sent to Stripe for use in making API calls to Plaid - attr_accessor :stripe_bank_account_token - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'stripe_bank_account_token' => :'stripe_bank_account_token', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'stripe_bank_account_token' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorStripeBankAccountTokenCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorStripeBankAccountTokenCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'stripe_bank_account_token') - self.stripe_bank_account_token = attributes[:'stripe_bank_account_token'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @stripe_bank_account_token.nil? - invalid_properties.push('invalid value for "stripe_bank_account_token", stripe_bank_account_token cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @stripe_bank_account_token.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - stripe_bank_account_token == o.stripe_bank_account_token && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [stripe_bank_account_token, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_sync_updates_available_webhook.rb b/lib/plaid/models/processor_sync_updates_available_webhook.rb deleted file mode 100644 index dc44958cc..000000000 --- a/lib/plaid/models/processor_sync_updates_available_webhook.rb +++ /dev/null @@ -1,322 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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`. After receipt of this webhook, the new changes can be fetched for the Item from `/processor/transactions/sync`. 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`. - class ProcessorSyncUpdatesAvailableWebhook - # `TRANSACTIONS` - attr_accessor :webhook_type - - # `SYNC_UPDATES_AVAILABLE` - attr_accessor :webhook_code - - # The ID of the account. - attr_accessor :account_id - - # Indicates if initial pull information is available. - attr_accessor :initial_update_complete - - # Indicates if historical pull information is available. - attr_accessor :historical_update_complete - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'account_id' => :'account_id', - :'initial_update_complete' => :'initial_update_complete', - :'historical_update_complete' => :'historical_update_complete', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'account_id' => :'String', - :'initial_update_complete' => :'Boolean', - :'historical_update_complete' => :'Boolean', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorSyncUpdatesAvailableWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorSyncUpdatesAvailableWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'initial_update_complete') - self.initial_update_complete = attributes[:'initial_update_complete'] - end - - if attributes.key?(:'historical_update_complete') - self.historical_update_complete = attributes[:'historical_update_complete'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @initial_update_complete.nil? - invalid_properties.push('invalid value for "initial_update_complete", initial_update_complete cannot be nil.') - end - - if @historical_update_complete.nil? - invalid_properties.push('invalid value for "historical_update_complete", historical_update_complete cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @account_id.nil? - return false if @initial_update_complete.nil? - return false if @historical_update_complete.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - account_id == o.account_id && - initial_update_complete == o.initial_update_complete && - historical_update_complete == o.historical_update_complete && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, account_id, initial_update_complete, historical_update_complete, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_token_create_request.rb b/lib/plaid/models/processor_token_create_request.rb deleted file mode 100644 index 5aaca7108..000000000 --- a/lib/plaid/models/processor_token_create_request.rb +++ /dev/null @@ -1,310 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTokenCreateRequest defines the request schema for `/processor/token/create` - class ProcessorTokenCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # The `account_id` value obtained from the `onSuccess` callback in Link - attr_accessor :account_id - - # The processor you are integrating with. - attr_accessor :processor - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'account_id' => :'account_id', - :'processor' => :'processor' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'account_id' => :'String', - :'processor' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTokenCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTokenCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'processor') - self.processor = attributes[:'processor'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @processor.nil? - invalid_properties.push('invalid value for "processor", processor cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @account_id.nil? - return false if @processor.nil? - processor_validator = EnumAttributeValidator.new('String', ["dwolla", "galileo", "modern_treasury", "ocrolus", "prime_trust", "vesta", "drivewealth", "vopay", "achq", "check", "checkbook", "circle", "sila_money", "rize", "svb_api", "unit", "wyre", "lithic", "alpaca", "astra", "moov", "treasury_prime", "marqeta", "checkout", "solid", "highnote", "gemini", "apex_clearing", "gusto", "adyen", "atomic", "i2c", "wepay", "riskified", "utb", "adp_roll", "fortress_trust", "bond", "bakkt", "teal", "zero_hash", "taba_pay", "knot", "sardine", "alloy", "finix"]) - return false unless processor_validator.valid?(@processor) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] processor Object to be assigned - def processor=(processor) - validator = EnumAttributeValidator.new('String', ["dwolla", "galileo", "modern_treasury", "ocrolus", "prime_trust", "vesta", "drivewealth", "vopay", "achq", "check", "checkbook", "circle", "sila_money", "rize", "svb_api", "unit", "wyre", "lithic", "alpaca", "astra", "moov", "treasury_prime", "marqeta", "checkout", "solid", "highnote", "gemini", "apex_clearing", "gusto", "adyen", "atomic", "i2c", "wepay", "riskified", "utb", "adp_roll", "fortress_trust", "bond", "bakkt", "teal", "zero_hash", "taba_pay", "knot", "sardine", "alloy", "finix"]) - unless validator.valid?(processor) - fail ArgumentError, "invalid value for \"processor\", must be one of #{validator.allowable_values}." - end - @processor = processor - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - account_id == o.account_id && - processor == o.processor - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, account_id, processor].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_token_create_response.rb b/lib/plaid/models/processor_token_create_response.rb deleted file mode 100644 index fdeb83446..000000000 --- a/lib/plaid/models/processor_token_create_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTokenCreateResponse defines the response schema for `/processor/token/create` and `/processor/apex/processor_token/create` - class ProcessorTokenCreateResponse - # The `processor_token` that can then be used by the Plaid partner to make API requests - attr_accessor :processor_token - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'processor_token' => :'processor_token', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'processor_token' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTokenCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTokenCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - processor_token == o.processor_token && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [processor_token, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_token_permissions_get_request.rb b/lib/plaid/models/processor_token_permissions_get_request.rb deleted file mode 100644 index 881d7ce72..000000000 --- a/lib/plaid/models/processor_token_permissions_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTokenPermissionsGetRequest defines the request schema for `/processor/token/permissions/get` - class ProcessorTokenPermissionsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'processor_token' => :'processor_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'processor_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTokenPermissionsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTokenPermissionsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - processor_token == o.processor_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, processor_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_token_permissions_get_response.rb b/lib/plaid/models/processor_token_permissions_get_response.rb deleted file mode 100644 index f3925909d..000000000 --- a/lib/plaid/models/processor_token_permissions_get_response.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTokenPermissionsGetResponse defines the response schema for `/processor/token/permissions/get` - class ProcessorTokenPermissionsGetResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # 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. - attr_accessor :products - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id', - :'products' => :'products' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String', - :'products' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTokenPermissionsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTokenPermissionsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'products') - if (value = attributes[:'products']).is_a?(Array) - self.products = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - if @products.nil? - invalid_properties.push('invalid value for "products", products cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - return false if @products.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id && - products == o.products - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id, products].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_token_permissions_set_request.rb b/lib/plaid/models/processor_token_permissions_set_request.rb deleted file mode 100644 index 00fac32c3..000000000 --- a/lib/plaid/models/processor_token_permissions_set_request.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTokenPermissionsSetRequest defines the request schema for `/processor/token/permissions/set` - class ProcessorTokenPermissionsSetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - # A list of products the processor token should have access to. An empty list will grant access to all products. - attr_accessor :products - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'processor_token' => :'processor_token', - :'products' => :'products' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'processor_token' => :'String', - :'products' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTokenPermissionsSetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTokenPermissionsSetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - - if attributes.key?(:'products') - if (value = attributes[:'products']).is_a?(Array) - self.products = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - if @products.nil? - invalid_properties.push('invalid value for "products", products cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - return false if @products.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - processor_token == o.processor_token && - products == o.products - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, processor_token, products].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_token_permissions_set_response.rb b/lib/plaid/models/processor_token_permissions_set_response.rb deleted file mode 100644 index 443fe5e91..000000000 --- a/lib/plaid/models/processor_token_permissions_set_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTokenPermissionsSetResponse defines the response schema for `/processor/token/permissions/set` - class ProcessorTokenPermissionsSetResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTokenPermissionsSetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTokenPermissionsSetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_token_webhook_update.rb b/lib/plaid/models/processor_token_webhook_update.rb deleted file mode 100644 index 86915566d..000000000 --- a/lib/plaid/models/processor_token_webhook_update.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # This webhook is only sent to [Plaid processor partners](https://plaid.com/docs/auth/partnerships/). Fired when a processor updates the webhook URL for a processor token via `/processor/token/webhook/update`. - class ProcessorTokenWebhookUpdate - # `PROCESSOR_TOKEN` - attr_accessor :webhook_type - - # `WEBHOOK_UPDATE_ACKNOWLEDGED` - attr_accessor :webhook_code - - attr_accessor :error - - # The ID of the account. - attr_accessor :account_id - - # The new webhook URL. - attr_accessor :new_webhook_url - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'error' => :'error', - :'account_id' => :'account_id', - :'new_webhook_url' => :'new_webhook_url', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'error' => :'PlaidError', - :'account_id' => :'String', - :'new_webhook_url' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTokenWebhookUpdate` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTokenWebhookUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'new_webhook_url') - self.new_webhook_url = attributes[:'new_webhook_url'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @new_webhook_url.nil? - invalid_properties.push('invalid value for "new_webhook_url", new_webhook_url cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @account_id.nil? - return false if @new_webhook_url.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - error == o.error && - account_id == o.account_id && - new_webhook_url == o.new_webhook_url && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, error, account_id, new_webhook_url, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_token_webhook_update_request.rb b/lib/plaid/models/processor_token_webhook_update_request.rb deleted file mode 100644 index ea0a6cbc3..000000000 --- a/lib/plaid/models/processor_token_webhook_update_request.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTokenWebhookUpdateRequest defines the request schema for `/processor/token/webhook/update` - class ProcessorTokenWebhookUpdateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - # The new webhook URL to associate with the processor token. To remove a webhook from a processor token, set to `null`. - attr_accessor :webhook - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'processor_token' => :'processor_token', - :'webhook' => :'webhook' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'processor_token' => :'String', - :'webhook' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'webhook' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTokenWebhookUpdateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTokenWebhookUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - processor_token == o.processor_token && - webhook == o.webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, processor_token, webhook].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_token_webhook_update_response.rb b/lib/plaid/models/processor_token_webhook_update_response.rb deleted file mode 100644 index 3d2fca4cf..000000000 --- a/lib/plaid/models/processor_token_webhook_update_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTokenWebhookUpdateResponse defines the response schema for `/processor/token/webhook/update` - class ProcessorTokenWebhookUpdateResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTokenWebhookUpdateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTokenWebhookUpdateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_transactions_get_request.rb b/lib/plaid/models/processor_transactions_get_request.rb deleted file mode 100644 index 5eaeb94cc..000000000 --- a/lib/plaid/models/processor_transactions_get_request.rb +++ /dev/null @@ -1,285 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTransactionsGetRequest defines the request schema for `/processor/transactions/get` - class ProcessorTransactionsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - attr_accessor :options - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The earliest date for which data should be returned. Dates should be formatted as YYYY-MM-DD. - attr_accessor :start_date - - # The latest date for which data should be returned. Dates should be formatted as YYYY-MM-DD. - attr_accessor :end_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'options' => :'options', - :'processor_token' => :'processor_token', - :'secret' => :'secret', - :'start_date' => :'start_date', - :'end_date' => :'end_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'options' => :'ProcessorTransactionsGetRequestOptions', - :'processor_token' => :'String', - :'secret' => :'String', - :'start_date' => :'Date', - :'end_date' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTransactionsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTransactionsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - if @start_date.nil? - invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') - end - - if @end_date.nil? - invalid_properties.push('invalid value for "end_date", end_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - return false if @start_date.nil? - return false if @end_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - options == o.options && - processor_token == o.processor_token && - secret == o.secret && - start_date == o.start_date && - end_date == o.end_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, options, processor_token, secret, start_date, end_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_transactions_get_request_options.rb b/lib/plaid/models/processor_transactions_get_request_options.rb deleted file mode 100644 index dd1eaf401..000000000 --- a/lib/plaid/models/processor_transactions_get_request_options.rb +++ /dev/null @@ -1,327 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to be used with the request. If specified, `options` must not be `null`. - class ProcessorTransactionsGetRequestOptions - # The number of transactions to fetch. - attr_accessor :count - - # The number of transactions to skip. The default value is 0. - attr_accessor :offset - - # 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). - attr_accessor :include_original_description - - # Personal finance categories are now returned by default. - attr_accessor :include_personal_finance_category_beta - - # Personal finance categories are now returned by default. - attr_accessor :include_personal_finance_category - - # Counterparties and extra merchant fields are now returned by default. - attr_accessor :include_logo_and_counterparty_beta - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'count' => :'count', - :'offset' => :'offset', - :'include_original_description' => :'include_original_description', - :'include_personal_finance_category_beta' => :'include_personal_finance_category_beta', - :'include_personal_finance_category' => :'include_personal_finance_category', - :'include_logo_and_counterparty_beta' => :'include_logo_and_counterparty_beta' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'count' => :'Integer', - :'offset' => :'Integer', - :'include_original_description' => :'Boolean', - :'include_personal_finance_category_beta' => :'Boolean', - :'include_personal_finance_category' => :'Boolean', - :'include_logo_and_counterparty_beta' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'include_original_description', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTransactionsGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTransactionsGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 100 - end - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - else - self.offset = 0 - end - - if attributes.key?(:'include_original_description') - self.include_original_description = attributes[:'include_original_description'] - else - self.include_original_description = false - end - - if attributes.key?(:'include_personal_finance_category_beta') - self.include_personal_finance_category_beta = attributes[:'include_personal_finance_category_beta'] - else - self.include_personal_finance_category_beta = false - end - - if attributes.key?(:'include_personal_finance_category') - self.include_personal_finance_category = attributes[:'include_personal_finance_category'] - else - self.include_personal_finance_category = false - end - - if attributes.key?(:'include_logo_and_counterparty_beta') - self.include_logo_and_counterparty_beta = attributes[:'include_logo_and_counterparty_beta'] - else - self.include_logo_and_counterparty_beta = false - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@count.nil? && @count > 500 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 500.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - if !@offset.nil? && @offset < 0 - invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@count.nil? && @count > 500 - return false if !@count.nil? && @count < 1 - return false if !@offset.nil? && @offset < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 500 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 500.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Custom attribute writer method with validation - # @param [Object] offset Value to be assigned - def offset=(offset) - if !offset.nil? && offset < 0 - fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.' - end - - - @offset = offset - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - count == o.count && - offset == o.offset && - include_original_description == o.include_original_description && - include_personal_finance_category_beta == o.include_personal_finance_category_beta && - include_personal_finance_category == o.include_personal_finance_category && - include_logo_and_counterparty_beta == o.include_logo_and_counterparty_beta - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [count, offset, include_original_description, include_personal_finance_category_beta, include_personal_finance_category, include_logo_and_counterparty_beta].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_transactions_get_response.rb b/lib/plaid/models/processor_transactions_get_response.rb deleted file mode 100644 index 8e252bad8..000000000 --- a/lib/plaid/models/processor_transactions_get_response.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTransactionsGetResponse defines the response schema for `/processor/transactions/get` - class ProcessorTransactionsGetResponse - attr_accessor :account - - # An array containing transactions from the account. Transactions are returned in reverse chronological order, with the most recent at the beginning of the array. The maximum number of transactions returned is determined by the `count` parameter. - attr_accessor :transactions - - # The total number of transactions available within the date range specified. If `total_transactions` is larger than the size of the `transactions` array, more transactions are available and can be fetched via manipulating the `offset` parameter. - attr_accessor :total_transactions - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account' => :'account', - :'transactions' => :'transactions', - :'total_transactions' => :'total_transactions', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account' => :'AccountBase', - :'transactions' => :'Array', - :'total_transactions' => :'Integer', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTransactionsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTransactionsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'transactions') - if (value = attributes[:'transactions']).is_a?(Array) - self.transactions = value - end - end - - if attributes.key?(:'total_transactions') - self.total_transactions = attributes[:'total_transactions'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account.nil? - invalid_properties.push('invalid value for "account", account cannot be nil.') - end - - if @transactions.nil? - invalid_properties.push('invalid value for "transactions", transactions cannot be nil.') - end - - if @total_transactions.nil? - invalid_properties.push('invalid value for "total_transactions", total_transactions cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account.nil? - return false if @transactions.nil? - return false if @total_transactions.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account == o.account && - transactions == o.transactions && - total_transactions == o.total_transactions && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account, transactions, total_transactions, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_transactions_recurring_get_request.rb b/lib/plaid/models/processor_transactions_recurring_get_request.rb deleted file mode 100644 index 48427f7a4..000000000 --- a/lib/plaid/models/processor_transactions_recurring_get_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTransactionsRecurringGetRequest defines the request schema for `/processor/transactions/recurring/get` - class ProcessorTransactionsRecurringGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'processor_token' => :'processor_token', - :'secret' => :'secret', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'processor_token' => :'String', - :'secret' => :'String', - :'options' => :'TransactionsRecurringGetRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTransactionsRecurringGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTransactionsRecurringGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - processor_token == o.processor_token && - secret == o.secret && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, processor_token, secret, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_transactions_recurring_get_response.rb b/lib/plaid/models/processor_transactions_recurring_get_response.rb deleted file mode 100644 index 7cdb8d7d4..000000000 --- a/lib/plaid/models/processor_transactions_recurring_get_response.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTransactionsRecurringGetResponse defines the response schema for `/processor/transactions/recurring/get` - class ProcessorTransactionsRecurringGetResponse - # An array of depository transaction streams. - attr_accessor :inflow_streams - - # An array of expense transaction streams. - attr_accessor :outflow_streams - - # Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the last time transaction streams for the given account were updated on - attr_accessor :updated_datetime - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'inflow_streams' => :'inflow_streams', - :'outflow_streams' => :'outflow_streams', - :'updated_datetime' => :'updated_datetime', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'inflow_streams' => :'Array', - :'outflow_streams' => :'Array', - :'updated_datetime' => :'Time', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTransactionsRecurringGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTransactionsRecurringGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'inflow_streams') - if (value = attributes[:'inflow_streams']).is_a?(Array) - self.inflow_streams = value - end - end - - if attributes.key?(:'outflow_streams') - if (value = attributes[:'outflow_streams']).is_a?(Array) - self.outflow_streams = value - end - end - - if attributes.key?(:'updated_datetime') - self.updated_datetime = attributes[:'updated_datetime'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @inflow_streams.nil? - invalid_properties.push('invalid value for "inflow_streams", inflow_streams cannot be nil.') - end - - if @outflow_streams.nil? - invalid_properties.push('invalid value for "outflow_streams", outflow_streams cannot be nil.') - end - - if @updated_datetime.nil? - invalid_properties.push('invalid value for "updated_datetime", updated_datetime cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @inflow_streams.nil? - return false if @outflow_streams.nil? - return false if @updated_datetime.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - inflow_streams == o.inflow_streams && - outflow_streams == o.outflow_streams && - updated_datetime == o.updated_datetime && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [inflow_streams, outflow_streams, updated_datetime, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_transactions_refresh_request.rb b/lib/plaid/models/processor_transactions_refresh_request.rb deleted file mode 100644 index d17c729dc..000000000 --- a/lib/plaid/models/processor_transactions_refresh_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTransactionsRefreshRequest defines the request schema for `/processor/transactions/refresh` - class ProcessorTransactionsRefreshRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'processor_token' => :'processor_token', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'processor_token' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTransactionsRefreshRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTransactionsRefreshRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - processor_token == o.processor_token && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, processor_token, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_transactions_refresh_response.rb b/lib/plaid/models/processor_transactions_refresh_response.rb deleted file mode 100644 index bd8dda951..000000000 --- a/lib/plaid/models/processor_transactions_refresh_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTransactionsRefreshResponse defines the response schema for `/processor/transactions/refresh` - class ProcessorTransactionsRefreshResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTransactionsRefreshResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTransactionsRefreshResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_transactions_removed_webhook.rb b/lib/plaid/models/processor_transactions_removed_webhook.rb deleted file mode 100644 index 73a5efa14..000000000 --- a/lib/plaid/models/processor_transactions_removed_webhook.rb +++ /dev/null @@ -1,319 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class ProcessorTransactionsRemovedWebhook - # `TRANSACTIONS` - attr_accessor :webhook_type - - # `TRANSACTIONS_REMOVED` - attr_accessor :webhook_code - - attr_accessor :error - - # An array of `transaction_ids` corresponding to the removed transactions - attr_accessor :removed_transactions - - # The ID of the account. - attr_accessor :account_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'error' => :'error', - :'removed_transactions' => :'removed_transactions', - :'account_id' => :'account_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'error' => :'PlaidError', - :'removed_transactions' => :'Array', - :'account_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTransactionsRemovedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTransactionsRemovedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'removed_transactions') - if (value = attributes[:'removed_transactions']).is_a?(Array) - self.removed_transactions = value - end - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @removed_transactions.nil? - invalid_properties.push('invalid value for "removed_transactions", removed_transactions cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @removed_transactions.nil? - return false if @account_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - error == o.error && - removed_transactions == o.removed_transactions && - account_id == o.account_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, error, removed_transactions, account_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_transactions_sync_request.rb b/lib/plaid/models/processor_transactions_sync_request.rb deleted file mode 100644 index 34eed6740..000000000 --- a/lib/plaid/models/processor_transactions_sync_request.rb +++ /dev/null @@ -1,303 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTransactionsSyncRequest defines the request schema for `/processor/transactions/sync` - class ProcessorTransactionsSyncRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # The processor token obtained from the Plaid integration partner. Processor tokens are in the format: `processor--` - attr_accessor :processor_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The cursor value represents the last update requested. Providing it will cause the response to only return changes after this update. If omitted, the entire history of updates will be returned, starting with the first-added transactions on the item. Note: The upper-bound length of this cursor is 256 characters of base64. - attr_accessor :cursor - - # The number of transaction updates to fetch. - attr_accessor :count - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'processor_token' => :'processor_token', - :'secret' => :'secret', - :'cursor' => :'cursor', - :'count' => :'count', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'processor_token' => :'String', - :'secret' => :'String', - :'cursor' => :'String', - :'count' => :'Integer', - :'options' => :'TransactionsSyncRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTransactionsSyncRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTransactionsSyncRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 100 - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - if !@count.nil? && @count > 500 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 500.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - return false if !@count.nil? && @count > 500 - return false if !@count.nil? && @count < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 500 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 500.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - processor_token == o.processor_token && - secret == o.secret && - cursor == o.cursor && - count == o.count && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, processor_token, secret, cursor, count, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/processor_transactions_sync_response.rb b/lib/plaid/models/processor_transactions_sync_response.rb deleted file mode 100644 index 94ee81e1b..000000000 --- a/lib/plaid/models/processor_transactions_sync_response.rb +++ /dev/null @@ -1,307 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProcessorTransactionsSyncResponse defines the response schema for `/processor/transactions/sync` - class ProcessorTransactionsSyncResponse - # Transactions that have been added to the Item since `cursor` ordered by ascending last modified time. - attr_accessor :added - - # Transactions that have been modified on the Item since `cursor` ordered by ascending last modified time. - attr_accessor :modified - - # Transactions that have been removed from the Item since `cursor` ordered by ascending last modified time. - attr_accessor :removed - - # Cursor used for fetching any future updates after the latest update provided in this response. The cursor obtained after all pages have been pulled (indicated by `has_more` being `false`) will be valid for at least 1 year. This cursor should be persisted for later calls. If transactions are not yet available, this will be an empty string. - attr_accessor :next_cursor - - # Represents if more than requested count of transaction updates exist. If true, the additional updates can be fetched by making an additional request with `cursor` set to `next_cursor`. If `has_more` is true, it’s important to pull all available pages, to make it less likely for underlying data changes to conflict with pagination. - attr_accessor :has_more - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'added' => :'added', - :'modified' => :'modified', - :'removed' => :'removed', - :'next_cursor' => :'next_cursor', - :'has_more' => :'has_more', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'added' => :'Array', - :'modified' => :'Array', - :'removed' => :'Array', - :'next_cursor' => :'String', - :'has_more' => :'Boolean', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProcessorTransactionsSyncResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProcessorTransactionsSyncResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'added') - if (value = attributes[:'added']).is_a?(Array) - self.added = value - end - end - - if attributes.key?(:'modified') - if (value = attributes[:'modified']).is_a?(Array) - self.modified = value - end - end - - if attributes.key?(:'removed') - if (value = attributes[:'removed']).is_a?(Array) - self.removed = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'has_more') - self.has_more = attributes[:'has_more'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @added.nil? - invalid_properties.push('invalid value for "added", added cannot be nil.') - end - - if @modified.nil? - invalid_properties.push('invalid value for "modified", modified cannot be nil.') - end - - if @removed.nil? - invalid_properties.push('invalid value for "removed", removed cannot be nil.') - end - - if @next_cursor.nil? - invalid_properties.push('invalid value for "next_cursor", next_cursor cannot be nil.') - end - - if @has_more.nil? - invalid_properties.push('invalid value for "has_more", has_more cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @added.nil? - return false if @modified.nil? - return false if @removed.nil? - return false if @next_cursor.nil? - return false if @has_more.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - added == o.added && - modified == o.modified && - removed == o.removed && - next_cursor == o.next_cursor && - has_more == o.has_more && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [added, modified, removed, next_cursor, has_more, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/product_access.rb b/lib/plaid/models/product_access.rb deleted file mode 100644 index 8c88ac2b6..000000000 --- a/lib/plaid/models/product_access.rb +++ /dev/null @@ -1,328 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The product access being requested. Used to or disallow product access across all accounts. If unset, defaults to all products allowed. - class ProductAccess - # Allow access to statements. Only used by certain partners. If relevant to the partner and unset, defaults to `true`. - attr_accessor :statements - - # Allow access to the Identity product (name, email, phone, address). Only used by certain partners. If relevant to the partner and unset, defaults to `true`. - attr_accessor :identity - - # Allow access to account number details. Only used by certain partners. If relevant to the partner and unset, defaults to `true`. - attr_accessor :auth - - # Allow access to transaction details. Only used by certain partners. If relevant to the partner and unset, defaults to `true`. - attr_accessor :transactions - - # Allow access to \"accounts_details_transactions\". Only used by certain partners. If relevant to the partner and unset, defaults to `true`. - attr_accessor :accounts_details_transactions - - # Allow access to \"accounts_routing_number\". Only used by certain partners. If relevant to the partner and unset, defaults to `true`. - attr_accessor :accounts_routing_number - - # Allow access to \"accounts_statements\". Only used by certain partners. If relevant to the partner and unset, defaults to `true`. - attr_accessor :accounts_statements - - # Allow access to \"accounts_tax_statements\". Only used by certain partners. If relevant to the partner and unset, defaults to `true`. - attr_accessor :accounts_tax_statements - - # Allow access to \"customers_profiles\". Only used by certain partners. If relevant to the partner and unset, defaults to `true`. - attr_accessor :customers_profiles - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'statements' => :'statements', - :'identity' => :'identity', - :'auth' => :'auth', - :'transactions' => :'transactions', - :'accounts_details_transactions' => :'accounts_details_transactions', - :'accounts_routing_number' => :'accounts_routing_number', - :'accounts_statements' => :'accounts_statements', - :'accounts_tax_statements' => :'accounts_tax_statements', - :'customers_profiles' => :'customers_profiles' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'statements' => :'Boolean', - :'identity' => :'Boolean', - :'auth' => :'Boolean', - :'transactions' => :'Boolean', - :'accounts_details_transactions' => :'Boolean', - :'accounts_routing_number' => :'Boolean', - :'accounts_statements' => :'Boolean', - :'accounts_tax_statements' => :'Boolean', - :'customers_profiles' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'statements', - :'identity', - :'auth', - :'transactions', - :'accounts_details_transactions', - :'accounts_routing_number', - :'accounts_statements', - :'accounts_tax_statements', - :'customers_profiles' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProductAccess` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProductAccess`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'statements') - self.statements = attributes[:'statements'] - else - self.statements = true - end - - if attributes.key?(:'identity') - self.identity = attributes[:'identity'] - else - self.identity = true - end - - if attributes.key?(:'auth') - self.auth = attributes[:'auth'] - else - self.auth = true - end - - if attributes.key?(:'transactions') - self.transactions = attributes[:'transactions'] - else - self.transactions = true - end - - if attributes.key?(:'accounts_details_transactions') - self.accounts_details_transactions = attributes[:'accounts_details_transactions'] - else - self.accounts_details_transactions = true - end - - if attributes.key?(:'accounts_routing_number') - self.accounts_routing_number = attributes[:'accounts_routing_number'] - else - self.accounts_routing_number = true - end - - if attributes.key?(:'accounts_statements') - self.accounts_statements = attributes[:'accounts_statements'] - else - self.accounts_statements = true - end - - if attributes.key?(:'accounts_tax_statements') - self.accounts_tax_statements = attributes[:'accounts_tax_statements'] - else - self.accounts_tax_statements = true - end - - if attributes.key?(:'customers_profiles') - self.customers_profiles = attributes[:'customers_profiles'] - else - self.customers_profiles = true - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - statements == o.statements && - identity == o.identity && - auth == o.auth && - transactions == o.transactions && - accounts_details_transactions == o.accounts_details_transactions && - accounts_routing_number == o.accounts_routing_number && - accounts_statements == o.accounts_statements && - accounts_tax_statements == o.accounts_tax_statements && - customers_profiles == o.customers_profiles - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [statements, identity, auth, transactions, accounts_details_transactions, accounts_routing_number, accounts_statements, accounts_tax_statements, customers_profiles].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/product_permissions_required_auth_webhook.rb b/lib/plaid/models/product_permissions_required_auth_webhook.rb deleted file mode 100644 index 92f2d8f7f..000000000 --- a/lib/plaid/models/product_permissions_required_auth_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class ProductPermissionsRequiredAuthWebhook - # `AUTH` - attr_accessor :webhook_type - - # `PRODUCT_PERMISSIONS_REQUIRED` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProductPermissionsRequiredAuthWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProductPermissionsRequiredAuthWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/product_permissions_required_identity_webhook.rb b/lib/plaid/models/product_permissions_required_identity_webhook.rb deleted file mode 100644 index b91a6e42f..000000000 --- a/lib/plaid/models/product_permissions_required_identity_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class ProductPermissionsRequiredIdentityWebhook - # `IDENTITY` - attr_accessor :webhook_type - - # `PRODUCT_PERMISSIONS_REQUIRED` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProductPermissionsRequiredIdentityWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProductPermissionsRequiredIdentityWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/product_status.rb b/lib/plaid/models/product_status.rb deleted file mode 100644 index 757239f7a..000000000 --- a/lib/plaid/models/product_status.rb +++ /dev/null @@ -1,289 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A representation of the status health of a request type. Auth requests, Balance requests, Identity requests, Investments requests, Liabilities requests, Transactions updates, Investments updates, Liabilities updates, and Item logins each have their own status object. - class ProductStatus - # This field is deprecated in favor of the `breakdown` object, which provides more granular institution health data. `HEALTHY`: the majority of requests are successful `DEGRADED`: only some requests are successful `DOWN`: all requests are failing - attr_accessor :status - - # [ISO 8601](https://wikipedia.org/wiki/ISO_8601) formatted timestamp of the last status change for the institution. - attr_accessor :last_status_change - - attr_accessor :breakdown - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'last_status_change' => :'last_status_change', - :'breakdown' => :'breakdown' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'String', - :'last_status_change' => :'Time', - :'breakdown' => :'ProductStatusBreakdown' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProductStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProductStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'last_status_change') - self.last_status_change = attributes[:'last_status_change'] - end - - if attributes.key?(:'breakdown') - self.breakdown = attributes[:'breakdown'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @last_status_change.nil? - invalid_properties.push('invalid value for "last_status_change", last_status_change cannot be nil.') - end - - if @breakdown.nil? - invalid_properties.push('invalid value for "breakdown", breakdown cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @status.nil? - status_validator = EnumAttributeValidator.new('String', ["HEALTHY", "DEGRADED", "DOWN"]) - return false unless status_validator.valid?(@status) - return false if @last_status_change.nil? - return false if @breakdown.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["HEALTHY", "DEGRADED", "DOWN"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - last_status_change == o.last_status_change && - breakdown == o.breakdown - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, last_status_change, breakdown].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/product_status_breakdown.rb b/lib/plaid/models/product_status_breakdown.rb deleted file mode 100644 index b4eb699e3..000000000 --- a/lib/plaid/models/product_status_breakdown.rb +++ /dev/null @@ -1,300 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A detailed breakdown of the institution's performance for a request type. The values for `success`, `error_plaid`, and `error_institution` sum to 1. The time range used for calculating the breakdown may range from the most recent few minutes to the past six hours. In general, smaller institutions will show status that was calculated over a longer period of time. For Investment updates, which are refreshed less frequently, the period assessed may be 24 hours or more. For more details, see [Institution status details](https://plaid.com/docs/account/activity/#institution-status-details). - class ProductStatusBreakdown - # The percentage of login attempts that are successful, expressed as a decimal. - attr_accessor :success - - # The percentage of logins that are failing due to an internal Plaid issue, expressed as a decimal. - attr_accessor :error_plaid - - # The percentage of logins that are failing due to an issue in the institution's system, expressed as a decimal. - attr_accessor :error_institution - - # The `refresh_interval` may be `DELAYED` or `STOPPED` even when the success rate is high. This value is only returned for Transactions status breakdowns. - attr_accessor :refresh_interval - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'success' => :'success', - :'error_plaid' => :'error_plaid', - :'error_institution' => :'error_institution', - :'refresh_interval' => :'refresh_interval' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'success' => :'Float', - :'error_plaid' => :'Float', - :'error_institution' => :'Float', - :'refresh_interval' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProductStatusBreakdown` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProductStatusBreakdown`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'success') - self.success = attributes[:'success'] - end - - if attributes.key?(:'error_plaid') - self.error_plaid = attributes[:'error_plaid'] - end - - if attributes.key?(:'error_institution') - self.error_institution = attributes[:'error_institution'] - end - - if attributes.key?(:'refresh_interval') - self.refresh_interval = attributes[:'refresh_interval'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @success.nil? - invalid_properties.push('invalid value for "success", success cannot be nil.') - end - - if @error_plaid.nil? - invalid_properties.push('invalid value for "error_plaid", error_plaid cannot be nil.') - end - - if @error_institution.nil? - invalid_properties.push('invalid value for "error_institution", error_institution cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @success.nil? - return false if @error_plaid.nil? - return false if @error_institution.nil? - refresh_interval_validator = EnumAttributeValidator.new('String', ["NORMAL", "DELAYED", "STOPPED"]) - return false unless refresh_interval_validator.valid?(@refresh_interval) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] refresh_interval Object to be assigned - def refresh_interval=(refresh_interval) - validator = EnumAttributeValidator.new('String', ["NORMAL", "DELAYED", "STOPPED"]) - unless validator.valid?(refresh_interval) - fail ArgumentError, "invalid value for \"refresh_interval\", must be one of #{validator.allowable_values}." - end - @refresh_interval = refresh_interval - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - success == o.success && - error_plaid == o.error_plaid && - error_institution == o.error_institution && - refresh_interval == o.refresh_interval - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [success, error_plaid, error_institution, refresh_interval].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/products.rb b/lib/plaid/models/products.rb deleted file mode 100644 index ec341ab6d..000000000 --- a/lib/plaid/models/products.rb +++ /dev/null @@ -1,60 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class Products - ASSETS = "assets".freeze - AUTH = "auth".freeze - BALANCE = "balance".freeze - IDENTITY = "identity".freeze - IDENTITY_MATCH = "identity_match".freeze - INVESTMENTS = "investments".freeze - INVESTMENTS_AUTH = "investments_auth".freeze - LIABILITIES = "liabilities".freeze - PAYMENT_INITIATION = "payment_initiation".freeze - IDENTITY_VERIFICATION = "identity_verification".freeze - TRANSACTIONS = "transactions".freeze - CREDIT_DETAILS = "credit_details".freeze - INCOME = "income".freeze - INCOME_VERIFICATION = "income_verification".freeze - DEPOSIT_SWITCH = "deposit_switch".freeze - STANDING_ORDERS = "standing_orders".freeze - TRANSFER = "transfer".freeze - EMPLOYMENT = "employment".freeze - RECURRING_TRANSACTIONS = "recurring_transactions".freeze - SIGNAL = "signal".freeze - STATEMENTS = "statements".freeze - PROCESSOR_PAYMENTS = "processor_payments".freeze - PROCESSOR_IDENTITY = "processor_identity".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/profile_get_request.rb b/lib/plaid/models/profile_get_request.rb deleted file mode 100644 index b96214b98..000000000 --- a/lib/plaid/models/profile_get_request.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProfileGetRequest defines the request schema for `/profile/get` - class ProfileGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The profile token generated by the end user authorization session. - attr_accessor :profile_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'profile_token' => :'profile_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'profile_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProfileGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProfileGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'profile_token') - self.profile_token = attributes[:'profile_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @client_id.nil? - invalid_properties.push('invalid value for "client_id", client_id cannot be nil.') - end - - if @secret.nil? - invalid_properties.push('invalid value for "secret", secret cannot be nil.') - end - - if @profile_token.nil? - invalid_properties.push('invalid value for "profile_token", profile_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @client_id.nil? - return false if @secret.nil? - return false if @profile_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - profile_token == o.profile_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, profile_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/profile_get_response.rb b/lib/plaid/models/profile_get_response.rb deleted file mode 100644 index e4bec7d59..000000000 --- a/lib/plaid/models/profile_get_response.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProfileGetResponse defines the response schema for `/profile/get` - class ProfileGetResponse - attr_accessor :identity - - attr_accessor :items - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'identity' => :'identity', - :'items' => :'items', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'identity' => :'ProfileIdentity', - :'items' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'identity', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProfileGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProfileGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'identity') - self.identity = attributes[:'identity'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @items.nil? - invalid_properties.push('invalid value for "items", items cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @items.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - identity == o.identity && - items == o.items && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [identity, items, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/profile_identity.rb b/lib/plaid/models/profile_identity.rb deleted file mode 100644 index 4971866b7..000000000 --- a/lib/plaid/models/profile_identity.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProfileIdentity defines the identity data permissioned by the end user during the authorization flow. - class ProfileIdentity - attr_accessor :name - - attr_accessor :address - - # The user's email address. - attr_accessor :email - - # The user's date of birth. - attr_accessor :date_of_birth - - # The user's social security number. - attr_accessor :ssn - - # The last 4 digits of the user's social security number. - attr_accessor :ssn_last_4 - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'address' => :'address', - :'email' => :'email', - :'date_of_birth' => :'date_of_birth', - :'ssn' => :'ssn', - :'ssn_last_4' => :'ssn_last_4' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'ProfileIdentityName', - :'address' => :'ProfileIdentityAddress', - :'email' => :'String', - :'date_of_birth' => :'String', - :'ssn' => :'String', - :'ssn_last_4' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'address', - :'email', - :'date_of_birth', - :'ssn', - :'ssn_last_4' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProfileIdentity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProfileIdentity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'ssn') - self.ssn = attributes[:'ssn'] - end - - if attributes.key?(:'ssn_last_4') - self.ssn_last_4 = attributes[:'ssn_last_4'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - address == o.address && - email == o.email && - date_of_birth == o.date_of_birth && - ssn == o.ssn && - ssn_last_4 == o.ssn_last_4 - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, address, email, date_of_birth, ssn, ssn_last_4].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/profile_identity_address.rb b/lib/plaid/models/profile_identity_address.rb deleted file mode 100644 index 44c4b292e..000000000 --- a/lib/plaid/models/profile_identity_address.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProfileIdentityAddress defines the user's address. - class ProfileIdentityAddress - # The full city name - attr_accessor :city - - # The region or state. Example: `\"NC\"` - attr_accessor :region - - # The full street address Example: `\"564 Main Street, APT 15\"` - attr_accessor :street - - # The second line street address - attr_accessor :street2 - - # The postal code. In API versions 2018-05-22 and earlier, this field is called `zip`. - attr_accessor :postal_code - - # The ISO 3166-1 alpha-2 country code - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'region' => :'region', - :'street' => :'street', - :'street2' => :'street2', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'region' => :'String', - :'street' => :'String', - :'street2' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'city', - :'region', - :'street2', - :'postal_code', - :'country' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProfileIdentityAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProfileIdentityAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'street2') - self.street2 = attributes[:'street2'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - region == o.region && - street == o.street && - street2 == o.street2 && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, region, street, street2, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/profile_identity_name.rb b/lib/plaid/models/profile_identity_name.rb deleted file mode 100644 index 8e07b6a1b..000000000 --- a/lib/plaid/models/profile_identity_name.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProfileIdentityName defines the user's first name and last name. - class ProfileIdentityName - attr_accessor :first_name - - attr_accessor :last_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'first_name' => :'first_name', - :'last_name' => :'last_name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'first_name' => :'String', - :'last_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProfileIdentityName` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProfileIdentityName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - end - - if attributes.key?(:'last_name') - self.last_name = attributes[:'last_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - first_name == o.first_name && - last_name == o.last_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [first_name, last_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/profile_item.rb b/lib/plaid/models/profile_item.rb deleted file mode 100644 index b4460f0dc..000000000 --- a/lib/plaid/models/profile_item.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ProfileItem defines an Item created during a profile authorization session. - class ProfileItem - # 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. - attr_accessor :item_id - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'item_id' => :'item_id', - :'access_token' => :'access_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'item_id' => :'String', - :'access_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProfileItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProfileItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - item_id == o.item_id && - access_token == o.access_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [item_id, access_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/program_name_sensitivity.rb b/lib/plaid/models/program_name_sensitivity.rb deleted file mode 100644 index ff86a20c1..000000000 --- a/lib/plaid/models/program_name_sensitivity.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class ProgramNameSensitivity - COARSE = "coarse".freeze - BALANCED = "balanced".freeze - STRICT = "strict".freeze - EXACT = "exact".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/projected_income_summary_field_number.rb b/lib/plaid/models/projected_income_summary_field_number.rb deleted file mode 100644 index dc20dbf84..000000000 --- a/lib/plaid/models/projected_income_summary_field_number.rb +++ /dev/null @@ -1,269 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The employee's estimated annual salary, as derived from information reported on the paystub. - class ProjectedIncomeSummaryFieldNumber - # The value of the field. - attr_accessor :value - - attr_accessor :verification_status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'verification_status' => :'verification_status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'Float', - :'verification_status' => :'VerificationStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'IncomeSummaryFieldNumber' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ProjectedIncomeSummaryFieldNumber` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ProjectedIncomeSummaryFieldNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @verification_status.nil? - invalid_properties.push('invalid value for "verification_status", verification_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @value.nil? - return false if @verification_status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - verification_status == o.verification_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, verification_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/proxy_type.rb b/lib/plaid/models/proxy_type.rb deleted file mode 100644 index e9bbf3daf..000000000 --- a/lib/plaid/models/proxy_type.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class ProxyType - NONE_DETECTED = "none_detected".freeze - TOR = "tor".freeze - VPN = "vpn".freeze - WEB_PROXY = "web_proxy".freeze - PUBLIC_PROXY = "public_proxy".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/pslf_status.rb b/lib/plaid/models/pslf_status.rb deleted file mode 100644 index 04d80ec43..000000000 --- a/lib/plaid/models/pslf_status.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the student's eligibility in the Public Service Loan Forgiveness program. This is only returned if the institution is FedLoan (`ins_116527`). - class 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). - attr_accessor :estimated_eligibility_date - - # The number of qualifying payments that have been made. - attr_accessor :payments_made - - # The number of qualifying payments remaining. - attr_accessor :payments_remaining - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'estimated_eligibility_date' => :'estimated_eligibility_date', - :'payments_made' => :'payments_made', - :'payments_remaining' => :'payments_remaining' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'estimated_eligibility_date' => :'Date', - :'payments_made' => :'Integer', - :'payments_remaining' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'estimated_eligibility_date', - :'payments_made', - :'payments_remaining' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PSLFStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PSLFStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'estimated_eligibility_date') - self.estimated_eligibility_date = attributes[:'estimated_eligibility_date'] - end - - if attributes.key?(:'payments_made') - self.payments_made = attributes[:'payments_made'] - end - - if attributes.key?(:'payments_remaining') - self.payments_remaining = attributes[:'payments_remaining'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - estimated_eligibility_date == o.estimated_eligibility_date && - payments_made == o.payments_made && - payments_remaining == o.payments_remaining - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [estimated_eligibility_date, payments_made, payments_remaining].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/recaptcha_required_error.rb b/lib/plaid/models/recaptcha_required_error.rb deleted file mode 100644 index cd37c5b40..000000000 --- a/lib/plaid/models/recaptcha_required_error.rb +++ /dev/null @@ -1,315 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The request was flagged by Plaid's fraud system, and requires additional verification to ensure they are not a bot. - class RecaptchaRequiredError - # RECAPTCHA_ERROR - attr_accessor :error_type - - # RECAPTCHA_REQUIRED - attr_accessor :error_code - - attr_accessor :display_message - - # 400 - attr_accessor :http_code - - # Your user will be prompted to solve a Google reCAPTCHA challenge in the Link Recaptcha pane. If they solve the challenge successfully, the user's request is resubmitted and they are directed to the next Item creation step. - attr_accessor :link_user_experience - - # Plaid's fraud system detects abusive traffic and considers a variety of parameters throughout Item creation requests. When a request is considered risky or possibly fraudulent, Link presents a reCAPTCHA for the user to solve. - attr_accessor :common_causes - - # Link will automatically guide your user through reCAPTCHA verification. As a general rule, we recommend instrumenting basic fraud monitoring to detect and protect your website from spam and abuse. If your user cannot verify their session, please submit a Support ticket with the following identifiers: `link_session_id` or `request_id` - attr_accessor :troubleshooting_steps - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'error_type' => :'error_type', - :'error_code' => :'error_code', - :'display_message' => :'display_message', - :'http_code' => :'http_code', - :'link_user_experience' => :'link_user_experience', - :'common_causes' => :'common_causes', - :'troubleshooting_steps' => :'troubleshooting_steps' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'error_type' => :'String', - :'error_code' => :'String', - :'display_message' => :'String', - :'http_code' => :'String', - :'link_user_experience' => :'String', - :'common_causes' => :'String', - :'troubleshooting_steps' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RecaptchaRequiredError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RecaptchaRequiredError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'error_type') - self.error_type = attributes[:'error_type'] - end - - if attributes.key?(:'error_code') - self.error_code = attributes[:'error_code'] - end - - if attributes.key?(:'display_message') - self.display_message = attributes[:'display_message'] - end - - if attributes.key?(:'http_code') - self.http_code = attributes[:'http_code'] - end - - if attributes.key?(:'link_user_experience') - self.link_user_experience = attributes[:'link_user_experience'] - end - - if attributes.key?(:'common_causes') - self.common_causes = attributes[:'common_causes'] - end - - if attributes.key?(:'troubleshooting_steps') - self.troubleshooting_steps = attributes[:'troubleshooting_steps'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @error_type.nil? - invalid_properties.push('invalid value for "error_type", error_type cannot be nil.') - end - - if @error_code.nil? - invalid_properties.push('invalid value for "error_code", error_code cannot be nil.') - end - - if @display_message.nil? - invalid_properties.push('invalid value for "display_message", display_message cannot be nil.') - end - - if @http_code.nil? - invalid_properties.push('invalid value for "http_code", http_code cannot be nil.') - end - - if @link_user_experience.nil? - invalid_properties.push('invalid value for "link_user_experience", link_user_experience cannot be nil.') - end - - if @common_causes.nil? - invalid_properties.push('invalid value for "common_causes", common_causes cannot be nil.') - end - - if @troubleshooting_steps.nil? - invalid_properties.push('invalid value for "troubleshooting_steps", troubleshooting_steps cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @error_type.nil? - return false if @error_code.nil? - return false if @display_message.nil? - return false if @http_code.nil? - return false if @link_user_experience.nil? - return false if @common_causes.nil? - return false if @troubleshooting_steps.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - error_type == o.error_type && - error_code == o.error_code && - display_message == o.display_message && - http_code == o.http_code && - link_user_experience == o.link_user_experience && - common_causes == o.common_causes && - troubleshooting_steps == o.troubleshooting_steps - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [error_type, error_code, display_message, http_code, link_user_experience, common_causes, troubleshooting_steps].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/recipient_bacs.rb b/lib/plaid/models/recipient_bacs.rb deleted file mode 100644 index 35dafa305..000000000 --- a/lib/plaid/models/recipient_bacs.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing a BACS account number and sort code. If an IBAN is not provided or if you need to accept domestic GBP-denominated payments, BACS data is required. - class RecipientBACS - # The account number of the account. Maximum of 10 characters. - attr_accessor :account - - # The 6-character sort code of the account. - attr_accessor :sort_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account' => :'account', - :'sort_code' => :'sort_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account' => :'String', - :'sort_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RecipientBACS` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RecipientBACS`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'sort_code') - self.sort_code = attributes[:'sort_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@account.nil? && @account.to_s.length > 10 - invalid_properties.push('invalid value for "account", the character length must be smaller than or equal to 10.') - end - - if !@account.nil? && @account.to_s.length < 1 - invalid_properties.push('invalid value for "account", the character length must be great than or equal to 1.') - end - - - if !@sort_code.nil? && @sort_code.to_s.length > 6 - invalid_properties.push('invalid value for "sort_code", the character length must be smaller than or equal to 6.') - end - - if !@sort_code.nil? && @sort_code.to_s.length < 6 - invalid_properties.push('invalid value for "sort_code", the character length must be great than or equal to 6.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@account.nil? && @account.to_s.length > 10 - return false if !@account.nil? && @account.to_s.length < 1 - return false if !@sort_code.nil? && @sort_code.to_s.length > 6 - return false if !@sort_code.nil? && @sort_code.to_s.length < 6 - true - end - - # Custom attribute writer method with validation - # @param [Object] account Value to be assigned - def account=(account) - if !account.nil? && account.to_s.length > 10 - fail ArgumentError, 'invalid value for "account", the character length must be smaller than or equal to 10.' - end - - if !account.nil? && account.to_s.length < 1 - fail ArgumentError, 'invalid value for "account", the character length must be great than or equal to 1.' - end - - - @account = account - end - - # Custom attribute writer method with validation - # @param [Object] sort_code Value to be assigned - def sort_code=(sort_code) - if !sort_code.nil? && sort_code.to_s.length > 6 - fail ArgumentError, 'invalid value for "sort_code", the character length must be smaller than or equal to 6.' - end - - if !sort_code.nil? && sort_code.to_s.length < 6 - fail ArgumentError, 'invalid value for "sort_code", the character length must be great than or equal to 6.' - end - - - @sort_code = sort_code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account == o.account && - sort_code == o.sort_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account, sort_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/recipient_bacs_nullable.rb b/lib/plaid/models/recipient_bacs_nullable.rb deleted file mode 100644 index dda1ea5c3..000000000 --- a/lib/plaid/models/recipient_bacs_nullable.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing a BACS account number and sort code. If an IBAN is not provided or if this recipient needs to accept domestic GBP-denominated payments, BACS data is required. - class RecipientBACSNullable - # The account number of the account. Maximum of 10 characters. - attr_accessor :account - - # The 6-character sort code of the account. - attr_accessor :sort_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account' => :'account', - :'sort_code' => :'sort_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account' => :'String', - :'sort_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'RecipientBACS' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RecipientBACSNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RecipientBACSNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'sort_code') - self.sort_code = attributes[:'sort_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@account.nil? && @account.to_s.length > 10 - invalid_properties.push('invalid value for "account", the character length must be smaller than or equal to 10.') - end - - if !@account.nil? && @account.to_s.length < 1 - invalid_properties.push('invalid value for "account", the character length must be great than or equal to 1.') - end - - - if !@sort_code.nil? && @sort_code.to_s.length > 6 - invalid_properties.push('invalid value for "sort_code", the character length must be smaller than or equal to 6.') - end - - if !@sort_code.nil? && @sort_code.to_s.length < 6 - invalid_properties.push('invalid value for "sort_code", the character length must be great than or equal to 6.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@account.nil? && @account.to_s.length > 10 - return false if !@account.nil? && @account.to_s.length < 1 - return false if !@sort_code.nil? && @sort_code.to_s.length > 6 - return false if !@sort_code.nil? && @sort_code.to_s.length < 6 - true - end - - # Custom attribute writer method with validation - # @param [Object] account Value to be assigned - def account=(account) - if !account.nil? && account.to_s.length > 10 - fail ArgumentError, 'invalid value for "account", the character length must be smaller than or equal to 10.' - end - - if !account.nil? && account.to_s.length < 1 - fail ArgumentError, 'invalid value for "account", the character length must be great than or equal to 1.' - end - - - @account = account - end - - # Custom attribute writer method with validation - # @param [Object] sort_code Value to be assigned - def sort_code=(sort_code) - if !sort_code.nil? && sort_code.to_s.length > 6 - fail ArgumentError, 'invalid value for "sort_code", the character length must be smaller than or equal to 6.' - end - - if !sort_code.nil? && sort_code.to_s.length < 6 - fail ArgumentError, 'invalid value for "sort_code", the character length must be great than or equal to 6.' - end - - - @sort_code = sort_code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account == o.account && - sort_code == o.sort_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account, sort_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/recurrence.rb b/lib/plaid/models/recurrence.rb deleted file mode 100644 index f271606c6..000000000 --- a/lib/plaid/models/recurrence.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Insights relating to expenses and deposits that are predicted to occur on a scheduled basis, such as biweekly, monthly, or annually. Common examples include loan payments, bill payments, subscriptions, and payroll income. This is a beta field, available to all users. - class Recurrence - # Whether or not the transaction is periodically recurring. - attr_accessor :is_recurring - - attr_accessor :frequency - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'is_recurring' => :'is_recurring', - :'frequency' => :'frequency' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'is_recurring' => :'Boolean', - :'frequency' => :'RecurringFrequency' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'is_recurring', - :'frequency' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Recurrence` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Recurrence`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'is_recurring') - self.is_recurring = attributes[:'is_recurring'] - end - - if attributes.key?(:'frequency') - self.frequency = attributes[:'frequency'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - is_recurring == o.is_recurring && - frequency == o.frequency - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [is_recurring, frequency].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/recurring_cancelled_webhook.rb b/lib/plaid/models/recurring_cancelled_webhook.rb deleted file mode 100644 index 1ab17b5ab..000000000 --- a/lib/plaid/models/recurring_cancelled_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when a recurring transfer is cancelled by Plaid. - class RecurringCancelledWebhook - # `TRANSFER` - attr_accessor :webhook_type - - # `RECURRING_CANCELLED` - attr_accessor :webhook_code - - # Plaid’s unique identifier for a recurring transfer. - attr_accessor :recurring_transfer_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'recurring_transfer_id' => :'recurring_transfer_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'recurring_transfer_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RecurringCancelledWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RecurringCancelledWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'recurring_transfer_id') - self.recurring_transfer_id = attributes[:'recurring_transfer_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @recurring_transfer_id.nil? - invalid_properties.push('invalid value for "recurring_transfer_id", recurring_transfer_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @recurring_transfer_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - recurring_transfer_id == o.recurring_transfer_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, recurring_transfer_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/recurring_frequency.rb b/lib/plaid/models/recurring_frequency.rb deleted file mode 100644 index 501f12bd6..000000000 --- a/lib/plaid/models/recurring_frequency.rb +++ /dev/null @@ -1,46 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class RecurringFrequency - UNKNOWN = "UNKNOWN".freeze - WEEKLY = "WEEKLY".freeze - BIWEEKLY = "BIWEEKLY".freeze - SEMI_MONTHLY = "SEMI_MONTHLY".freeze - MONTHLY = "MONTHLY".freeze - ANNUALLY = "ANNUALLY".freeze - DAILY = "DAILY".freeze - DYNAMIC = "DYNAMIC".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/recurring_insights_stream.rb b/lib/plaid/models/recurring_insights_stream.rb deleted file mode 100644 index 5c6b82bdc..000000000 --- a/lib/plaid/models/recurring_insights_stream.rb +++ /dev/null @@ -1,401 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Insights object for recurring transactions streams. - class RecurringInsightsStream - # A unique id for the stream. - attr_accessor :stream_id - - # The client-provided raw description of the most recent transaction in the stream. - attr_accessor :description - - # The merchant or primary counterparty associated with the transaction stream. - attr_accessor :merchant_name - - # The posted date of the earliest transaction in the stream. - attr_accessor :oldest_transaction_date - - # The posted date of the latest transaction in the stream. - attr_accessor :newest_transaction_date - - # The average number of days between each of the recurring transactions. - attr_accessor :average_days_apart - - attr_accessor :frequency - - # The number of transactions in this stream. - attr_accessor :transaction_count - - # An array of Plaid transaction IDs belonging to the stream, sorted by posted date. - attr_accessor :transaction_ids - - attr_accessor :average_amount - - attr_accessor :newest_transaction_amount - - # Indicates whether the transaction stream is still live. - attr_accessor :is_active - - attr_accessor :status - - # The primary category associated with the transaction stream. - attr_accessor :personal_finance_category_primary - - # The detailed category associated with the transaction stream. - attr_accessor :personal_finance_category_detailed - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'stream_id' => :'stream_id', - :'description' => :'description', - :'merchant_name' => :'merchant_name', - :'oldest_transaction_date' => :'oldest_transaction_date', - :'newest_transaction_date' => :'newest_transaction_date', - :'average_days_apart' => :'average_days_apart', - :'frequency' => :'frequency', - :'transaction_count' => :'transaction_count', - :'transaction_ids' => :'transaction_ids', - :'average_amount' => :'average_amount', - :'newest_transaction_amount' => :'newest_transaction_amount', - :'is_active' => :'is_active', - :'status' => :'status', - :'personal_finance_category_primary' => :'personal_finance_category_primary', - :'personal_finance_category_detailed' => :'personal_finance_category_detailed' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'stream_id' => :'String', - :'description' => :'String', - :'merchant_name' => :'String', - :'oldest_transaction_date' => :'Date', - :'newest_transaction_date' => :'Date', - :'average_days_apart' => :'Float', - :'frequency' => :'RecurringTransactionFrequency', - :'transaction_count' => :'Integer', - :'transaction_ids' => :'Array', - :'average_amount' => :'TransactionStreamAmount', - :'newest_transaction_amount' => :'TransactionStreamAmount', - :'is_active' => :'Boolean', - :'status' => :'TransactionStreamStatus', - :'personal_finance_category_primary' => :'String', - :'personal_finance_category_detailed' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RecurringInsightsStream` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RecurringInsightsStream`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'stream_id') - self.stream_id = attributes[:'stream_id'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'merchant_name') - self.merchant_name = attributes[:'merchant_name'] - end - - if attributes.key?(:'oldest_transaction_date') - self.oldest_transaction_date = attributes[:'oldest_transaction_date'] - end - - if attributes.key?(:'newest_transaction_date') - self.newest_transaction_date = attributes[:'newest_transaction_date'] - end - - if attributes.key?(:'average_days_apart') - self.average_days_apart = attributes[:'average_days_apart'] - end - - if attributes.key?(:'frequency') - self.frequency = attributes[:'frequency'] - end - - if attributes.key?(:'transaction_count') - self.transaction_count = attributes[:'transaction_count'] - end - - if attributes.key?(:'transaction_ids') - if (value = attributes[:'transaction_ids']).is_a?(Array) - self.transaction_ids = value - end - end - - if attributes.key?(:'average_amount') - self.average_amount = attributes[:'average_amount'] - end - - if attributes.key?(:'newest_transaction_amount') - self.newest_transaction_amount = attributes[:'newest_transaction_amount'] - end - - if attributes.key?(:'is_active') - self.is_active = attributes[:'is_active'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'personal_finance_category_primary') - self.personal_finance_category_primary = attributes[:'personal_finance_category_primary'] - end - - if attributes.key?(:'personal_finance_category_detailed') - self.personal_finance_category_detailed = attributes[:'personal_finance_category_detailed'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @stream_id.nil? - invalid_properties.push('invalid value for "stream_id", stream_id cannot be nil.') - end - - if @merchant_name.nil? - invalid_properties.push('invalid value for "merchant_name", merchant_name cannot be nil.') - end - - if @average_days_apart.nil? - invalid_properties.push('invalid value for "average_days_apart", average_days_apart cannot be nil.') - end - - if @is_active.nil? - invalid_properties.push('invalid value for "is_active", is_active cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @stream_id.nil? - return false if @merchant_name.nil? - return false if @average_days_apart.nil? - return false if @is_active.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - stream_id == o.stream_id && - description == o.description && - merchant_name == o.merchant_name && - oldest_transaction_date == o.oldest_transaction_date && - newest_transaction_date == o.newest_transaction_date && - average_days_apart == o.average_days_apart && - frequency == o.frequency && - transaction_count == o.transaction_count && - transaction_ids == o.transaction_ids && - average_amount == o.average_amount && - newest_transaction_amount == o.newest_transaction_amount && - is_active == o.is_active && - status == o.status && - personal_finance_category_primary == o.personal_finance_category_primary && - personal_finance_category_detailed == o.personal_finance_category_detailed - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [stream_id, description, merchant_name, oldest_transaction_date, newest_transaction_date, average_days_apart, frequency, transaction_count, transaction_ids, average_amount, newest_transaction_amount, is_active, status, personal_finance_category_primary, personal_finance_category_detailed].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/recurring_new_transfer_webhook.rb b/lib/plaid/models/recurring_new_transfer_webhook.rb deleted file mode 100644 index abd6f71e8..000000000 --- a/lib/plaid/models/recurring_new_transfer_webhook.rb +++ /dev/null @@ -1,307 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when a new transfer of a recurring transfer is originated. - class RecurringNewTransferWebhook - # `TRANSFER` - attr_accessor :webhook_type - - # `RECURRING_NEW_TRANSFER` - attr_accessor :webhook_code - - # Plaid’s unique identifier for a recurring transfer. - attr_accessor :recurring_transfer_id - - # Plaid’s unique identifier for a transfer. - attr_accessor :transfer_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'recurring_transfer_id' => :'recurring_transfer_id', - :'transfer_id' => :'transfer_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'recurring_transfer_id' => :'String', - :'transfer_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RecurringNewTransferWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RecurringNewTransferWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'recurring_transfer_id') - self.recurring_transfer_id = attributes[:'recurring_transfer_id'] - end - - if attributes.key?(:'transfer_id') - self.transfer_id = attributes[:'transfer_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @recurring_transfer_id.nil? - invalid_properties.push('invalid value for "recurring_transfer_id", recurring_transfer_id cannot be nil.') - end - - if @transfer_id.nil? - invalid_properties.push('invalid value for "transfer_id", transfer_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @recurring_transfer_id.nil? - return false if @transfer_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - recurring_transfer_id == o.recurring_transfer_id && - transfer_id == o.transfer_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, recurring_transfer_id, transfer_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/recurring_transaction_frequency.rb b/lib/plaid/models/recurring_transaction_frequency.rb deleted file mode 100644 index 1d04a2831..000000000 --- a/lib/plaid/models/recurring_transaction_frequency.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class RecurringTransactionFrequency - UNKNOWN = "UNKNOWN".freeze - WEEKLY = "WEEKLY".freeze - BIWEEKLY = "BIWEEKLY".freeze - SEMI_MONTHLY = "SEMI_MONTHLY".freeze - MONTHLY = "MONTHLY".freeze - ANNUALLY = "ANNUALLY".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/recurring_transactions.rb b/lib/plaid/models/recurring_transactions.rb deleted file mode 100644 index d4da5f3aa..000000000 --- a/lib/plaid/models/recurring_transactions.rb +++ /dev/null @@ -1,245 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Insights object for recurring transactions for `/beta/transactions/user_insights/v1/get` endpoint - class RecurringTransactions - # An array of inflow transaction streams (e.g., income). - attr_accessor :inflow_streams - - # An array of outflow transaction streams (e.g., subscriptions, bills, loan payments). - attr_accessor :outflow_streams - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'inflow_streams' => :'inflow_streams', - :'outflow_streams' => :'outflow_streams' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'inflow_streams' => :'Array', - :'outflow_streams' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RecurringTransactions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RecurringTransactions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'inflow_streams') - if (value = attributes[:'inflow_streams']).is_a?(Array) - self.inflow_streams = value - end - end - - if attributes.key?(:'outflow_streams') - if (value = attributes[:'outflow_streams']).is_a?(Array) - self.outflow_streams = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @inflow_streams.nil? - invalid_properties.push('invalid value for "inflow_streams", inflow_streams cannot be nil.') - end - - if @outflow_streams.nil? - invalid_properties.push('invalid value for "outflow_streams", outflow_streams cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @inflow_streams.nil? - return false if @outflow_streams.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - inflow_streams == o.inflow_streams && - outflow_streams == o.outflow_streams - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [inflow_streams, outflow_streams].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/recurring_transactions_update_webhook.rb b/lib/plaid/models/recurring_transactions_update_webhook.rb deleted file mode 100644 index 49f9bb957..000000000 --- a/lib/plaid/models/recurring_transactions_update_webhook.rb +++ /dev/null @@ -1,309 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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`. - class RecurringTransactionsUpdateWebhook - # `TRANSACTIONS` - attr_accessor :webhook_type - - # `RECURRING_TRANSACTIONS_UPDATE` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - # A list of `account_ids` for accounts that have new or updated recurring transactions data. - attr_accessor :account_ids - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'account_ids' => :'account_ids', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'account_ids' => :'Array', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RecurringTransactionsUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RecurringTransactionsUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'account_ids') - if (value = attributes[:'account_ids']).is_a?(Array) - self.account_ids = value - end - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @account_ids.nil? - invalid_properties.push('invalid value for "account_ids", account_ids cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @account_ids.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - account_ids == o.account_ids && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, account_ids, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/recurring_transfer.rb b/lib/plaid/models/recurring_transfer.rb deleted file mode 100644 index a7125e63b..000000000 --- a/lib/plaid/models/recurring_transfer.rb +++ /dev/null @@ -1,470 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Represents a recurring transfer within the Transfers API. - class RecurringTransfer - # Plaid’s unique identifier for a recurring transfer. - attr_accessor :recurring_transfer_id - - # The datetime when this transfer was created. This will be of the form `2006-01-02T15:04:05Z` - attr_accessor :created - - # A date in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). The next transfer origination date after bank holiday adjustment. - attr_accessor :next_origination_date - - # Plaid’s unique identifier for a test clock. - attr_accessor :test_clock_id - - attr_accessor :type - - # 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. - attr_accessor :amount - - attr_accessor :status - - attr_accessor :ach_class - - attr_accessor :network - - # Plaid’s unique identifier for the origination account that was used for this transfer. - attr_accessor :origination_account_id - - # The Plaid `account_id` corresponding to the end-user account that will be debited or credited. - attr_accessor :account_id - - # The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited. - attr_accessor :funding_account_id - - # The currency of the transfer amount, e.g. \"USD\" - attr_accessor :iso_currency_code - - # The description of the recurring transfer. - attr_accessor :description - - attr_accessor :transfer_ids - - attr_accessor :user - - attr_accessor :schedule - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'recurring_transfer_id' => :'recurring_transfer_id', - :'created' => :'created', - :'next_origination_date' => :'next_origination_date', - :'test_clock_id' => :'test_clock_id', - :'type' => :'type', - :'amount' => :'amount', - :'status' => :'status', - :'ach_class' => :'ach_class', - :'network' => :'network', - :'origination_account_id' => :'origination_account_id', - :'account_id' => :'account_id', - :'funding_account_id' => :'funding_account_id', - :'iso_currency_code' => :'iso_currency_code', - :'description' => :'description', - :'transfer_ids' => :'transfer_ids', - :'user' => :'user', - :'schedule' => :'schedule' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'recurring_transfer_id' => :'String', - :'created' => :'Time', - :'next_origination_date' => :'Date', - :'test_clock_id' => :'String', - :'type' => :'TransferType', - :'amount' => :'String', - :'status' => :'TransferRecurringStatus', - :'ach_class' => :'ACHClass', - :'network' => :'TransferNetwork', - :'origination_account_id' => :'String', - :'account_id' => :'String', - :'funding_account_id' => :'String', - :'iso_currency_code' => :'String', - :'description' => :'String', - :'transfer_ids' => :'Array', - :'user' => :'TransferUserInResponse', - :'schedule' => :'TransferRecurringSchedule' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_origination_date', - :'test_clock_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RecurringTransfer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RecurringTransfer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'recurring_transfer_id') - self.recurring_transfer_id = attributes[:'recurring_transfer_id'] - end - - if attributes.key?(:'created') - self.created = attributes[:'created'] - end - - if attributes.key?(:'next_origination_date') - self.next_origination_date = attributes[:'next_origination_date'] - end - - if attributes.key?(:'test_clock_id') - self.test_clock_id = attributes[:'test_clock_id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'ach_class') - self.ach_class = attributes[:'ach_class'] - end - - if attributes.key?(:'network') - self.network = attributes[:'network'] - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'transfer_ids') - if (value = attributes[:'transfer_ids']).is_a?(Array) - self.transfer_ids = value - end - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'schedule') - self.schedule = attributes[:'schedule'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @recurring_transfer_id.nil? - invalid_properties.push('invalid value for "recurring_transfer_id", recurring_transfer_id cannot be nil.') - end - - if @created.nil? - invalid_properties.push('invalid value for "created", created cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @network.nil? - invalid_properties.push('invalid value for "network", network cannot be nil.') - end - - if @origination_account_id.nil? - invalid_properties.push('invalid value for "origination_account_id", origination_account_id cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @funding_account_id.nil? - invalid_properties.push('invalid value for "funding_account_id", funding_account_id cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @transfer_ids.nil? - invalid_properties.push('invalid value for "transfer_ids", transfer_ids cannot be nil.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if @schedule.nil? - invalid_properties.push('invalid value for "schedule", schedule cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @recurring_transfer_id.nil? - return false if @created.nil? - return false if @type.nil? - return false if @amount.nil? - return false if @status.nil? - return false if @network.nil? - return false if @origination_account_id.nil? - return false if @account_id.nil? - return false if @funding_account_id.nil? - return false if @iso_currency_code.nil? - return false if @description.nil? - return false if @transfer_ids.nil? - return false if @user.nil? - return false if @schedule.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - recurring_transfer_id == o.recurring_transfer_id && - created == o.created && - next_origination_date == o.next_origination_date && - test_clock_id == o.test_clock_id && - type == o.type && - amount == o.amount && - status == o.status && - ach_class == o.ach_class && - network == o.network && - origination_account_id == o.origination_account_id && - account_id == o.account_id && - funding_account_id == o.funding_account_id && - iso_currency_code == o.iso_currency_code && - description == o.description && - transfer_ids == o.transfer_ids && - user == o.user && - schedule == o.schedule - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [recurring_transfer_id, created, next_origination_date, test_clock_id, type, amount, status, ach_class, network, origination_account_id, account_id, funding_account_id, iso_currency_code, description, transfer_ids, user, schedule].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/recurring_transfer_nullable.rb b/lib/plaid/models/recurring_transfer_nullable.rb deleted file mode 100644 index d92e15493..000000000 --- a/lib/plaid/models/recurring_transfer_nullable.rb +++ /dev/null @@ -1,477 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Represents a recurring transfer within the Transfers API. - class RecurringTransferNullable - # Plaid’s unique identifier for a recurring transfer. - attr_accessor :recurring_transfer_id - - # The datetime when this transfer was created. This will be of the form `2006-01-02T15:04:05Z` - attr_accessor :created - - # A date in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). The next transfer origination date after bank holiday adjustment. - attr_accessor :next_origination_date - - # Plaid’s unique identifier for a test clock. - attr_accessor :test_clock_id - - attr_accessor :type - - # 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. - attr_accessor :amount - - attr_accessor :status - - attr_accessor :ach_class - - attr_accessor :network - - # Plaid’s unique identifier for the origination account that was used for this transfer. - attr_accessor :origination_account_id - - # The Plaid `account_id` corresponding to the end-user account that will be debited or credited. - attr_accessor :account_id - - # The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited. - attr_accessor :funding_account_id - - # The currency of the transfer amount, e.g. \"USD\" - attr_accessor :iso_currency_code - - # The description of the recurring transfer. - attr_accessor :description - - attr_accessor :transfer_ids - - attr_accessor :user - - attr_accessor :schedule - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'recurring_transfer_id' => :'recurring_transfer_id', - :'created' => :'created', - :'next_origination_date' => :'next_origination_date', - :'test_clock_id' => :'test_clock_id', - :'type' => :'type', - :'amount' => :'amount', - :'status' => :'status', - :'ach_class' => :'ach_class', - :'network' => :'network', - :'origination_account_id' => :'origination_account_id', - :'account_id' => :'account_id', - :'funding_account_id' => :'funding_account_id', - :'iso_currency_code' => :'iso_currency_code', - :'description' => :'description', - :'transfer_ids' => :'transfer_ids', - :'user' => :'user', - :'schedule' => :'schedule' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'recurring_transfer_id' => :'String', - :'created' => :'Time', - :'next_origination_date' => :'Date', - :'test_clock_id' => :'String', - :'type' => :'TransferType', - :'amount' => :'String', - :'status' => :'TransferRecurringStatus', - :'ach_class' => :'ACHClass', - :'network' => :'TransferNetwork', - :'origination_account_id' => :'String', - :'account_id' => :'String', - :'funding_account_id' => :'String', - :'iso_currency_code' => :'String', - :'description' => :'String', - :'transfer_ids' => :'Array', - :'user' => :'TransferUserInResponse', - :'schedule' => :'TransferRecurringSchedule' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_origination_date', - :'test_clock_id', - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'RecurringTransfer' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RecurringTransferNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RecurringTransferNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'recurring_transfer_id') - self.recurring_transfer_id = attributes[:'recurring_transfer_id'] - end - - if attributes.key?(:'created') - self.created = attributes[:'created'] - end - - if attributes.key?(:'next_origination_date') - self.next_origination_date = attributes[:'next_origination_date'] - end - - if attributes.key?(:'test_clock_id') - self.test_clock_id = attributes[:'test_clock_id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'ach_class') - self.ach_class = attributes[:'ach_class'] - end - - if attributes.key?(:'network') - self.network = attributes[:'network'] - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'transfer_ids') - if (value = attributes[:'transfer_ids']).is_a?(Array) - self.transfer_ids = value - end - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'schedule') - self.schedule = attributes[:'schedule'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @recurring_transfer_id.nil? - invalid_properties.push('invalid value for "recurring_transfer_id", recurring_transfer_id cannot be nil.') - end - - if @created.nil? - invalid_properties.push('invalid value for "created", created cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @network.nil? - invalid_properties.push('invalid value for "network", network cannot be nil.') - end - - if @origination_account_id.nil? - invalid_properties.push('invalid value for "origination_account_id", origination_account_id cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @funding_account_id.nil? - invalid_properties.push('invalid value for "funding_account_id", funding_account_id cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @transfer_ids.nil? - invalid_properties.push('invalid value for "transfer_ids", transfer_ids cannot be nil.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if @schedule.nil? - invalid_properties.push('invalid value for "schedule", schedule cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @recurring_transfer_id.nil? - return false if @created.nil? - return false if @type.nil? - return false if @amount.nil? - return false if @status.nil? - return false if @network.nil? - return false if @origination_account_id.nil? - return false if @account_id.nil? - return false if @funding_account_id.nil? - return false if @iso_currency_code.nil? - return false if @description.nil? - return false if @transfer_ids.nil? - return false if @user.nil? - return false if @schedule.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - recurring_transfer_id == o.recurring_transfer_id && - created == o.created && - next_origination_date == o.next_origination_date && - test_clock_id == o.test_clock_id && - type == o.type && - amount == o.amount && - status == o.status && - ach_class == o.ach_class && - network == o.network && - origination_account_id == o.origination_account_id && - account_id == o.account_id && - funding_account_id == o.funding_account_id && - iso_currency_code == o.iso_currency_code && - description == o.description && - transfer_ids == o.transfer_ids && - user == o.user && - schedule == o.schedule - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [recurring_transfer_id, created, next_origination_date, test_clock_id, type, amount, status, ach_class, network, origination_account_id, account_id, funding_account_id, iso_currency_code, description, transfer_ids, user, schedule].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/recurring_transfer_skipped_webhook.rb b/lib/plaid/models/recurring_transfer_skipped_webhook.rb deleted file mode 100644 index c7c8e5557..000000000 --- a/lib/plaid/models/recurring_transfer_skipped_webhook.rb +++ /dev/null @@ -1,330 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when Plaid is unable to originate a new ACH transaction of the recurring transfer on the planned date. - class RecurringTransferSkippedWebhook - # `TRANSFER` - attr_accessor :webhook_type - - # `RECURRING_TRANSFER_SKIPPED` - attr_accessor :webhook_code - - # Plaid’s unique identifier for a recurring transfer. - attr_accessor :recurring_transfer_id - - attr_accessor :authorization_decision - - attr_accessor :authorization_decision_rationale_code - - # 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. - attr_accessor :skipped_origination_date - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'recurring_transfer_id' => :'recurring_transfer_id', - :'authorization_decision' => :'authorization_decision', - :'authorization_decision_rationale_code' => :'authorization_decision_rationale_code', - :'skipped_origination_date' => :'skipped_origination_date', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'recurring_transfer_id' => :'String', - :'authorization_decision' => :'TransferAuthorizationDecision', - :'authorization_decision_rationale_code' => :'TransferAuthorizationDecisionRationaleCode', - :'skipped_origination_date' => :'Date', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RecurringTransferSkippedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RecurringTransferSkippedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'recurring_transfer_id') - self.recurring_transfer_id = attributes[:'recurring_transfer_id'] - end - - if attributes.key?(:'authorization_decision') - self.authorization_decision = attributes[:'authorization_decision'] - end - - if attributes.key?(:'authorization_decision_rationale_code') - self.authorization_decision_rationale_code = attributes[:'authorization_decision_rationale_code'] - end - - if attributes.key?(:'skipped_origination_date') - self.skipped_origination_date = attributes[:'skipped_origination_date'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @recurring_transfer_id.nil? - invalid_properties.push('invalid value for "recurring_transfer_id", recurring_transfer_id cannot be nil.') - end - - if @authorization_decision.nil? - invalid_properties.push('invalid value for "authorization_decision", authorization_decision cannot be nil.') - end - - if @skipped_origination_date.nil? - invalid_properties.push('invalid value for "skipped_origination_date", skipped_origination_date cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @recurring_transfer_id.nil? - return false if @authorization_decision.nil? - return false if @skipped_origination_date.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - recurring_transfer_id == o.recurring_transfer_id && - authorization_decision == o.authorization_decision && - authorization_decision_rationale_code == o.authorization_decision_rationale_code && - skipped_origination_date == o.skipped_origination_date && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, recurring_transfer_id, authorization_decision, authorization_decision_rationale_code, skipped_origination_date, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/removed_transaction.rb b/lib/plaid/models/removed_transaction.rb deleted file mode 100644 index f8c75a2ba..000000000 --- a/lib/plaid/models/removed_transaction.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A representation of a removed transaction - class RemovedTransaction - # The ID of the removed transaction. - attr_accessor :transaction_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_id' => :'transaction_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RemovedTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RemovedTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_id == o.transaction_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/report_type.rb b/lib/plaid/models/report_type.rb deleted file mode 100644 index 894a9c518..000000000 --- a/lib/plaid/models/report_type.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class ReportType - ASSET = "asset".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/reporting_information.rb b/lib/plaid/models/reporting_information.rb deleted file mode 100644 index 60149160b..000000000 --- a/lib/plaid/models/reporting_information.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about an report identifier and a report name. - class ReportingInformation - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - attr_accessor :reporting_information_identifier - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reporting_information_identifier' => :'ReportingInformationIdentifier' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'reporting_information_identifier' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ReportingInformation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ReportingInformation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reporting_information_identifier') - self.reporting_information_identifier = attributes[:'reporting_information_identifier'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @reporting_information_identifier.nil? - invalid_properties.push('invalid value for "reporting_information_identifier", reporting_information_identifier cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @reporting_information_identifier.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reporting_information_identifier == o.reporting_information_identifier - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reporting_information_identifier].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/risk_check_behavior.rb b/lib/plaid/models/risk_check_behavior.rb deleted file mode 100644 index 72eb2d2ae..000000000 --- a/lib/plaid/models/risk_check_behavior.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Result summary object specifying values for `behavior` attributes of risk check, when available. - class RiskCheckBehavior - attr_accessor :user_interactions - - attr_accessor :fraud_ring_detected - - attr_accessor :bot_detected - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_interactions' => :'user_interactions', - :'fraud_ring_detected' => :'fraud_ring_detected', - :'bot_detected' => :'bot_detected' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_interactions' => :'RiskCheckBehaviorUserInteractionsLabel', - :'fraud_ring_detected' => :'RiskCheckBehaviorFraudRingDetectedLabel', - :'bot_detected' => :'RiskCheckBehaviorBotDetectedLabel' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RiskCheckBehavior` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RiskCheckBehavior`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_interactions') - self.user_interactions = attributes[:'user_interactions'] - end - - if attributes.key?(:'fraud_ring_detected') - self.fraud_ring_detected = attributes[:'fraud_ring_detected'] - end - - if attributes.key?(:'bot_detected') - self.bot_detected = attributes[:'bot_detected'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_interactions.nil? - invalid_properties.push('invalid value for "user_interactions", user_interactions cannot be nil.') - end - - if @fraud_ring_detected.nil? - invalid_properties.push('invalid value for "fraud_ring_detected", fraud_ring_detected cannot be nil.') - end - - if @bot_detected.nil? - invalid_properties.push('invalid value for "bot_detected", bot_detected cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_interactions.nil? - return false if @fraud_ring_detected.nil? - return false if @bot_detected.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_interactions == o.user_interactions && - fraud_ring_detected == o.fraud_ring_detected && - bot_detected == o.bot_detected - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_interactions, fraud_ring_detected, bot_detected].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/risk_check_behavior_bot_detected_label.rb b/lib/plaid/models/risk_check_behavior_bot_detected_label.rb deleted file mode 100644 index b0641d219..000000000 --- a/lib/plaid/models/risk_check_behavior_bot_detected_label.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class RiskCheckBehaviorBotDetectedLabel - YES = "yes".freeze - NO = "no".freeze - NO_DATA = "no_data".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/risk_check_behavior_fraud_ring_detected_label.rb b/lib/plaid/models/risk_check_behavior_fraud_ring_detected_label.rb deleted file mode 100644 index b06602ab5..000000000 --- a/lib/plaid/models/risk_check_behavior_fraud_ring_detected_label.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class RiskCheckBehaviorFraudRingDetectedLabel - YES = "yes".freeze - NO = "no".freeze - NO_DATA = "no_data".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/risk_check_behavior_user_interactions_label.rb b/lib/plaid/models/risk_check_behavior_user_interactions_label.rb deleted file mode 100644 index e998dd7df..000000000 --- a/lib/plaid/models/risk_check_behavior_user_interactions_label.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class RiskCheckBehaviorUserInteractionsLabel - GENUINE = "genuine".freeze - NEUTRAL = "neutral".freeze - RISKY = "risky".freeze - NO_DATA = "no_data".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/risk_check_details.rb b/lib/plaid/models/risk_check_details.rb deleted file mode 100644 index dfaa9f89d..000000000 --- a/lib/plaid/models/risk_check_details.rb +++ /dev/null @@ -1,304 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Additional information for the `risk_check` step. - class RiskCheckDetails - attr_accessor :status - - attr_accessor :behavior - - attr_accessor :email - - attr_accessor :phone - - # Array of result summary objects specifying values for `device` attributes of risk check. - attr_accessor :devices - - attr_accessor :identity_abuse_signals - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'behavior' => :'behavior', - :'email' => :'email', - :'phone' => :'phone', - :'devices' => :'devices', - :'identity_abuse_signals' => :'identity_abuse_signals' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'IdentityVerificationStepStatus', - :'behavior' => :'RiskCheckBehavior', - :'email' => :'RiskCheckEmail', - :'phone' => :'RiskCheckPhone', - :'devices' => :'Array', - :'identity_abuse_signals' => :'RiskCheckIdentityAbuseSignals' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'behavior', - :'email', - :'phone', - :'identity_abuse_signals' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RiskCheckDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RiskCheckDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'behavior') - self.behavior = attributes[:'behavior'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'phone') - self.phone = attributes[:'phone'] - end - - if attributes.key?(:'devices') - if (value = attributes[:'devices']).is_a?(Array) - self.devices = value - end - end - - if attributes.key?(:'identity_abuse_signals') - self.identity_abuse_signals = attributes[:'identity_abuse_signals'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @devices.nil? - invalid_properties.push('invalid value for "devices", devices cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @status.nil? - return false if @devices.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - behavior == o.behavior && - email == o.email && - phone == o.phone && - devices == o.devices && - identity_abuse_signals == o.identity_abuse_signals - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, behavior, email, phone, devices, identity_abuse_signals].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/risk_check_device.rb b/lib/plaid/models/risk_check_device.rb deleted file mode 100644 index b91064406..000000000 --- a/lib/plaid/models/risk_check_device.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Result summary object specifying values for `device` attributes of risk check. - class RiskCheckDevice - attr_accessor :ip_proxy_type - - # Count of spam lists the IP address is associated with if known. - attr_accessor :ip_spam_list_count - - # UTC offset of the timezone associated with the IP address. - attr_accessor :ip_timezone_offset - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ip_proxy_type' => :'ip_proxy_type', - :'ip_spam_list_count' => :'ip_spam_list_count', - :'ip_timezone_offset' => :'ip_timezone_offset' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ip_proxy_type' => :'ProxyType', - :'ip_spam_list_count' => :'Integer', - :'ip_timezone_offset' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'ip_proxy_type', - :'ip_spam_list_count', - :'ip_timezone_offset' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RiskCheckDevice` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RiskCheckDevice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ip_proxy_type') - self.ip_proxy_type = attributes[:'ip_proxy_type'] - end - - if attributes.key?(:'ip_spam_list_count') - self.ip_spam_list_count = attributes[:'ip_spam_list_count'] - end - - if attributes.key?(:'ip_timezone_offset') - self.ip_timezone_offset = attributes[:'ip_timezone_offset'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ip_proxy_type == o.ip_proxy_type && - ip_spam_list_count == o.ip_spam_list_count && - ip_timezone_offset == o.ip_timezone_offset - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ip_proxy_type, ip_spam_list_count, ip_timezone_offset].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/risk_check_email.rb b/lib/plaid/models/risk_check_email.rb deleted file mode 100644 index f7cd17dc8..000000000 --- a/lib/plaid/models/risk_check_email.rb +++ /dev/null @@ -1,376 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Result summary object specifying values for `email` attributes of risk check. - class RiskCheckEmail - attr_accessor :is_deliverable - - # Count of all known breaches of this email address if known. - attr_accessor :breach_count - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :first_breached_at - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :last_breached_at - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :domain_registered_at - - attr_accessor :domain_is_free_provider - - attr_accessor :domain_is_custom - - attr_accessor :domain_is_disposable - - attr_accessor :top_level_domain_is_suspicious - - # A list of online services where this email address has been detected to have accounts or other activity. - attr_accessor :linked_services - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'is_deliverable' => :'is_deliverable', - :'breach_count' => :'breach_count', - :'first_breached_at' => :'first_breached_at', - :'last_breached_at' => :'last_breached_at', - :'domain_registered_at' => :'domain_registered_at', - :'domain_is_free_provider' => :'domain_is_free_provider', - :'domain_is_custom' => :'domain_is_custom', - :'domain_is_disposable' => :'domain_is_disposable', - :'top_level_domain_is_suspicious' => :'top_level_domain_is_suspicious', - :'linked_services' => :'linked_services' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'is_deliverable' => :'RiskCheckEmailIsDeliverableStatus', - :'breach_count' => :'Integer', - :'first_breached_at' => :'Date', - :'last_breached_at' => :'Date', - :'domain_registered_at' => :'Date', - :'domain_is_free_provider' => :'RiskCheckEmailDomainIsFreeProvider', - :'domain_is_custom' => :'RiskCheckEmailDomainIsCustom', - :'domain_is_disposable' => :'RiskCheckEmailDomainIsDisposable', - :'top_level_domain_is_suspicious' => :'RiskCheckEmailTopLevelDomainIsSuspicious', - :'linked_services' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'breach_count', - :'first_breached_at', - :'last_breached_at', - :'domain_registered_at', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RiskCheckEmail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RiskCheckEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'is_deliverable') - self.is_deliverable = attributes[:'is_deliverable'] - end - - if attributes.key?(:'breach_count') - self.breach_count = attributes[:'breach_count'] - end - - if attributes.key?(:'first_breached_at') - self.first_breached_at = attributes[:'first_breached_at'] - end - - if attributes.key?(:'last_breached_at') - self.last_breached_at = attributes[:'last_breached_at'] - end - - if attributes.key?(:'domain_registered_at') - self.domain_registered_at = attributes[:'domain_registered_at'] - end - - if attributes.key?(:'domain_is_free_provider') - self.domain_is_free_provider = attributes[:'domain_is_free_provider'] - end - - if attributes.key?(:'domain_is_custom') - self.domain_is_custom = attributes[:'domain_is_custom'] - end - - if attributes.key?(:'domain_is_disposable') - self.domain_is_disposable = attributes[:'domain_is_disposable'] - end - - if attributes.key?(:'top_level_domain_is_suspicious') - self.top_level_domain_is_suspicious = attributes[:'top_level_domain_is_suspicious'] - end - - if attributes.key?(:'linked_services') - if (value = attributes[:'linked_services']).is_a?(Array) - self.linked_services = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @is_deliverable.nil? - invalid_properties.push('invalid value for "is_deliverable", is_deliverable cannot be nil.') - end - - if @domain_is_free_provider.nil? - invalid_properties.push('invalid value for "domain_is_free_provider", domain_is_free_provider cannot be nil.') - end - - if @domain_is_custom.nil? - invalid_properties.push('invalid value for "domain_is_custom", domain_is_custom cannot be nil.') - end - - if @domain_is_disposable.nil? - invalid_properties.push('invalid value for "domain_is_disposable", domain_is_disposable cannot be nil.') - end - - if @top_level_domain_is_suspicious.nil? - invalid_properties.push('invalid value for "top_level_domain_is_suspicious", top_level_domain_is_suspicious cannot be nil.') - end - - if @linked_services.nil? - invalid_properties.push('invalid value for "linked_services", linked_services cannot be nil.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @is_deliverable.nil? - return false if @domain_is_free_provider.nil? - return false if @domain_is_custom.nil? - return false if @domain_is_disposable.nil? - return false if @top_level_domain_is_suspicious.nil? - return false if @linked_services.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] linked_services Value to be assigned - def linked_services=(linked_services) - if linked_services.nil? - fail ArgumentError, 'linked_services cannot be nil' - end - - - @linked_services = linked_services - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - is_deliverable == o.is_deliverable && - breach_count == o.breach_count && - first_breached_at == o.first_breached_at && - last_breached_at == o.last_breached_at && - domain_registered_at == o.domain_registered_at && - domain_is_free_provider == o.domain_is_free_provider && - domain_is_custom == o.domain_is_custom && - domain_is_disposable == o.domain_is_disposable && - top_level_domain_is_suspicious == o.top_level_domain_is_suspicious && - linked_services == o.linked_services - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [is_deliverable, breach_count, first_breached_at, last_breached_at, domain_registered_at, domain_is_free_provider, domain_is_custom, domain_is_disposable, top_level_domain_is_suspicious, linked_services].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/risk_check_email_domain_is_custom.rb b/lib/plaid/models/risk_check_email_domain_is_custom.rb deleted file mode 100644 index 889bdd921..000000000 --- a/lib/plaid/models/risk_check_email_domain_is_custom.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class RiskCheckEmailDomainIsCustom - YES = "yes".freeze - NO = "no".freeze - NO_DATA = "no_data".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/risk_check_email_domain_is_disposable.rb b/lib/plaid/models/risk_check_email_domain_is_disposable.rb deleted file mode 100644 index 262940c8f..000000000 --- a/lib/plaid/models/risk_check_email_domain_is_disposable.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class RiskCheckEmailDomainIsDisposable - YES = "yes".freeze - NO = "no".freeze - NO_DATA = "no_data".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/risk_check_email_domain_is_free_provider.rb b/lib/plaid/models/risk_check_email_domain_is_free_provider.rb deleted file mode 100644 index a5ed35653..000000000 --- a/lib/plaid/models/risk_check_email_domain_is_free_provider.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class RiskCheckEmailDomainIsFreeProvider - YES = "yes".freeze - NO = "no".freeze - NO_DATA = "no_data".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/risk_check_email_is_deliverable_status.rb b/lib/plaid/models/risk_check_email_is_deliverable_status.rb deleted file mode 100644 index 3fa707087..000000000 --- a/lib/plaid/models/risk_check_email_is_deliverable_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class RiskCheckEmailIsDeliverableStatus - YES = "yes".freeze - NO = "no".freeze - NO_DATA = "no_data".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/risk_check_email_top_level_domain_is_suspicious.rb b/lib/plaid/models/risk_check_email_top_level_domain_is_suspicious.rb deleted file mode 100644 index 7be9d1966..000000000 --- a/lib/plaid/models/risk_check_email_top_level_domain_is_suspicious.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class RiskCheckEmailTopLevelDomainIsSuspicious - YES = "yes".freeze - NO = "no".freeze - NO_DATA = "no_data".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/risk_check_identity_abuse_signals.rb b/lib/plaid/models/risk_check_identity_abuse_signals.rb deleted file mode 100644 index 98d4e2322..000000000 --- a/lib/plaid/models/risk_check_identity_abuse_signals.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Result summary object capturing abuse signals related to `identity abuse`, e.g. stolen and synthetic identity fraud. - class RiskCheckIdentityAbuseSignals - attr_accessor :synthetic_identity - - attr_accessor :stolen_identity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'synthetic_identity' => :'synthetic_identity', - :'stolen_identity' => :'stolen_identity' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'synthetic_identity' => :'RiskCheckSyntheticIdentity', - :'stolen_identity' => :'RiskCheckStolenIdentity' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'synthetic_identity', - :'stolen_identity' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RiskCheckIdentityAbuseSignals` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RiskCheckIdentityAbuseSignals`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'synthetic_identity') - self.synthetic_identity = attributes[:'synthetic_identity'] - end - - if attributes.key?(:'stolen_identity') - self.stolen_identity = attributes[:'stolen_identity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - synthetic_identity == o.synthetic_identity && - stolen_identity == o.stolen_identity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [synthetic_identity, stolen_identity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/risk_check_linked_service.rb b/lib/plaid/models/risk_check_linked_service.rb deleted file mode 100644 index 93e71cf01..000000000 --- a/lib/plaid/models/risk_check_linked_service.rb +++ /dev/null @@ -1,71 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class RiskCheckLinkedService - APPLE = "apple".freeze - EBAY = "ebay".freeze - FACEBOOK = "facebook".freeze - FLICKR = "flickr".freeze - FOURSQUARE = "foursquare".freeze - GITHUB = "github".freeze - GOOGLE = "google".freeze - GRAVATAR = "gravatar".freeze - INSTAGRAM = "instagram".freeze - LASTFM = "lastfm".freeze - LINKEDIN = "linkedin".freeze - MICROSOFT = "microsoft".freeze - MYSPACE = "myspace".freeze - PINTEREST = "pinterest".freeze - SKYPE = "skype".freeze - SPOTIFY = "spotify".freeze - TELEGRAM = "telegram".freeze - TUMBLR = "tumblr".freeze - TWITTER = "twitter".freeze - VIBER = "viber".freeze - VIMEO = "vimeo".freeze - WEIBO = "weibo".freeze - WHATSAPP = "whatsapp".freeze - YAHOO = "yahoo".freeze - AIRBNB = "airbnb".freeze - AMAZON = "amazon".freeze - BOOKING = "booking".freeze - DISCORD = "discord".freeze - KAKAO = "kakao".freeze - OK = "ok".freeze - QZONE = "qzone".freeze - LINE = "line".freeze - SNAPCHAT = "snapchat".freeze - ZALO = "zalo".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/risk_check_phone.rb b/lib/plaid/models/risk_check_phone.rb deleted file mode 100644 index db87675cd..000000000 --- a/lib/plaid/models/risk_check_phone.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Result summary object specifying values for `phone` attributes of risk check. - class RiskCheckPhone - # A list of online services where this phone number has been detected to have accounts or other activity. - attr_accessor :linked_services - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'linked_services' => :'linked_services' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'linked_services' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RiskCheckPhone` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RiskCheckPhone`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'linked_services') - if (value = attributes[:'linked_services']).is_a?(Array) - self.linked_services = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @linked_services.nil? - invalid_properties.push('invalid value for "linked_services", linked_services cannot be nil.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @linked_services.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] linked_services Value to be assigned - def linked_services=(linked_services) - if linked_services.nil? - fail ArgumentError, 'linked_services cannot be nil' - end - - - @linked_services = linked_services - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - linked_services == o.linked_services - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [linked_services].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/risk_check_stolen_identity.rb b/lib/plaid/models/risk_check_stolen_identity.rb deleted file mode 100644 index 81537b139..000000000 --- a/lib/plaid/models/risk_check_stolen_identity.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Field containing the data used in determining the outcome of the stolen identity risk check. Contains the following fields: `score` - A score from 0 to 100 indicating the likelihood that the user is a stolen identity. - class RiskCheckStolenIdentity - # A score from 0 to 100 indicating the likelihood that the user is a stolen identity. - attr_accessor :score - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'score' => :'score' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'score' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RiskCheckStolenIdentity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RiskCheckStolenIdentity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'score') - self.score = attributes[:'score'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @score.nil? - invalid_properties.push('invalid value for "score", score cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @score.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - score == o.score - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [score].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/risk_check_synthetic_identity.rb b/lib/plaid/models/risk_check_synthetic_identity.rb deleted file mode 100644 index d4f3313e9..000000000 --- a/lib/plaid/models/risk_check_synthetic_identity.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Field containing the data used in determining the outcome of the synthetic identity risk check. Contains the following fields: `score` - A score from 0 to 100 indicating the likelihood that the user is a synthetic identity. - class RiskCheckSyntheticIdentity - # A score from 0 to 100 indicating the likelihood that the user is a synthetic identity. - attr_accessor :score - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'score' => :'score' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'score' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RiskCheckSyntheticIdentity` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RiskCheckSyntheticIdentity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'score') - self.score = attributes[:'score'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @score.nil? - invalid_properties.push('invalid value for "score", score cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @score.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - score == o.score - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [score].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/risk_profile.rb b/lib/plaid/models/risk_profile.rb deleted file mode 100644 index 1364ace46..000000000 --- a/lib/plaid/models/risk_profile.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class RiskProfile - # The name of the risk profile used for this transaction. - attr_accessor :key - - # The name of the evaluated outcome for this transaction. - attr_accessor :outcome - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'outcome' => :'outcome' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'String', - :'outcome' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RiskProfile` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RiskProfile`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'outcome') - self.outcome = attributes[:'outcome'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - outcome == o.outcome - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, outcome].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/risk_reason.rb b/lib/plaid/models/risk_reason.rb deleted file mode 100644 index 0132cbcd0..000000000 --- a/lib/plaid/models/risk_reason.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # This object includes a code and description to describe medium risk transactions and above on /accounts/balance/get. - class RiskReason - # A code that represents the type of risk associated with the proposed transaction. The codes are from PL01 to PL07 and from BK01 to BK07. - attr_accessor :code - - # A brief description explaining the risk associated with the proposed transaction and some recommended actions. - attr_accessor :description - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'description' => :'description' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'description' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RiskReason` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RiskReason`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - description == o.description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/risk_signal_document_reference.rb b/lib/plaid/models/risk_signal_document_reference.rb deleted file mode 100644 index 571cd35a8..000000000 --- a/lib/plaid/models/risk_signal_document_reference.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Object containing metadata for the document - class RiskSignalDocumentReference - # An identifier of the document referenced by the document metadata. - attr_accessor :document_id - - # The name of the document - attr_accessor :document_name - - attr_accessor :status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'document_id' => :'document_id', - :'document_name' => :'document_name', - :'status' => :'status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'document_id' => :'String', - :'document_name' => :'String', - :'status' => :'RiskSignalDocumentStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'document_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RiskSignalDocumentReference` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RiskSignalDocumentReference`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'document_id') - self.document_id = attributes[:'document_id'] - end - - if attributes.key?(:'document_name') - self.document_name = attributes[:'document_name'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - document_id == o.document_id && - document_name == o.document_name && - status == o.status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [document_id, document_name, status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/risk_signal_document_status.rb b/lib/plaid/models/risk_signal_document_status.rb deleted file mode 100644 index 4c477e106..000000000 --- a/lib/plaid/models/risk_signal_document_status.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class RiskSignalDocumentStatus - PROCESSING = "PROCESSING".freeze - PROCESSING_COMPLETE = "PROCESSING_COMPLETE".freeze - PROCESSING_ERROR = "PROCESSING_ERROR".freeze - PASSWORD_PROTECTED = "PASSWORD_PROTECTED".freeze - VIRUS_DETECTED = "VIRUS_DETECTED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/role.rb b/lib/plaid/models/role.rb deleted file mode 100644 index 3bf7460a6..000000000 --- a/lib/plaid/models/role.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # ADocumentation not found in the MISMO model viewer and not provided by Freddie Mac. - class Role - attr_accessor :role_detail - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'role_detail' => :'ROLE_DETAIL' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'role_detail' => :'RoleDetail' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Role` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Role`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'role_detail') - self.role_detail = attributes[:'role_detail'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @role_detail.nil? - invalid_properties.push('invalid value for "role_detail", role_detail cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @role_detail.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - role_detail == o.role_detail - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [role_detail].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/role_detail.rb b/lib/plaid/models/role_detail.rb deleted file mode 100644 index 37806dfa2..000000000 --- a/lib/plaid/models/role_detail.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class RoleDetail - attr_accessor :party_role_type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'party_role_type' => :'PartyRoleType' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'party_role_type' => :'PartyRoleType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::RoleDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::RoleDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'party_role_type') - self.party_role_type = attributes[:'party_role_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @party_role_type.nil? - invalid_properties.push('invalid value for "party_role_type", party_role_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @party_role_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - party_role_type == o.party_role_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [party_role_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/roles.rb b/lib/plaid/models/roles.rb deleted file mode 100644 index 212e24823..000000000 --- a/lib/plaid/models/roles.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class Roles - attr_accessor :role - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'role' => :'ROLE' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'role' => :'Role' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Roles` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Roles`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'role') - self.role = attributes[:'role'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @role.nil? - invalid_properties.push('invalid value for "role", role cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @role.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - role == o.role - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [role].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_bank_income_fire_webhook_request.rb b/lib/plaid/models/sandbox_bank_income_fire_webhook_request.rb deleted file mode 100644 index da1d3bf74..000000000 --- a/lib/plaid/models/sandbox_bank_income_fire_webhook_request.rb +++ /dev/null @@ -1,291 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxBankIncomeFireWebhookRequest defines the request schema for `/sandbox/bank_income/fire_webhook` - class SandboxBankIncomeFireWebhookRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The URL to which the webhook should be sent. If provided, this will override the URL set in the dashboard. - attr_accessor :webhook_override - - attr_accessor :webhook_code - - attr_accessor :webhook_fields - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'webhook_override' => :'webhook_override', - :'webhook_code' => :'webhook_code', - :'webhook_fields' => :'webhook_fields' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'webhook_override' => :'String', - :'webhook_code' => :'SandboxBankIncomeWebhookFireRequestWebhookCode', - :'webhook_fields' => :'SandboxBankIncomeWebhookFireRequestWebhookFields' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxBankIncomeFireWebhookRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxBankIncomeFireWebhookRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'webhook_override') - self.webhook_override = attributes[:'webhook_override'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'webhook_fields') - self.webhook_fields = attributes[:'webhook_fields'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @webhook_fields.nil? - invalid_properties.push('invalid value for "webhook_fields", webhook_fields cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_code.nil? - return false if @webhook_fields.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - webhook_override == o.webhook_override && - webhook_code == o.webhook_code && - webhook_fields == o.webhook_fields - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, webhook_override, webhook_code, webhook_fields].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_bank_income_fire_webhook_response.rb b/lib/plaid/models/sandbox_bank_income_fire_webhook_response.rb deleted file mode 100644 index d39abf236..000000000 --- a/lib/plaid/models/sandbox_bank_income_fire_webhook_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxBankIncomeFireWebhookResponse defines the response schema for `/sandbox/bank_income/fire_webhook` - class SandboxBankIncomeFireWebhookResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxBankIncomeFireWebhookResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxBankIncomeFireWebhookResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_bank_income_webhook_fire_request_webhook_code.rb b/lib/plaid/models/sandbox_bank_income_webhook_fire_request_webhook_code.rb deleted file mode 100644 index c6ddaafe1..000000000 --- a/lib/plaid/models/sandbox_bank_income_webhook_fire_request_webhook_code.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class SandboxBankIncomeWebhookFireRequestWebhookCode - UPDATE = "BANK_INCOME_REFRESH_UPDATE".freeze - COMPLETE = "BANK_INCOME_REFRESH_COMPLETE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/sandbox_bank_income_webhook_fire_request_webhook_fields.rb b/lib/plaid/models/sandbox_bank_income_webhook_fire_request_webhook_fields.rb deleted file mode 100644 index 968f3d218..000000000 --- a/lib/plaid/models/sandbox_bank_income_webhook_fire_request_webhook_fields.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Optional fields which will be populated in the simulated webhook - class SandboxBankIncomeWebhookFireRequestWebhookFields - # The user id to be returned in INCOME webhooks - attr_accessor :user_id - - attr_accessor :bank_income_refresh_complete_result - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'user_id', - :'bank_income_refresh_complete_result' => :'bank_income_refresh_complete_result' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'bank_income_refresh_complete_result' => :'BankIncomeRefreshCompleteResult' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxBankIncomeWebhookFireRequestWebhookFields` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxBankIncomeWebhookFireRequestWebhookFields`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'bank_income_refresh_complete_result') - self.bank_income_refresh_complete_result = attributes[:'bank_income_refresh_complete_result'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_id.nil? - invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - bank_income_refresh_complete_result == o.bank_income_refresh_complete_result - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, bank_income_refresh_complete_result].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_bank_transfer_fire_webhook_request.rb b/lib/plaid/models/sandbox_bank_transfer_fire_webhook_request.rb deleted file mode 100644 index 2cc3eed96..000000000 --- a/lib/plaid/models/sandbox_bank_transfer_fire_webhook_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/sandbox/bank_transfer/fire_webhook` - class SandboxBankTransferFireWebhookRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The URL to which the webhook should be sent. - attr_accessor :webhook - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'webhook' => :'webhook' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'webhook' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxBankTransferFireWebhookRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxBankTransferFireWebhookRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook.nil? - invalid_properties.push('invalid value for "webhook", webhook cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - webhook == o.webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, webhook].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_bank_transfer_fire_webhook_response.rb b/lib/plaid/models/sandbox_bank_transfer_fire_webhook_response.rb deleted file mode 100644 index 5a1ca1be0..000000000 --- a/lib/plaid/models/sandbox_bank_transfer_fire_webhook_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/sandbox/bank_transfer/fire_webhook` - class SandboxBankTransferFireWebhookResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxBankTransferFireWebhookResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxBankTransferFireWebhookResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_bank_transfer_simulate_request.rb b/lib/plaid/models/sandbox_bank_transfer_simulate_request.rb deleted file mode 100644 index 996d29a53..000000000 --- a/lib/plaid/models/sandbox_bank_transfer_simulate_request.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/sandbox/bank_transfer/simulate` - class SandboxBankTransferSimulateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a bank transfer. - attr_accessor :bank_transfer_id - - # The asynchronous event to be simulated. May be: `posted`, `failed`, or `reversed`. An error will be returned if the event type is incompatible with the current transfer status. Compatible status --> event type transitions include: `pending` --> `failed` `pending` --> `posted` `posted` --> `reversed` - attr_accessor :event_type - - attr_accessor :failure_reason - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'bank_transfer_id' => :'bank_transfer_id', - :'event_type' => :'event_type', - :'failure_reason' => :'failure_reason' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'bank_transfer_id' => :'String', - :'event_type' => :'String', - :'failure_reason' => :'BankTransferFailure' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'failure_reason' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxBankTransferSimulateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxBankTransferSimulateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'bank_transfer_id') - self.bank_transfer_id = attributes[:'bank_transfer_id'] - end - - if attributes.key?(:'event_type') - self.event_type = attributes[:'event_type'] - end - - if attributes.key?(:'failure_reason') - self.failure_reason = attributes[:'failure_reason'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @bank_transfer_id.nil? - invalid_properties.push('invalid value for "bank_transfer_id", bank_transfer_id cannot be nil.') - end - - if @event_type.nil? - invalid_properties.push('invalid value for "event_type", event_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @bank_transfer_id.nil? - return false if @event_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - bank_transfer_id == o.bank_transfer_id && - event_type == o.event_type && - failure_reason == o.failure_reason - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, bank_transfer_id, event_type, failure_reason].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_bank_transfer_simulate_response.rb b/lib/plaid/models/sandbox_bank_transfer_simulate_response.rb deleted file mode 100644 index 17eecd847..000000000 --- a/lib/plaid/models/sandbox_bank_transfer_simulate_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/sandbox/bank_transfer/simulate` - class SandboxBankTransferSimulateResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxBankTransferSimulateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxBankTransferSimulateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_income_fire_webhook_request.rb b/lib/plaid/models/sandbox_income_fire_webhook_request.rb deleted file mode 100644 index 2ee2ce51c..000000000 --- a/lib/plaid/models/sandbox_income_fire_webhook_request.rb +++ /dev/null @@ -1,329 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxIncomeFireWebhookRequest defines the request schema for `/sandbox/income/fire_webhook` - class SandboxIncomeFireWebhookRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The Item ID associated with the verification. - attr_accessor :item_id - - # The Plaid `user_id` of the User associated with this webhook, warning, or error. - attr_accessor :user_id - - # The URL to which the webhook should be sent. - attr_accessor :webhook - - # `VERIFICATION_STATUS_PROCESSING_COMPLETE`: The income verification status processing has completed. If the user uploaded multiple documents, this webhook will fire when all documents have finished processing. Call the `/income/verification/paystubs/get` endpoint and check the document metadata to see which documents were successfully parsed. `VERIFICATION_STATUS_PROCESSING_FAILED`: A failure occurred when attempting to process the verification documentation. `VERIFICATION_STATUS_PENDING_APPROVAL`: (deprecated) The income verification has been sent to the user for review. - attr_accessor :verification_status - - attr_accessor :webhook_code - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'item_id' => :'item_id', - :'user_id' => :'user_id', - :'webhook' => :'webhook', - :'verification_status' => :'verification_status', - :'webhook_code' => :'webhook_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'item_id' => :'String', - :'user_id' => :'String', - :'webhook' => :'String', - :'verification_status' => :'String', - :'webhook_code' => :'SandboxIncomeWebhookFireRequestWebhookCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxIncomeFireWebhookRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxIncomeFireWebhookRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @webhook.nil? - invalid_properties.push('invalid value for "webhook", webhook cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @item_id.nil? - return false if @webhook.nil? - verification_status_validator = EnumAttributeValidator.new('String', ["VERIFICATION_STATUS_PROCESSING_COMPLETE", "VERIFICATION_STATUS_PROCESSING_FAILED", "VERIFICATION_STATUS_PENDING_APPROVAL"]) - return false unless verification_status_validator.valid?(@verification_status) - return false if @webhook_code.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] verification_status Object to be assigned - def verification_status=(verification_status) - validator = EnumAttributeValidator.new('String', ["VERIFICATION_STATUS_PROCESSING_COMPLETE", "VERIFICATION_STATUS_PROCESSING_FAILED", "VERIFICATION_STATUS_PENDING_APPROVAL"]) - unless validator.valid?(verification_status) - fail ArgumentError, "invalid value for \"verification_status\", must be one of #{validator.allowable_values}." - end - @verification_status = verification_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - item_id == o.item_id && - user_id == o.user_id && - webhook == o.webhook && - verification_status == o.verification_status && - webhook_code == o.webhook_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, item_id, user_id, webhook, verification_status, webhook_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_income_fire_webhook_response.rb b/lib/plaid/models/sandbox_income_fire_webhook_response.rb deleted file mode 100644 index 64adb2a47..000000000 --- a/lib/plaid/models/sandbox_income_fire_webhook_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxIncomeFireWebhookResponse defines the response schema for `/sandbox/income/fire_webhook` - class SandboxIncomeFireWebhookResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxIncomeFireWebhookResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxIncomeFireWebhookResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_income_webhook_fire_request_webhook_code.rb b/lib/plaid/models/sandbox_income_webhook_fire_request_webhook_code.rb deleted file mode 100644 index f0a936f27..000000000 --- a/lib/plaid/models/sandbox_income_webhook_fire_request_webhook_code.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class SandboxIncomeWebhookFireRequestWebhookCode - VERIFICATION = "INCOME_VERIFICATION".freeze - VERIFICATION_RISK_SIGNALS = "INCOME_VERIFICATION_RISK_SIGNALS".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/sandbox_item_fire_webhook_request.rb b/lib/plaid/models/sandbox_item_fire_webhook_request.rb deleted file mode 100644 index 243742ef2..000000000 --- a/lib/plaid/models/sandbox_item_fire_webhook_request.rb +++ /dev/null @@ -1,304 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxItemFireWebhookRequest defines the request schema for `/sandbox/item/fire_webhook` - class SandboxItemFireWebhookRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - attr_accessor :webhook_type - - # The webhook codes that can be fired by this test endpoint. - attr_accessor :webhook_code - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'webhook_type' => :'WebhookType', - :'webhook_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxItemFireWebhookRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxItemFireWebhookRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @webhook_code.nil? - webhook_code_validator = EnumAttributeValidator.new('String', ["DEFAULT_UPDATE", "NEW_ACCOUNTS_AVAILABLE", "AUTH_DATA_UPDATE", "AUTHORIZATION_GRANTED", "RECURRING_TRANSACTIONS_UPDATE", "SYNC_UPDATES_AVAILABLE", "PRODUCT_READY", "ERROR"]) - return false unless webhook_code_validator.valid?(@webhook_code) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] webhook_code Object to be assigned - def webhook_code=(webhook_code) - validator = EnumAttributeValidator.new('String', ["DEFAULT_UPDATE", "NEW_ACCOUNTS_AVAILABLE", "AUTH_DATA_UPDATE", "AUTHORIZATION_GRANTED", "RECURRING_TRANSACTIONS_UPDATE", "SYNC_UPDATES_AVAILABLE", "PRODUCT_READY", "ERROR"]) - unless validator.valid?(webhook_code) - fail ArgumentError, "invalid value for \"webhook_code\", must be one of #{validator.allowable_values}." - end - @webhook_code = webhook_code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, webhook_type, webhook_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_item_fire_webhook_response.rb b/lib/plaid/models/sandbox_item_fire_webhook_response.rb deleted file mode 100644 index 1d0d6c435..000000000 --- a/lib/plaid/models/sandbox_item_fire_webhook_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxItemFireWebhookResponse defines the response schema for `/sandbox/item/fire_webhook` - class SandboxItemFireWebhookResponse - # Value is `true` if the test` webhook_code` was successfully fired. - attr_accessor :webhook_fired - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_fired' => :'webhook_fired', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_fired' => :'Boolean', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxItemFireWebhookResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxItemFireWebhookResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_fired') - self.webhook_fired = attributes[:'webhook_fired'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_fired.nil? - invalid_properties.push('invalid value for "webhook_fired", webhook_fired cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_fired.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_fired == o.webhook_fired && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_fired, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_item_reset_login_request.rb b/lib/plaid/models/sandbox_item_reset_login_request.rb deleted file mode 100644 index 07d669bf1..000000000 --- a/lib/plaid/models/sandbox_item_reset_login_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxItemResetLoginRequest defines the request schema for `/sandbox/item/reset_login` - class SandboxItemResetLoginRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxItemResetLoginRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxItemResetLoginRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_item_reset_login_response.rb b/lib/plaid/models/sandbox_item_reset_login_response.rb deleted file mode 100644 index fb0fea86a..000000000 --- a/lib/plaid/models/sandbox_item_reset_login_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxItemResetLoginResponse defines the response schema for `/sandbox/item/reset_login` - class SandboxItemResetLoginResponse - # `true` if the call succeeded - attr_accessor :reset_login - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reset_login' => :'reset_login', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'reset_login' => :'Boolean', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxItemResetLoginResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxItemResetLoginResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reset_login') - self.reset_login = attributes[:'reset_login'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @reset_login.nil? - invalid_properties.push('invalid value for "reset_login", reset_login cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @reset_login.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reset_login == o.reset_login && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reset_login, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_item_set_verification_status_request.rb b/lib/plaid/models/sandbox_item_set_verification_status_request.rb deleted file mode 100644 index 33bbc637e..000000000 --- a/lib/plaid/models/sandbox_item_set_verification_status_request.rb +++ /dev/null @@ -1,310 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxItemSetVerificationStatusRequest defines the request schema for `/sandbox/item/set_verification_status` - class SandboxItemSetVerificationStatusRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # The `account_id` of the account whose verification status is to be modified - attr_accessor :account_id - - # The verification status to set the account to. - attr_accessor :verification_status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'account_id' => :'account_id', - :'verification_status' => :'verification_status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'account_id' => :'String', - :'verification_status' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxItemSetVerificationStatusRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxItemSetVerificationStatusRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @verification_status.nil? - invalid_properties.push('invalid value for "verification_status", verification_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @account_id.nil? - return false if @verification_status.nil? - verification_status_validator = EnumAttributeValidator.new('String', ["automatically_verified", "verification_expired"]) - return false unless verification_status_validator.valid?(@verification_status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] verification_status Object to be assigned - def verification_status=(verification_status) - validator = EnumAttributeValidator.new('String', ["automatically_verified", "verification_expired"]) - unless validator.valid?(verification_status) - fail ArgumentError, "invalid value for \"verification_status\", must be one of #{validator.allowable_values}." - end - @verification_status = verification_status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - account_id == o.account_id && - verification_status == o.verification_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, account_id, verification_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_item_set_verification_status_response.rb b/lib/plaid/models/sandbox_item_set_verification_status_response.rb deleted file mode 100644 index a7129f08f..000000000 --- a/lib/plaid/models/sandbox_item_set_verification_status_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxItemSetVerificationStatusResponse defines the response schema for `/sandbox/item/set_verification_status` - class SandboxItemSetVerificationStatusResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxItemSetVerificationStatusResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxItemSetVerificationStatusResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_oauth_select_accounts_request.rb b/lib/plaid/models/sandbox_oauth_select_accounts_request.rb deleted file mode 100644 index 704a44675..000000000 --- a/lib/plaid/models/sandbox_oauth_select_accounts_request.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `sandbox/oauth/select_accounts` - class SandboxOauthSelectAccountsRequest - attr_accessor :oauth_state_id - - attr_accessor :accounts - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'oauth_state_id' => :'oauth_state_id', - :'accounts' => :'accounts' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'oauth_state_id' => :'String', - :'accounts' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxOauthSelectAccountsRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxOauthSelectAccountsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'oauth_state_id') - self.oauth_state_id = attributes[:'oauth_state_id'] - end - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @oauth_state_id.nil? - invalid_properties.push('invalid value for "oauth_state_id", oauth_state_id cannot be nil.') - end - - if @accounts.nil? - invalid_properties.push('invalid value for "accounts", accounts cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @oauth_state_id.nil? - return false if @accounts.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - oauth_state_id == o.oauth_state_id && - accounts == o.accounts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [oauth_state_id, accounts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_payment_profile_reset_login_request.rb b/lib/plaid/models/sandbox_payment_profile_reset_login_request.rb deleted file mode 100644 index 6f0c17389..000000000 --- a/lib/plaid/models/sandbox_payment_profile_reset_login_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxPaymentProfileResetLoginRequest defines the request schema for `/sandbox/payment_profile/reset_login` - class SandboxPaymentProfileResetLoginRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A payment profile token associated with the Payment Profile data that is being requested. - attr_accessor :payment_profile_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'payment_profile_token' => :'payment_profile_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'payment_profile_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxPaymentProfileResetLoginRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxPaymentProfileResetLoginRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'payment_profile_token') - self.payment_profile_token = attributes[:'payment_profile_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment_profile_token.nil? - invalid_properties.push('invalid value for "payment_profile_token", payment_profile_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment_profile_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - payment_profile_token == o.payment_profile_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, payment_profile_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_payment_profile_reset_login_response.rb b/lib/plaid/models/sandbox_payment_profile_reset_login_response.rb deleted file mode 100644 index fa0f683fa..000000000 --- a/lib/plaid/models/sandbox_payment_profile_reset_login_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxPaymentProfileResetLoginResponse defines the response schema for `/sandbox/payment_profile/reset_login` - class SandboxPaymentProfileResetLoginResponse - # `true` if the call succeeded - attr_accessor :reset_login - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reset_login' => :'reset_login', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'reset_login' => :'Boolean', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxPaymentProfileResetLoginResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxPaymentProfileResetLoginResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reset_login') - self.reset_login = attributes[:'reset_login'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @reset_login.nil? - invalid_properties.push('invalid value for "reset_login", reset_login cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @reset_login.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reset_login == o.reset_login && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reset_login, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_processor_token_create_request.rb b/lib/plaid/models/sandbox_processor_token_create_request.rb deleted file mode 100644 index a36dab99e..000000000 --- a/lib/plaid/models/sandbox_processor_token_create_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxProcessorTokenCreateRequest defines the request schema for `/sandbox/processor_token/create` - class SandboxProcessorTokenCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the institution the Item will be associated with - attr_accessor :institution_id - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'institution_id' => :'institution_id', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'institution_id' => :'String', - :'options' => :'SandboxProcessorTokenCreateRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxProcessorTokenCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxProcessorTokenCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @institution_id.nil? - invalid_properties.push('invalid value for "institution_id", institution_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @institution_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - institution_id == o.institution_id && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, institution_id, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_processor_token_create_request_options.rb b/lib/plaid/models/sandbox_processor_token_create_request_options.rb deleted file mode 100644 index fc8e72256..000000000 --- a/lib/plaid/models/sandbox_processor_token_create_request_options.rb +++ /dev/null @@ -1,237 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional set of options to be used when configuring the Item. If specified, must not be `null`. - class SandboxProcessorTokenCreateRequestOptions - # Test username to use for the creation of the Sandbox Item. Default value is `user_good`. - attr_accessor :override_username - - # Test password to use for the creation of the Sandbox Item. Default value is `pass_good`. - attr_accessor :override_password - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'override_username' => :'override_username', - :'override_password' => :'override_password' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'override_username' => :'String', - :'override_password' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'override_username', - :'override_password' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxProcessorTokenCreateRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxProcessorTokenCreateRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'override_username') - self.override_username = attributes[:'override_username'] - else - self.override_username = 'user_good' - end - - if attributes.key?(:'override_password') - self.override_password = attributes[:'override_password'] - else - self.override_password = 'pass_good' - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - override_username == o.override_username && - override_password == o.override_password - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [override_username, override_password].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_processor_token_create_response.rb b/lib/plaid/models/sandbox_processor_token_create_response.rb deleted file mode 100644 index c570e9a84..000000000 --- a/lib/plaid/models/sandbox_processor_token_create_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxProcessorTokenCreateResponse defines the response schema for `/sandbox/processor_token/create` - class SandboxProcessorTokenCreateResponse - # A processor token that can be used to call the `/processor/` endpoints. - attr_accessor :processor_token - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'processor_token' => :'processor_token', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'processor_token' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxProcessorTokenCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxProcessorTokenCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'processor_token') - self.processor_token = attributes[:'processor_token'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @processor_token.nil? - invalid_properties.push('invalid value for "processor_token", processor_token cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @processor_token.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - processor_token == o.processor_token && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [processor_token, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_public_token_create_request.rb b/lib/plaid/models/sandbox_public_token_create_request.rb deleted file mode 100644 index 3b445764b..000000000 --- a/lib/plaid/models/sandbox_public_token_create_request.rb +++ /dev/null @@ -1,303 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxPublicTokenCreateRequest defines the request schema for `/sandbox/public_token/create` - class SandboxPublicTokenCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the institution the Item will be associated with - attr_accessor :institution_id - - # The products to initially pull for the Item. May be any products that the specified `institution_id` supports. This array may not be empty. - attr_accessor :initial_products - - attr_accessor :options - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'institution_id' => :'institution_id', - :'initial_products' => :'initial_products', - :'options' => :'options', - :'user_token' => :'user_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'institution_id' => :'String', - :'initial_products' => :'Array', - :'options' => :'SandboxPublicTokenCreateRequestOptions', - :'user_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxPublicTokenCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxPublicTokenCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'initial_products') - if (value = attributes[:'initial_products']).is_a?(Array) - self.initial_products = value - end - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @institution_id.nil? - invalid_properties.push('invalid value for "institution_id", institution_id cannot be nil.') - end - - if @initial_products.nil? - invalid_properties.push('invalid value for "initial_products", initial_products cannot be nil.') - end - - - if @initial_products.length < 1 - invalid_properties.push('invalid value for "initial_products", number of items must be greater than or equal to 1.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @institution_id.nil? - return false if @initial_products.nil? - return false if @initial_products.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] initial_products Value to be assigned - def initial_products=(initial_products) - if initial_products.nil? - fail ArgumentError, 'initial_products cannot be nil' - end - - - if initial_products.length < 1 - fail ArgumentError, 'invalid value for "initial_products", number of items must be greater than or equal to 1.' - end - - @initial_products = initial_products - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - institution_id == o.institution_id && - initial_products == o.initial_products && - options == o.options && - user_token == o.user_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, institution_id, initial_products, options, user_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_public_token_create_request_income_verification_bank_income.rb b/lib/plaid/models/sandbox_public_token_create_request_income_verification_bank_income.rb deleted file mode 100644 index a12c3309c..000000000 --- a/lib/plaid/models/sandbox_public_token_create_request_income_verification_bank_income.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specifies options for Bank Income. This field is required if `income_verification` is included in the `initial_products` array and `bank` is specified in `income_source_types`. - class SandboxPublicTokenCreateRequestIncomeVerificationBankIncome - # The number of days of data to request for the Bank Income product - attr_accessor :days_requested - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'days_requested' => :'days_requested' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'days_requested' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxPublicTokenCreateRequestIncomeVerificationBankIncome` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxPublicTokenCreateRequestIncomeVerificationBankIncome`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - days_requested == o.days_requested - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [days_requested].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_public_token_create_request_options.rb b/lib/plaid/models/sandbox_public_token_create_request_options.rb deleted file mode 100644 index 0b00c7dcc..000000000 --- a/lib/plaid/models/sandbox_public_token_create_request_options.rb +++ /dev/null @@ -1,265 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional set of options to be used when configuring the Item. If specified, must not be `null`. - class SandboxPublicTokenCreateRequestOptions - # Specify a webhook to associate with the new Item. - attr_accessor :webhook - - # Test username to use for the creation of the Sandbox Item. Default value is `user_good`. - attr_accessor :override_username - - # Test password to use for the creation of the Sandbox Item. Default value is `pass_good`. - attr_accessor :override_password - - attr_accessor :transactions - - attr_accessor :income_verification - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook' => :'webhook', - :'override_username' => :'override_username', - :'override_password' => :'override_password', - :'transactions' => :'transactions', - :'income_verification' => :'income_verification' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook' => :'String', - :'override_username' => :'String', - :'override_password' => :'String', - :'transactions' => :'SandboxPublicTokenCreateRequestOptionsTransactions', - :'income_verification' => :'SandboxPublicTokenCreateRequestOptionsIncomeVerification' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'override_username', - :'override_password', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxPublicTokenCreateRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxPublicTokenCreateRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - - if attributes.key?(:'override_username') - self.override_username = attributes[:'override_username'] - else - self.override_username = 'user_good' - end - - if attributes.key?(:'override_password') - self.override_password = attributes[:'override_password'] - else - self.override_password = 'pass_good' - end - - if attributes.key?(:'transactions') - self.transactions = attributes[:'transactions'] - end - - if attributes.key?(:'income_verification') - self.income_verification = attributes[:'income_verification'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook == o.webhook && - override_username == o.override_username && - override_password == o.override_password && - transactions == o.transactions && - income_verification == o.income_verification - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook, override_username, override_password, transactions, income_verification].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_public_token_create_request_options_income_verification.rb b/lib/plaid/models/sandbox_public_token_create_request_options_income_verification.rb deleted file mode 100644 index 9051b10e2..000000000 --- a/lib/plaid/models/sandbox_public_token_create_request_options_income_verification.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A set of parameters for income verification options. This field is required if `income_verification` is included in the `initial_products` array. - class SandboxPublicTokenCreateRequestOptionsIncomeVerification - # 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. - attr_accessor :income_source_types - - attr_accessor :bank_income - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'income_source_types' => :'income_source_types', - :'bank_income' => :'bank_income' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'income_source_types' => :'Array', - :'bank_income' => :'SandboxPublicTokenCreateRequestIncomeVerificationBankIncome' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxPublicTokenCreateRequestOptionsIncomeVerification` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxPublicTokenCreateRequestOptionsIncomeVerification`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'income_source_types') - if (value = attributes[:'income_source_types']).is_a?(Array) - self.income_source_types = value - end - end - - if attributes.key?(:'bank_income') - self.bank_income = attributes[:'bank_income'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - income_source_types == o.income_source_types && - bank_income == o.bank_income - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [income_source_types, bank_income].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_public_token_create_request_options_transactions.rb b/lib/plaid/models/sandbox_public_token_create_request_options_transactions.rb deleted file mode 100644 index a86249dc3..000000000 --- a/lib/plaid/models/sandbox_public_token_create_request_options_transactions.rb +++ /dev/null @@ -1,269 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional set of parameters corresponding to transactions options. - class SandboxPublicTokenCreateRequestOptionsTransactions - # The earliest date for which to fetch transaction history. Dates should be formatted as YYYY-MM-DD. - attr_accessor :start_date - - # The most recent date for which to fetch transaction history. Dates should be formatted as YYYY-MM-DD. - attr_accessor :end_date - - # The maximum number of days of transaction history to request for the Transactions product. - attr_accessor :days_requested - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'days_requested' => :'days_requested' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_date' => :'Date', - :'end_date' => :'Date', - :'days_requested' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxPublicTokenCreateRequestOptionsTransactions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxPublicTokenCreateRequestOptionsTransactions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - else - self.days_requested = 90 - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@days_requested.nil? && @days_requested > 730 - invalid_properties.push('invalid value for "days_requested", must be smaller than or equal to 730.') - end - - if !@days_requested.nil? && @days_requested < 1 - invalid_properties.push('invalid value for "days_requested", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@days_requested.nil? && @days_requested > 730 - return false if !@days_requested.nil? && @days_requested < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] days_requested Value to be assigned - def days_requested=(days_requested) - if !days_requested.nil? && days_requested > 730 - fail ArgumentError, 'invalid value for "days_requested", must be smaller than or equal to 730.' - end - - if !days_requested.nil? && days_requested < 1 - fail ArgumentError, 'invalid value for "days_requested", must be greater than or equal to 1.' - end - - - @days_requested = days_requested - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_date == o.start_date && - end_date == o.end_date && - days_requested == o.days_requested - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_date, end_date, days_requested].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_public_token_create_response.rb b/lib/plaid/models/sandbox_public_token_create_response.rb deleted file mode 100644 index 24fd34374..000000000 --- a/lib/plaid/models/sandbox_public_token_create_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SandboxPublicTokenCreateResponse defines the response schema for `/sandbox/public_token/create` - class SandboxPublicTokenCreateResponse - # A public token that can be exchanged for an access token using `/item/public_token/exchange` - attr_accessor :public_token - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'public_token' => :'public_token', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'public_token' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxPublicTokenCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxPublicTokenCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'public_token') - self.public_token = attributes[:'public_token'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @public_token.nil? - invalid_properties.push('invalid value for "public_token", public_token cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @public_token.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - public_token == o.public_token && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [public_token, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_fire_webhook_request.rb b/lib/plaid/models/sandbox_transfer_fire_webhook_request.rb deleted file mode 100644 index e4fbda71d..000000000 --- a/lib/plaid/models/sandbox_transfer_fire_webhook_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/sandbox/transfer/fire_webhook` - class SandboxTransferFireWebhookRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The URL to which the webhook should be sent. - attr_accessor :webhook - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'webhook' => :'webhook' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'webhook' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferFireWebhookRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferFireWebhookRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'webhook') - self.webhook = attributes[:'webhook'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook.nil? - invalid_properties.push('invalid value for "webhook", webhook cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - webhook == o.webhook - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, webhook].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_fire_webhook_response.rb b/lib/plaid/models/sandbox_transfer_fire_webhook_response.rb deleted file mode 100644 index a8f437aa8..000000000 --- a/lib/plaid/models/sandbox_transfer_fire_webhook_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/sandbox/transfer/fire_webhook` - class SandboxTransferFireWebhookResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferFireWebhookResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferFireWebhookResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_ledger_deposit_simulate_request.rb b/lib/plaid/models/sandbox_transfer_ledger_deposit_simulate_request.rb deleted file mode 100644 index 5f9b8603c..000000000 --- a/lib/plaid/models/sandbox_transfer_ledger_deposit_simulate_request.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/sandbox/transfer/ledger/deposit/simulate` - class SandboxTransferLedgerDepositSimulateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a sweep. - attr_accessor :sweep_id - - attr_accessor :event_type - - attr_accessor :failure_reason - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'sweep_id' => :'sweep_id', - :'event_type' => :'event_type', - :'failure_reason' => :'failure_reason' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'sweep_id' => :'String', - :'event_type' => :'TransferLedgerSweepSimulateEventType', - :'failure_reason' => :'TransferFailure' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'failure_reason' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferLedgerDepositSimulateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferLedgerDepositSimulateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'sweep_id') - self.sweep_id = attributes[:'sweep_id'] - end - - if attributes.key?(:'event_type') - self.event_type = attributes[:'event_type'] - end - - if attributes.key?(:'failure_reason') - self.failure_reason = attributes[:'failure_reason'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @sweep_id.nil? - invalid_properties.push('invalid value for "sweep_id", sweep_id cannot be nil.') - end - - if @event_type.nil? - invalid_properties.push('invalid value for "event_type", event_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @sweep_id.nil? - return false if @event_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - sweep_id == o.sweep_id && - event_type == o.event_type && - failure_reason == o.failure_reason - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, sweep_id, event_type, failure_reason].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_ledger_deposit_simulate_response.rb b/lib/plaid/models/sandbox_transfer_ledger_deposit_simulate_response.rb deleted file mode 100644 index 2d923545f..000000000 --- a/lib/plaid/models/sandbox_transfer_ledger_deposit_simulate_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/sandbox/transfer/ledger/deposit/simulate` - class SandboxTransferLedgerDepositSimulateResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferLedgerDepositSimulateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferLedgerDepositSimulateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_ledger_simulate_available_request.rb b/lib/plaid/models/sandbox_transfer_ledger_simulate_available_request.rb deleted file mode 100644 index ca335ef2b..000000000 --- a/lib/plaid/models/sandbox_transfer_ledger_simulate_available_request.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/sandbox/transfer/ledger/simulate_available` - class SandboxTransferLedgerSimulateAvailableRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a test clock. If provided, only the pending balance that is due before the `virtual_timestamp` on the test clock will be converted. - attr_accessor :test_clock_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'test_clock_id' => :'test_clock_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'test_clock_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'test_clock_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferLedgerSimulateAvailableRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferLedgerSimulateAvailableRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'test_clock_id') - self.test_clock_id = attributes[:'test_clock_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - test_clock_id == o.test_clock_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, test_clock_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_ledger_simulate_available_response.rb b/lib/plaid/models/sandbox_transfer_ledger_simulate_available_response.rb deleted file mode 100644 index 4efb1aebb..000000000 --- a/lib/plaid/models/sandbox_transfer_ledger_simulate_available_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/sandbox/transfer/ledger/simulate_available` - class SandboxTransferLedgerSimulateAvailableResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferLedgerSimulateAvailableResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferLedgerSimulateAvailableResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_ledger_withdraw_simulate_request.rb b/lib/plaid/models/sandbox_transfer_ledger_withdraw_simulate_request.rb deleted file mode 100644 index 80d170ca7..000000000 --- a/lib/plaid/models/sandbox_transfer_ledger_withdraw_simulate_request.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/sandbox/transfer/ledger/withdraw/simulate` - class SandboxTransferLedgerWithdrawSimulateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a sweep. - attr_accessor :sweep_id - - attr_accessor :event_type - - attr_accessor :failure_reason - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'sweep_id' => :'sweep_id', - :'event_type' => :'event_type', - :'failure_reason' => :'failure_reason' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'sweep_id' => :'String', - :'event_type' => :'TransferLedgerSweepSimulateEventType', - :'failure_reason' => :'TransferFailure' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'failure_reason' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferLedgerWithdrawSimulateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferLedgerWithdrawSimulateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'sweep_id') - self.sweep_id = attributes[:'sweep_id'] - end - - if attributes.key?(:'event_type') - self.event_type = attributes[:'event_type'] - end - - if attributes.key?(:'failure_reason') - self.failure_reason = attributes[:'failure_reason'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @sweep_id.nil? - invalid_properties.push('invalid value for "sweep_id", sweep_id cannot be nil.') - end - - if @event_type.nil? - invalid_properties.push('invalid value for "event_type", event_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @sweep_id.nil? - return false if @event_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - sweep_id == o.sweep_id && - event_type == o.event_type && - failure_reason == o.failure_reason - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, sweep_id, event_type, failure_reason].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_ledger_withdraw_simulate_response.rb b/lib/plaid/models/sandbox_transfer_ledger_withdraw_simulate_response.rb deleted file mode 100644 index 573fe39d3..000000000 --- a/lib/plaid/models/sandbox_transfer_ledger_withdraw_simulate_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/sandbox/transfer/ledger/withdraw/simulate` - class SandboxTransferLedgerWithdrawSimulateResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferLedgerWithdrawSimulateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferLedgerWithdrawSimulateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_refund_simulate_request.rb b/lib/plaid/models/sandbox_transfer_refund_simulate_request.rb deleted file mode 100644 index 6b67fbf99..000000000 --- a/lib/plaid/models/sandbox_transfer_refund_simulate_request.rb +++ /dev/null @@ -1,282 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/sandbox/transfer/refund/simulate` - class SandboxTransferRefundSimulateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a refund. - attr_accessor :refund_id - - # Plaid’s unique identifier for a test clock. If provided, the event to be simulated is created at the `virtual_time` on the provided `test_clock`. - attr_accessor :test_clock_id - - # The asynchronous event to be simulated. May be: `refund.posted`, `refund.settled`, `refund.failed`, or `refund.returned`. An error will be returned if the event type is incompatible with the current refund status. Compatible status --> event type transitions include: `refund.pending` --> `refund.failed` `refund.pending` --> `refund.posted` `refund.posted` --> `refund.returned` `refund.posted` --> `refund.settled` `refund.posted` events can only be simulated if the refunded transfer has been transitioned to settled. This mimics the ordering of events in Production. - attr_accessor :event_type - - attr_accessor :failure_reason - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'refund_id' => :'refund_id', - :'test_clock_id' => :'test_clock_id', - :'event_type' => :'event_type', - :'failure_reason' => :'failure_reason' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'refund_id' => :'String', - :'test_clock_id' => :'String', - :'event_type' => :'String', - :'failure_reason' => :'TransferFailure' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'test_clock_id', - :'failure_reason' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferRefundSimulateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferRefundSimulateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'refund_id') - self.refund_id = attributes[:'refund_id'] - end - - if attributes.key?(:'test_clock_id') - self.test_clock_id = attributes[:'test_clock_id'] - end - - if attributes.key?(:'event_type') - self.event_type = attributes[:'event_type'] - end - - if attributes.key?(:'failure_reason') - self.failure_reason = attributes[:'failure_reason'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @refund_id.nil? - invalid_properties.push('invalid value for "refund_id", refund_id cannot be nil.') - end - - if @event_type.nil? - invalid_properties.push('invalid value for "event_type", event_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @refund_id.nil? - return false if @event_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - refund_id == o.refund_id && - test_clock_id == o.test_clock_id && - event_type == o.event_type && - failure_reason == o.failure_reason - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, refund_id, test_clock_id, event_type, failure_reason].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_refund_simulate_response.rb b/lib/plaid/models/sandbox_transfer_refund_simulate_response.rb deleted file mode 100644 index c6a587691..000000000 --- a/lib/plaid/models/sandbox_transfer_refund_simulate_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/sandbox/transfer/refund/simulate` - class SandboxTransferRefundSimulateResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferRefundSimulateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferRefundSimulateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_repayment_simulate_request.rb b/lib/plaid/models/sandbox_transfer_repayment_simulate_request.rb deleted file mode 100644 index 06ebdbc5a..000000000 --- a/lib/plaid/models/sandbox_transfer_repayment_simulate_request.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/sandbox/transfer/repayment/simulate` - class SandboxTransferRepaymentSimulateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferRepaymentSimulateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferRepaymentSimulateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_repayment_simulate_response.rb b/lib/plaid/models/sandbox_transfer_repayment_simulate_response.rb deleted file mode 100644 index 8eca42fda..000000000 --- a/lib/plaid/models/sandbox_transfer_repayment_simulate_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/sandbox/transfer/repayment/simulate` - class SandboxTransferRepaymentSimulateResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferRepaymentSimulateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferRepaymentSimulateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_simulate_request.rb b/lib/plaid/models/sandbox_transfer_simulate_request.rb deleted file mode 100644 index 4f3efad0d..000000000 --- a/lib/plaid/models/sandbox_transfer_simulate_request.rb +++ /dev/null @@ -1,282 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/sandbox/transfer/simulate` - class SandboxTransferSimulateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a transfer. - attr_accessor :transfer_id - - # Plaid’s unique identifier for a test clock. If provided, the event to be simulated is created at the `virtual_time` on the provided `test_clock`. - attr_accessor :test_clock_id - - # 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 transfer status. Compatible status --> event type transitions include: `pending` --> `failed` `pending` --> `posted` `posted` --> `returned` `posted` --> `settled` - attr_accessor :event_type - - attr_accessor :failure_reason - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'transfer_id' => :'transfer_id', - :'test_clock_id' => :'test_clock_id', - :'event_type' => :'event_type', - :'failure_reason' => :'failure_reason' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'transfer_id' => :'String', - :'test_clock_id' => :'String', - :'event_type' => :'String', - :'failure_reason' => :'TransferFailure' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'test_clock_id', - :'failure_reason' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferSimulateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferSimulateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'transfer_id') - self.transfer_id = attributes[:'transfer_id'] - end - - if attributes.key?(:'test_clock_id') - self.test_clock_id = attributes[:'test_clock_id'] - end - - if attributes.key?(:'event_type') - self.event_type = attributes[:'event_type'] - end - - if attributes.key?(:'failure_reason') - self.failure_reason = attributes[:'failure_reason'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transfer_id.nil? - invalid_properties.push('invalid value for "transfer_id", transfer_id cannot be nil.') - end - - if @event_type.nil? - invalid_properties.push('invalid value for "event_type", event_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transfer_id.nil? - return false if @event_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - transfer_id == o.transfer_id && - test_clock_id == o.test_clock_id && - event_type == o.event_type && - failure_reason == o.failure_reason - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, transfer_id, test_clock_id, event_type, failure_reason].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_simulate_response.rb b/lib/plaid/models/sandbox_transfer_simulate_response.rb deleted file mode 100644 index 2a566ba85..000000000 --- a/lib/plaid/models/sandbox_transfer_simulate_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/sandbox/transfer/simulate` - class SandboxTransferSimulateResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferSimulateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferSimulateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_sweep_simulate_request.rb b/lib/plaid/models/sandbox_transfer_sweep_simulate_request.rb deleted file mode 100644 index f900f0726..000000000 --- a/lib/plaid/models/sandbox_transfer_sweep_simulate_request.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/sandbox/transfer/sweep/simulate` - class SandboxTransferSweepSimulateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a test clock. If provided, the sweep to be simulated is created on the day of the `virtual_time` on the `test_clock`. If the date of `virtual_time` is on weekend or a federal holiday, the next available banking day is used. - attr_accessor :test_clock_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'test_clock_id' => :'test_clock_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'test_clock_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'test_clock_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferSweepSimulateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferSweepSimulateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'test_clock_id') - self.test_clock_id = attributes[:'test_clock_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - test_clock_id == o.test_clock_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, test_clock_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_sweep_simulate_response.rb b/lib/plaid/models/sandbox_transfer_sweep_simulate_response.rb deleted file mode 100644 index 67ec37c1f..000000000 --- a/lib/plaid/models/sandbox_transfer_sweep_simulate_response.rb +++ /dev/null @@ -1,235 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/sandbox/transfer/sweep/simulate` - class SandboxTransferSweepSimulateResponse - attr_accessor :sweep - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sweep' => :'sweep', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sweep' => :'SimulatedTransferSweep', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferSweepSimulateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferSweepSimulateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sweep') - self.sweep = attributes[:'sweep'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sweep == o.sweep && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sweep, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_test_clock_advance_request.rb b/lib/plaid/models/sandbox_transfer_test_clock_advance_request.rb deleted file mode 100644 index e3f6e1977..000000000 --- a/lib/plaid/models/sandbox_transfer_test_clock_advance_request.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/sandbox/transfer/test_clock/advance` - class SandboxTransferTestClockAdvanceRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a test clock. - attr_accessor :test_clock_id - - # The virtual timestamp on the test clock. This will be of the form `2006-01-02T15:04:05Z`. - attr_accessor :new_virtual_time - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'test_clock_id' => :'test_clock_id', - :'new_virtual_time' => :'new_virtual_time' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'test_clock_id' => :'String', - :'new_virtual_time' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferTestClockAdvanceRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferTestClockAdvanceRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'test_clock_id') - self.test_clock_id = attributes[:'test_clock_id'] - end - - if attributes.key?(:'new_virtual_time') - self.new_virtual_time = attributes[:'new_virtual_time'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @test_clock_id.nil? - invalid_properties.push('invalid value for "test_clock_id", test_clock_id cannot be nil.') - end - - if @new_virtual_time.nil? - invalid_properties.push('invalid value for "new_virtual_time", new_virtual_time cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @test_clock_id.nil? - return false if @new_virtual_time.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - test_clock_id == o.test_clock_id && - new_virtual_time == o.new_virtual_time - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, test_clock_id, new_virtual_time].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_test_clock_advance_response.rb b/lib/plaid/models/sandbox_transfer_test_clock_advance_response.rb deleted file mode 100644 index c5d24ffac..000000000 --- a/lib/plaid/models/sandbox_transfer_test_clock_advance_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/sandbox/transfer/test_clock/advance` - class SandboxTransferTestClockAdvanceResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferTestClockAdvanceResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferTestClockAdvanceResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_test_clock_create_request.rb b/lib/plaid/models/sandbox_transfer_test_clock_create_request.rb deleted file mode 100644 index 63b93626f..000000000 --- a/lib/plaid/models/sandbox_transfer_test_clock_create_request.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/sandbox/transfer/test_clock/create` - class SandboxTransferTestClockCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The virtual timestamp on the test clock. If not provided, the current timestamp will be used. This will be of the form `2006-01-02T15:04:05Z`. - attr_accessor :virtual_time - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'virtual_time' => :'virtual_time' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'virtual_time' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'virtual_time' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferTestClockCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferTestClockCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'virtual_time') - self.virtual_time = attributes[:'virtual_time'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - virtual_time == o.virtual_time - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, virtual_time].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_test_clock_create_response.rb b/lib/plaid/models/sandbox_transfer_test_clock_create_response.rb deleted file mode 100644 index 1617d1d92..000000000 --- a/lib/plaid/models/sandbox_transfer_test_clock_create_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/sandbox/transfer/test_clock/create` - class SandboxTransferTestClockCreateResponse - attr_accessor :test_clock - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'test_clock' => :'test_clock', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'test_clock' => :'TransferTestClock', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferTestClockCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferTestClockCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'test_clock') - self.test_clock = attributes[:'test_clock'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @test_clock.nil? - invalid_properties.push('invalid value for "test_clock", test_clock cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @test_clock.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - test_clock == o.test_clock && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [test_clock, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_test_clock_get_request.rb b/lib/plaid/models/sandbox_transfer_test_clock_get_request.rb deleted file mode 100644 index 1dad5811e..000000000 --- a/lib/plaid/models/sandbox_transfer_test_clock_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/sandbox/transfer/test_clock/get` - class SandboxTransferTestClockGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a test clock. - attr_accessor :test_clock_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'test_clock_id' => :'test_clock_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'test_clock_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferTestClockGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferTestClockGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'test_clock_id') - self.test_clock_id = attributes[:'test_clock_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @test_clock_id.nil? - invalid_properties.push('invalid value for "test_clock_id", test_clock_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @test_clock_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - test_clock_id == o.test_clock_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, test_clock_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_test_clock_get_response.rb b/lib/plaid/models/sandbox_transfer_test_clock_get_response.rb deleted file mode 100644 index 7194de33f..000000000 --- a/lib/plaid/models/sandbox_transfer_test_clock_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/sandbox/transfer/test_clock/get` - class SandboxTransferTestClockGetResponse - attr_accessor :test_clock - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'test_clock' => :'test_clock', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'test_clock' => :'TransferTestClock', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferTestClockGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferTestClockGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'test_clock') - self.test_clock = attributes[:'test_clock'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @test_clock.nil? - invalid_properties.push('invalid value for "test_clock", test_clock cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @test_clock.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - test_clock == o.test_clock && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [test_clock, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_test_clock_list_request.rb b/lib/plaid/models/sandbox_transfer_test_clock_list_request.rb deleted file mode 100644 index c1b0092ab..000000000 --- a/lib/plaid/models/sandbox_transfer_test_clock_list_request.rb +++ /dev/null @@ -1,321 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/sandbox/transfer/test_clock/list` - class SandboxTransferTestClockListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The start virtual timestamp of test clocks to return. This should be in RFC 3339 format (i.e. `2019-12-06T22:35:49Z`) - attr_accessor :start_virtual_time - - # The end virtual timestamp of test clocks to return. This should be in RFC 3339 format (i.e. `2019-12-06T22:35:49Z`) - attr_accessor :end_virtual_time - - # The maximum number of test clocks to return. - attr_accessor :count - - # The number of test clocks to skip before returning results. - attr_accessor :offset - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'start_virtual_time' => :'start_virtual_time', - :'end_virtual_time' => :'end_virtual_time', - :'count' => :'count', - :'offset' => :'offset' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'start_virtual_time' => :'Time', - :'end_virtual_time' => :'Time', - :'count' => :'Integer', - :'offset' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'start_virtual_time', - :'end_virtual_time', - :'count', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferTestClockListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferTestClockListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'start_virtual_time') - self.start_virtual_time = attributes[:'start_virtual_time'] - end - - if attributes.key?(:'end_virtual_time') - self.end_virtual_time = attributes[:'end_virtual_time'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 25 - end - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - else - self.offset = 0 - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@count.nil? && @count > 25 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 25.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - if !@offset.nil? && @offset < 0 - invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@count.nil? && @count > 25 - return false if !@count.nil? && @count < 1 - return false if !@offset.nil? && @offset < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 25 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 25.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Custom attribute writer method with validation - # @param [Object] offset Value to be assigned - def offset=(offset) - if !offset.nil? && offset < 0 - fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.' - end - - - @offset = offset - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - start_virtual_time == o.start_virtual_time && - end_virtual_time == o.end_virtual_time && - count == o.count && - offset == o.offset - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, start_virtual_time, end_virtual_time, count, offset].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sandbox_transfer_test_clock_list_response.rb b/lib/plaid/models/sandbox_transfer_test_clock_list_response.rb deleted file mode 100644 index 66b5b0aa5..000000000 --- a/lib/plaid/models/sandbox_transfer_test_clock_list_response.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/sandbox/transfer/test_clock/list` - class SandboxTransferTestClockListResponse - attr_accessor :test_clocks - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'test_clocks' => :'test_clocks', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'test_clocks' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SandboxTransferTestClockListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SandboxTransferTestClockListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'test_clocks') - if (value = attributes[:'test_clocks']).is_a?(Array) - self.test_clocks = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @test_clocks.nil? - invalid_properties.push('invalid value for "test_clocks", test_clocks cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @test_clocks.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - test_clocks == o.test_clocks && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [test_clocks, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/scopes.rb b/lib/plaid/models/scopes.rb deleted file mode 100644 index 7602c3dd7..000000000 --- a/lib/plaid/models/scopes.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The scopes object - class Scopes - attr_accessor :product_access - - attr_accessor :accounts - - # Allow access to newly opened accounts as they are opened. If unset, defaults to `true`. - attr_accessor :new_accounts - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'product_access' => :'product_access', - :'accounts' => :'accounts', - :'new_accounts' => :'new_accounts' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'product_access' => :'ProductAccess', - :'accounts' => :'Array', - :'new_accounts' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'new_accounts' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Scopes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Scopes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'product_access') - self.product_access = attributes[:'product_access'] - end - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - - if attributes.key?(:'new_accounts') - self.new_accounts = attributes[:'new_accounts'] - else - self.new_accounts = true - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - product_access == o.product_access && - accounts == o.accounts && - new_accounts == o.new_accounts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [product_access, accounts, new_accounts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/scopes_context.rb b/lib/plaid/models/scopes_context.rb deleted file mode 100644 index d813494a6..000000000 --- a/lib/plaid/models/scopes_context.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class ScopesContext - ENROLLMENT = "ENROLLMENT".freeze - PORTAL = "PORTAL".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/scopes_nullable.rb b/lib/plaid/models/scopes_nullable.rb deleted file mode 100644 index a027d8430..000000000 --- a/lib/plaid/models/scopes_nullable.rb +++ /dev/null @@ -1,251 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The scopes object - class ScopesNullable - attr_accessor :product_access - - attr_accessor :accounts - - # Allow access to newly opened accounts as they are opened. If unset, defaults to `true`. - attr_accessor :new_accounts - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'product_access' => :'product_access', - :'accounts' => :'accounts', - :'new_accounts' => :'new_accounts' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'product_access' => :'ProductAccess', - :'accounts' => :'Array', - :'new_accounts' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'new_accounts' - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'Scopes' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ScopesNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ScopesNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'product_access') - self.product_access = attributes[:'product_access'] - end - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - - if attributes.key?(:'new_accounts') - self.new_accounts = attributes[:'new_accounts'] - else - self.new_accounts = true - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - product_access == o.product_access && - accounts == o.accounts && - new_accounts == o.new_accounts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [product_access, accounts, new_accounts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/screening_hit_analysis.rb b/lib/plaid/models/screening_hit_analysis.rb deleted file mode 100644 index 89ed73c18..000000000 --- a/lib/plaid/models/screening_hit_analysis.rb +++ /dev/null @@ -1,284 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Analysis information describing why a screening hit matched the provided user information - class ScreeningHitAnalysis - attr_accessor :dates_of_birth - - attr_accessor :documents - - attr_accessor :locations - - attr_accessor :names - - # 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. - attr_accessor :search_terms_version - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'dates_of_birth' => :'dates_of_birth', - :'documents' => :'documents', - :'locations' => :'locations', - :'names' => :'names', - :'search_terms_version' => :'search_terms_version' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'dates_of_birth' => :'MatchSummaryCode', - :'documents' => :'MatchSummaryCode', - :'locations' => :'MatchSummaryCode', - :'names' => :'MatchSummaryCode', - :'search_terms_version' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ScreeningHitAnalysis` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ScreeningHitAnalysis`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'dates_of_birth') - self.dates_of_birth = attributes[:'dates_of_birth'] - end - - if attributes.key?(:'documents') - self.documents = attributes[:'documents'] - end - - if attributes.key?(:'locations') - self.locations = attributes[:'locations'] - end - - if attributes.key?(:'names') - self.names = attributes[:'names'] - end - - if attributes.key?(:'search_terms_version') - self.search_terms_version = attributes[:'search_terms_version'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @search_terms_version.nil? - invalid_properties.push('invalid value for "search_terms_version", search_terms_version cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @search_terms_version.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - dates_of_birth == o.dates_of_birth && - documents == o.documents && - locations == o.locations && - names == o.names && - search_terms_version == o.search_terms_version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [dates_of_birth, documents, locations, names, search_terms_version].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/screening_hit_data.rb b/lib/plaid/models/screening_hit_data.rb deleted file mode 100644 index 4409dfe5d..000000000 --- a/lib/plaid/models/screening_hit_data.rb +++ /dev/null @@ -1,259 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information associated with the watchlist hit - class ScreeningHitData - # Dates of birth associated with the watchlist hit - attr_accessor :dates_of_birth - - # Documents associated with the watchlist hit - attr_accessor :documents - - # Locations associated with the watchlist hit - attr_accessor :locations - - # Names associated with the watchlist hit - attr_accessor :names - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'dates_of_birth' => :'dates_of_birth', - :'documents' => :'documents', - :'locations' => :'locations', - :'names' => :'names' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'dates_of_birth' => :'Array', - :'documents' => :'Array', - :'locations' => :'Array', - :'names' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ScreeningHitData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ScreeningHitData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'dates_of_birth') - if (value = attributes[:'dates_of_birth']).is_a?(Array) - self.dates_of_birth = value - end - end - - if attributes.key?(:'documents') - if (value = attributes[:'documents']).is_a?(Array) - self.documents = value - end - end - - if attributes.key?(:'locations') - if (value = attributes[:'locations']).is_a?(Array) - self.locations = value - end - end - - if attributes.key?(:'names') - if (value = attributes[:'names']).is_a?(Array) - self.names = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - dates_of_birth == o.dates_of_birth && - documents == o.documents && - locations == o.locations && - names == o.names - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [dates_of_birth, documents, locations, names].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/screening_hit_date_of_birth_item.rb b/lib/plaid/models/screening_hit_date_of_birth_item.rb deleted file mode 100644 index e6ac520e5..000000000 --- a/lib/plaid/models/screening_hit_date_of_birth_item.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Analyzed date of birth for the associated hit - class ScreeningHitDateOfBirthItem - attr_accessor :analysis - - attr_accessor :data - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'analysis' => :'analysis', - :'data' => :'data' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'analysis' => :'MatchSummary', - :'data' => :'DateRange' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ScreeningHitDateOfBirthItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ScreeningHitDateOfBirthItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - analysis == o.analysis && - data == o.data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [analysis, data].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/screening_hit_documents_items.rb b/lib/plaid/models/screening_hit_documents_items.rb deleted file mode 100644 index be5d0427c..000000000 --- a/lib/plaid/models/screening_hit_documents_items.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Analyzed document information for the associated hit - class ScreeningHitDocumentsItems - attr_accessor :analysis - - attr_accessor :data - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'analysis' => :'analysis', - :'data' => :'data' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'analysis' => :'MatchSummary', - :'data' => :'WatchlistScreeningDocument' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ScreeningHitDocumentsItems` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ScreeningHitDocumentsItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - analysis == o.analysis && - data == o.data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [analysis, data].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/screening_hit_names_items.rb b/lib/plaid/models/screening_hit_names_items.rb deleted file mode 100644 index 53866d10b..000000000 --- a/lib/plaid/models/screening_hit_names_items.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Analyzed name information for the associated hit - class ScreeningHitNamesItems - attr_accessor :analysis - - attr_accessor :data - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'analysis' => :'analysis', - :'data' => :'data' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'analysis' => :'MatchSummary', - :'data' => :'IndividualScreeningHitNames' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ScreeningHitNamesItems` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ScreeningHitNamesItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - analysis == o.analysis && - data == o.data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [analysis, data].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/screening_status_updated_webhook.rb b/lib/plaid/models/screening_status_updated_webhook.rb deleted file mode 100644 index e9ea276fa..000000000 --- a/lib/plaid/models/screening_status_updated_webhook.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when an individual screening status has changed, which can occur manually via the dashboard or during ongoing monitoring. - class ScreeningStatusUpdatedWebhook - # `SCREENING` - attr_accessor :webhook_type - - # `STATUS_UPDATED` - attr_accessor :webhook_code - - # The ID of the associated screening. - attr_accessor :screening_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'screening_id' => :'screening_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'screening_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ScreeningStatusUpdatedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ScreeningStatusUpdatedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'screening_id') - self.screening_id = attributes[:'screening_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @screening_id.nil? - invalid_properties.push('invalid value for "screening_id", screening_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @screening_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - screening_id == o.screening_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, screening_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/security.rb b/lib/plaid/models/security.rb deleted file mode 100644 index ed8e70fa5..000000000 --- a/lib/plaid/models/security.rb +++ /dev/null @@ -1,412 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Contains details about a security - class Security - # 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. - attr_accessor :security_id - - # 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). - attr_accessor :isin - - # 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). - attr_accessor :cusip - - # 7-character SEDOL, an identifier assigned to securities in the UK. - attr_accessor :sedol - - # An identifier given to the security by the institution - attr_accessor :institution_security_id - - # If `institution_security_id` is present, this field indicates the Plaid `institution_id` of the institution to whom the identifier belongs. - attr_accessor :institution_id - - # 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. - attr_accessor :proxy_security_id - - # A descriptive name for the security, suitable for display. - attr_accessor :name - - # The security’s trading symbol for publicly traded securities, and otherwise a short identifier if available. - attr_accessor :ticker_symbol - - # Indicates that a security is a highly liquid asset and can be treated like cash. - attr_accessor :is_cash_equivalent - - # 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 `cryptocurrency`: Digital or virtual currencies `derivative`: Options, warrants, and other derivative instruments `equity`: Domestic and foreign equities `etf`: Multi-asset exchange-traded investment funds `fixed income`: Bonds and certificates of deposit (CDs) `loan`: Loans and loan receivables `mutual fund`: Open- and closed-end vehicles pooling funds of multiple investors `other`: Unknown or other investment types - attr_accessor :type - - # Price of the security at the close of the previous trading session. Null for non-public securities. If the security is a foreign currency this field will be updated daily and will be priced in USD. If the security is a cryptocurrency, this field will be updated multiple times a day. As crypto prices can fluctuate quickly and data may become stale sooner than other asset classes, refer to `update_datetime` with the time when the price was last updated. - attr_accessor :close_price - - # Date for which `close_price` is accurate. Always `null` if `close_price` is `null`. - attr_accessor :close_price_as_of - - # Date and time at which `close_price` is accurate, in ISO 8601 format (YYYY-MM-DDTHH:mm:ssZ). Always `null` if `close_price` is `null`. - attr_accessor :update_datetime - - # The ISO-4217 currency code of the price given. Always `null` if `unofficial_currency_code` is non-`null`. - attr_accessor :iso_currency_code - - # The unofficial currency code associated with the security. 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. - attr_accessor :unofficial_currency_code - - # The ISO-10383 Market Identifier Code of the exchange or market in which the security is being traded. - attr_accessor :market_identifier_code - - attr_accessor :option_contract - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'security_id' => :'security_id', - :'isin' => :'isin', - :'cusip' => :'cusip', - :'sedol' => :'sedol', - :'institution_security_id' => :'institution_security_id', - :'institution_id' => :'institution_id', - :'proxy_security_id' => :'proxy_security_id', - :'name' => :'name', - :'ticker_symbol' => :'ticker_symbol', - :'is_cash_equivalent' => :'is_cash_equivalent', - :'type' => :'type', - :'close_price' => :'close_price', - :'close_price_as_of' => :'close_price_as_of', - :'update_datetime' => :'update_datetime', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'market_identifier_code' => :'market_identifier_code', - :'option_contract' => :'option_contract' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'security_id' => :'String', - :'isin' => :'String', - :'cusip' => :'String', - :'sedol' => :'String', - :'institution_security_id' => :'String', - :'institution_id' => :'String', - :'proxy_security_id' => :'String', - :'name' => :'String', - :'ticker_symbol' => :'String', - :'is_cash_equivalent' => :'Boolean', - :'type' => :'String', - :'close_price' => :'Float', - :'close_price_as_of' => :'Date', - :'update_datetime' => :'Time', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'market_identifier_code' => :'String', - :'option_contract' => :'OptionContract' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'isin', - :'cusip', - :'sedol', - :'institution_security_id', - :'institution_id', - :'proxy_security_id', - :'name', - :'ticker_symbol', - :'is_cash_equivalent', - :'type', - :'close_price', - :'close_price_as_of', - :'update_datetime', - :'iso_currency_code', - :'unofficial_currency_code', - :'market_identifier_code', - :'option_contract' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Security` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Security`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'security_id') - self.security_id = attributes[:'security_id'] - end - - if attributes.key?(:'isin') - self.isin = attributes[:'isin'] - end - - if attributes.key?(:'cusip') - self.cusip = attributes[:'cusip'] - end - - if attributes.key?(:'sedol') - self.sedol = attributes[:'sedol'] - end - - if attributes.key?(:'institution_security_id') - self.institution_security_id = attributes[:'institution_security_id'] - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'proxy_security_id') - self.proxy_security_id = attributes[:'proxy_security_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'ticker_symbol') - self.ticker_symbol = attributes[:'ticker_symbol'] - end - - if attributes.key?(:'is_cash_equivalent') - self.is_cash_equivalent = attributes[:'is_cash_equivalent'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'close_price') - self.close_price = attributes[:'close_price'] - end - - if attributes.key?(:'close_price_as_of') - self.close_price_as_of = attributes[:'close_price_as_of'] - end - - if attributes.key?(:'update_datetime') - self.update_datetime = attributes[:'update_datetime'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'market_identifier_code') - self.market_identifier_code = attributes[:'market_identifier_code'] - end - - if attributes.key?(:'option_contract') - self.option_contract = attributes[:'option_contract'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @security_id.nil? - invalid_properties.push('invalid value for "security_id", security_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @security_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - security_id == o.security_id && - isin == o.isin && - cusip == o.cusip && - sedol == o.sedol && - institution_security_id == o.institution_security_id && - institution_id == o.institution_id && - proxy_security_id == o.proxy_security_id && - name == o.name && - ticker_symbol == o.ticker_symbol && - is_cash_equivalent == o.is_cash_equivalent && - type == o.type && - close_price == o.close_price && - close_price_as_of == o.close_price_as_of && - update_datetime == o.update_datetime && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - market_identifier_code == o.market_identifier_code && - option_contract == o.option_contract - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [security_id, isin, cusip, sedol, institution_security_id, institution_id, proxy_security_id, name, ticker_symbol, is_cash_equivalent, type, close_price, close_price_as_of, update_datetime, iso_currency_code, unofficial_currency_code, market_identifier_code, option_contract].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/security_override.rb b/lib/plaid/models/security_override.rb deleted file mode 100644 index 86a69d21b..000000000 --- a/lib/plaid/models/security_override.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Specify the security associated with the holding or investment transaction. When inputting custom security data to the Sandbox, Plaid will perform post-data-retrieval normalization and enrichment. These processes may cause the data returned by the Sandbox to be slightly different from the data you input. An ISO-4217 currency code and a security identifier (`ticker_symbol`, `cusip`, `isin`, or `sedol`) are required. - class SecurityOverride - # 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). - attr_accessor :isin - - # 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). - attr_accessor :cusip - - # 7-character SEDOL, an identifier assigned to securities in the UK. - attr_accessor :sedol - - # A descriptive name for the security, suitable for display. - attr_accessor :name - - # The security’s trading symbol for publicly traded securities, and otherwise a short identifier if available. - attr_accessor :ticker_symbol - - # Either a valid `iso_currency_code` or `unofficial_currency_code` - attr_accessor :currency - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'isin' => :'isin', - :'cusip' => :'cusip', - :'sedol' => :'sedol', - :'name' => :'name', - :'ticker_symbol' => :'ticker_symbol', - :'currency' => :'currency' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'isin' => :'String', - :'cusip' => :'String', - :'sedol' => :'String', - :'name' => :'String', - :'ticker_symbol' => :'String', - :'currency' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SecurityOverride` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SecurityOverride`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'isin') - self.isin = attributes[:'isin'] - end - - if attributes.key?(:'cusip') - self.cusip = attributes[:'cusip'] - end - - if attributes.key?(:'sedol') - self.sedol = attributes[:'sedol'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'ticker_symbol') - self.ticker_symbol = attributes[:'ticker_symbol'] - end - - if attributes.key?(:'currency') - self.currency = attributes[:'currency'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - isin == o.isin && - cusip == o.cusip && - sedol == o.sedol && - name == o.name && - ticker_symbol == o.ticker_symbol && - currency == o.currency - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [isin, cusip, sedol, name, ticker_symbol, currency].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/selfie_analysis.rb b/lib/plaid/models/selfie_analysis.rb deleted file mode 100644 index 624116338..000000000 --- a/lib/plaid/models/selfie_analysis.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class SelfieAnalysis - attr_accessor :document_comparison - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'document_comparison' => :'document_comparison' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'document_comparison' => :'SelfieAnalysisDocumentComparison' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SelfieAnalysis` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SelfieAnalysis`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'document_comparison') - self.document_comparison = attributes[:'document_comparison'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @document_comparison.nil? - invalid_properties.push('invalid value for "document_comparison", document_comparison cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @document_comparison.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - document_comparison == o.document_comparison - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [document_comparison].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/selfie_analysis_document_comparison.rb b/lib/plaid/models/selfie_analysis_document_comparison.rb deleted file mode 100644 index fc4068de9..000000000 --- a/lib/plaid/models/selfie_analysis_document_comparison.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class SelfieAnalysisDocumentComparison - MATCH = "match".freeze - NO_MATCH = "no_match".freeze - NO_INPUT = "no_input".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/selfie_capture.rb b/lib/plaid/models/selfie_capture.rb deleted file mode 100644 index b2b0eb785..000000000 --- a/lib/plaid/models/selfie_capture.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The image or video capture of a selfie. Only one of image or video URL will be populated per selfie. - class SelfieCapture - # Temporary URL for downloading an image selfie capture. - attr_accessor :image_url - - # Temporary URL for downloading a video selfie capture. - attr_accessor :video_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'image_url' => :'image_url', - :'video_url' => :'video_url' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'image_url' => :'String', - :'video_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'image_url', - :'video_url' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SelfieCapture` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SelfieCapture`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'image_url') - self.image_url = attributes[:'image_url'] - end - - if attributes.key?(:'video_url') - self.video_url = attributes[:'video_url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - image_url == o.image_url && - video_url == o.video_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [image_url, video_url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/selfie_check.rb b/lib/plaid/models/selfie_check.rb deleted file mode 100644 index 7cea7577c..000000000 --- a/lib/plaid/models/selfie_check.rb +++ /dev/null @@ -1,264 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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`. - class SelfieCheck - attr_accessor :status - - # An array of selfies submitted to the `selfie_check` step. Each entry represents one user submission. - attr_accessor :selfies - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'selfies' => :'selfies' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'SelfieCheckStatus', - :'selfies' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SelfieCheck` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SelfieCheck`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'selfies') - if (value = attributes[:'selfies']).is_a?(Array) - self.selfies = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @selfies.nil? - invalid_properties.push('invalid value for "selfies", selfies cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @status.nil? - return false if @selfies.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - selfies == o.selfies - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, selfies].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/selfie_check_selfie.rb b/lib/plaid/models/selfie_check_selfie.rb deleted file mode 100644 index 029b32ac3..000000000 --- a/lib/plaid/models/selfie_check_selfie.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Captures and analysis from a user's selfie. - class SelfieCheckSelfie - attr_accessor :status - - # The `attempt` field begins with 1 and increments with each subsequent selfie upload. - attr_accessor :attempt - - attr_accessor :capture - - attr_accessor :analysis - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'status', - :'attempt' => :'attempt', - :'capture' => :'capture', - :'analysis' => :'analysis' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'SelfieStatus', - :'attempt' => :'Integer', - :'capture' => :'SelfieCapture', - :'analysis' => :'SelfieAnalysis' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SelfieCheckSelfie` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SelfieCheckSelfie`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'attempt') - self.attempt = attributes[:'attempt'] - end - - if attributes.key?(:'capture') - self.capture = attributes[:'capture'] - end - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @attempt.nil? - invalid_properties.push('invalid value for "attempt", attempt cannot be nil.') - end - - if @capture.nil? - invalid_properties.push('invalid value for "capture", capture cannot be nil.') - end - - if @analysis.nil? - invalid_properties.push('invalid value for "analysis", analysis cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @status.nil? - return false if @attempt.nil? - return false if @capture.nil? - return false if @analysis.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status && - attempt == o.attempt && - capture == o.capture && - analysis == o.analysis - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status, attempt, capture, analysis].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/selfie_check_status.rb b/lib/plaid/models/selfie_check_status.rb deleted file mode 100644 index 0b0ebb4fe..000000000 --- a/lib/plaid/models/selfie_check_status.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class SelfieCheckStatus - SUCCESS = "success".freeze - FAILED = "failed".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/selfie_status.rb b/lib/plaid/models/selfie_status.rb deleted file mode 100644 index 05c785c29..000000000 --- a/lib/plaid/models/selfie_status.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class SelfieStatus - SUCCESS = "success".freeze - FAILED = "failed".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/sender_bacs_nullable.rb b/lib/plaid/models/sender_bacs_nullable.rb deleted file mode 100644 index 43ba39d7f..000000000 --- a/lib/plaid/models/sender_bacs_nullable.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object containing a BACS account number and sort code. If an IBAN is not provided or if this recipient needs to accept domestic GBP-denominated payments, BACS data is required. - class SenderBACSNullable - # The account number of the account. Maximum of 10 characters. - attr_accessor :account - - # The 6-character sort code of the account. - attr_accessor :sort_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account' => :'account', - :'sort_code' => :'sort_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account' => :'String', - :'sort_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'RecipientBACS' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SenderBACSNullable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SenderBACSNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'sort_code') - self.sort_code = attributes[:'sort_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@account.nil? && @account.to_s.length > 10 - invalid_properties.push('invalid value for "account", the character length must be smaller than or equal to 10.') - end - - if !@account.nil? && @account.to_s.length < 1 - invalid_properties.push('invalid value for "account", the character length must be great than or equal to 1.') - end - - - if !@sort_code.nil? && @sort_code.to_s.length > 6 - invalid_properties.push('invalid value for "sort_code", the character length must be smaller than or equal to 6.') - end - - if !@sort_code.nil? && @sort_code.to_s.length < 6 - invalid_properties.push('invalid value for "sort_code", the character length must be great than or equal to 6.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@account.nil? && @account.to_s.length > 10 - return false if !@account.nil? && @account.to_s.length < 1 - return false if !@sort_code.nil? && @sort_code.to_s.length > 6 - return false if !@sort_code.nil? && @sort_code.to_s.length < 6 - true - end - - # Custom attribute writer method with validation - # @param [Object] account Value to be assigned - def account=(account) - if !account.nil? && account.to_s.length > 10 - fail ArgumentError, 'invalid value for "account", the character length must be smaller than or equal to 10.' - end - - if !account.nil? && account.to_s.length < 1 - fail ArgumentError, 'invalid value for "account", the character length must be great than or equal to 1.' - end - - - @account = account - end - - # Custom attribute writer method with validation - # @param [Object] sort_code Value to be assigned - def sort_code=(sort_code) - if !sort_code.nil? && sort_code.to_s.length > 6 - fail ArgumentError, 'invalid value for "sort_code", the character length must be smaller than or equal to 6.' - end - - if !sort_code.nil? && sort_code.to_s.length < 6 - fail ArgumentError, 'invalid value for "sort_code", the character length must be great than or equal to 6.' - end - - - @sort_code = sort_code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account == o.account && - sort_code == o.sort_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account, sort_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/service.rb b/lib/plaid/models/service.rb deleted file mode 100644 index c578d8286..000000000 --- a/lib/plaid/models/service.rb +++ /dev/null @@ -1,239 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A collection of details related to a fulfillment service or product in terms of request, process and result. - class Service - attr_accessor :verification_of_asset - - attr_accessor :statuses - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'verification_of_asset' => :'VERIFICATION_OF_ASSET', - :'statuses' => :'STATUSES' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'verification_of_asset' => :'VerificationOfAsset', - :'statuses' => :'Statuses' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Service` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Service`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'verification_of_asset') - self.verification_of_asset = attributes[:'verification_of_asset'] - end - - if attributes.key?(:'statuses') - self.statuses = attributes[:'statuses'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @verification_of_asset.nil? - invalid_properties.push('invalid value for "verification_of_asset", verification_of_asset cannot be nil.') - end - - if @statuses.nil? - invalid_properties.push('invalid value for "statuses", statuses cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @verification_of_asset.nil? - return false if @statuses.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - verification_of_asset == o.verification_of_asset && - statuses == o.statuses - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [verification_of_asset, statuses].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/service_product_fulfillment.rb b/lib/plaid/models/service_product_fulfillment.rb deleted file mode 100644 index e60578793..000000000 --- a/lib/plaid/models/service_product_fulfillment.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A collection of details related to a fulfillment service or product in terms of request, process and result. - class ServiceProductFulfillment - attr_accessor :service_product_fulfillment_detail - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'service_product_fulfillment_detail' => :'SERVICE_PRODUCT_FULFILLMENT_DETAIL' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'service_product_fulfillment_detail' => :'ServiceProductFulfillmentDetail' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ServiceProductFulfillment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ServiceProductFulfillment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'service_product_fulfillment_detail') - self.service_product_fulfillment_detail = attributes[:'service_product_fulfillment_detail'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @service_product_fulfillment_detail.nil? - invalid_properties.push('invalid value for "service_product_fulfillment_detail", service_product_fulfillment_detail cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @service_product_fulfillment_detail.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - service_product_fulfillment_detail == o.service_product_fulfillment_detail - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [service_product_fulfillment_detail].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/service_product_fulfillment_detail.rb b/lib/plaid/models/service_product_fulfillment_detail.rb deleted file mode 100644 index 0e136ddcf..000000000 --- a/lib/plaid/models/service_product_fulfillment_detail.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class ServiceProductFulfillmentDetail - # A string that uniquely identifies a type of order Verification of Asset. - attr_accessor :vendor_order_identifier - - attr_accessor :service_product_fulfillment_identifier - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'vendor_order_identifier' => :'VendorOrderIdentifier', - :'service_product_fulfillment_identifier' => :'ServiceProductFulfillmentIdentifier' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'vendor_order_identifier' => :'String', - :'service_product_fulfillment_identifier' => :'ServiceProductFulfillmentIdentifier' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'vendor_order_identifier', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ServiceProductFulfillmentDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ServiceProductFulfillmentDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'vendor_order_identifier') - self.vendor_order_identifier = attributes[:'vendor_order_identifier'] - end - - if attributes.key?(:'service_product_fulfillment_identifier') - self.service_product_fulfillment_identifier = attributes[:'service_product_fulfillment_identifier'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @service_product_fulfillment_identifier.nil? - invalid_properties.push('invalid value for "service_product_fulfillment_identifier", service_product_fulfillment_identifier cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @service_product_fulfillment_identifier.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - vendor_order_identifier == o.vendor_order_identifier && - service_product_fulfillment_identifier == o.service_product_fulfillment_identifier - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [vendor_order_identifier, service_product_fulfillment_identifier].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/service_product_fulfillment_identifier.rb b/lib/plaid/models/service_product_fulfillment_identifier.rb deleted file mode 100644 index ecac256ac..000000000 --- a/lib/plaid/models/service_product_fulfillment_identifier.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class ServiceProductFulfillmentIdentifier - VOA = "VOA".freeze - VOE = "VOE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/servicer_address_data.rb b/lib/plaid/models/servicer_address_data.rb deleted file mode 100644 index 16a249653..000000000 --- a/lib/plaid/models/servicer_address_data.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The address of the student loan servicer. This is generally the remittance address to which payments should be sent. - class ServicerAddressData - # The full city name - attr_accessor :city - - # The region or state Example: `\"NC\"` - attr_accessor :region - - # The full street address Example: `\"564 Main Street, APT 15\"` - attr_accessor :street - - # The postal code - attr_accessor :postal_code - - # The ISO 3166-1 alpha-2 country code - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'region' => :'region', - :'street' => :'street', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'region' => :'String', - :'street' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'city', - :'region', - :'street', - :'postal_code', - :'country' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ServicerAddressData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ServicerAddressData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - region == o.region && - street == o.street && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, region, street, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/services.rb b/lib/plaid/models/services.rb deleted file mode 100644 index 25e0f9a82..000000000 --- a/lib/plaid/models/services.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A collection of objects that describe requests and responses for services. - class Services - attr_accessor :service - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'service' => :'SERVICE' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'service' => :'Service' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Services` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Services`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'service') - self.service = attributes[:'service'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @service.nil? - invalid_properties.push('invalid value for "service", service cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @service.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - service == o.service - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [service].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/signal_address_data.rb b/lib/plaid/models/signal_address_data.rb deleted file mode 100644 index 2c8bffa65..000000000 --- a/lib/plaid/models/signal_address_data.rb +++ /dev/null @@ -1,264 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data about the components comprising an address. - class SignalAddressData - # The full city name - attr_accessor :city - - # The region or state Example: `\"NC\"` - attr_accessor :region - - # The full street address Example: `\"564 Main Street, APT 15\"` - attr_accessor :street - - # The postal code - attr_accessor :postal_code - - # The ISO 3166-1 alpha-2 country code - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'region' => :'region', - :'street' => :'street', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'region' => :'String', - :'street' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'region', - :'postal_code', - :'country' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SignalAddressData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SignalAddressData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - region == o.region && - street == o.street && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, region, street, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/signal_decision_outcome.rb b/lib/plaid/models/signal_decision_outcome.rb deleted file mode 100644 index 75c6f963c..000000000 --- a/lib/plaid/models/signal_decision_outcome.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class SignalDecisionOutcome - APPROVE = "APPROVE".freeze - REVIEW = "REVIEW".freeze - REJECT = "REJECT".freeze - TAKE_OTHER_RISK_MEASURES = "TAKE_OTHER_RISK_MEASURES".freeze - NOT_EVALUATED = "NOT_EVALUATED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/signal_decision_report_request.rb b/lib/plaid/models/signal_decision_report_request.rb deleted file mode 100644 index 815acc24f..000000000 --- a/lib/plaid/models/signal_decision_report_request.rb +++ /dev/null @@ -1,372 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SignalDecisionReportRequest defines the request schema for `/signal/decision/report` - class SignalDecisionReportRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Must be the same as the `client_transaction_id` supplied when calling `/signal/evaluate` - attr_accessor :client_transaction_id - - # `true` if the ACH transaction was initiated, `false` otherwise. This field must be returned as a boolean. If formatted incorrectly, this will result in an [`INVALID_FIELD`](/docs/errors/invalid-request/#invalid_field) error. - attr_accessor :initiated - - # The actual number of days (hold time) since the ACH debit transaction that you wait before making funds available to your customers. The holding time could affect the ACH return rate. For example, use 0 if you make funds available to your customers instantly or the same day following the debit transaction, or 1 if you make funds available the next day following the debit initialization. - attr_accessor :days_funds_on_hold - - attr_accessor :decision_outcome - - attr_accessor :payment_method - - # The amount (in USD) made available to your customers instantly following the debit transaction. It could be a partial amount of the requested transaction (example: 102.05). - attr_accessor :amount_instantly_available - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'client_transaction_id' => :'client_transaction_id', - :'initiated' => :'initiated', - :'days_funds_on_hold' => :'days_funds_on_hold', - :'decision_outcome' => :'decision_outcome', - :'payment_method' => :'payment_method', - :'amount_instantly_available' => :'amount_instantly_available' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'client_transaction_id' => :'String', - :'initiated' => :'Boolean', - :'days_funds_on_hold' => :'Integer', - :'decision_outcome' => :'SignalDecisionOutcome', - :'payment_method' => :'SignalPaymentMethod', - :'amount_instantly_available' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'days_funds_on_hold', - :'decision_outcome', - :'payment_method', - :'amount_instantly_available' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SignalDecisionReportRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SignalDecisionReportRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_transaction_id') - self.client_transaction_id = attributes[:'client_transaction_id'] - end - - if attributes.key?(:'initiated') - self.initiated = attributes[:'initiated'] - end - - if attributes.key?(:'days_funds_on_hold') - self.days_funds_on_hold = attributes[:'days_funds_on_hold'] - end - - if attributes.key?(:'decision_outcome') - self.decision_outcome = attributes[:'decision_outcome'] - end - - if attributes.key?(:'payment_method') - self.payment_method = attributes[:'payment_method'] - end - - if attributes.key?(:'amount_instantly_available') - self.amount_instantly_available = attributes[:'amount_instantly_available'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @client_transaction_id.nil? - invalid_properties.push('invalid value for "client_transaction_id", client_transaction_id cannot be nil.') - end - - if @client_transaction_id.to_s.length > 36 - invalid_properties.push('invalid value for "client_transaction_id", the character length must be smaller than or equal to 36.') - end - - if @client_transaction_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_transaction_id", the character length must be great than or equal to 1.') - end - - - if @initiated.nil? - invalid_properties.push('invalid value for "initiated", initiated cannot be nil.') - end - - if !@days_funds_on_hold.nil? && @days_funds_on_hold < 0 - invalid_properties.push('invalid value for "days_funds_on_hold", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @client_transaction_id.nil? - return false if @client_transaction_id.to_s.length > 36 - return false if @client_transaction_id.to_s.length < 1 - return false if @initiated.nil? - return false if !@days_funds_on_hold.nil? && @days_funds_on_hold < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] client_transaction_id Value to be assigned - def client_transaction_id=(client_transaction_id) - if client_transaction_id.nil? - fail ArgumentError, 'client_transaction_id cannot be nil' - end - - if client_transaction_id.to_s.length > 36 - fail ArgumentError, 'invalid value for "client_transaction_id", the character length must be smaller than or equal to 36.' - end - - if client_transaction_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_transaction_id", the character length must be great than or equal to 1.' - end - - - @client_transaction_id = client_transaction_id - end - - # Custom attribute writer method with validation - # @param [Object] days_funds_on_hold Value to be assigned - def days_funds_on_hold=(days_funds_on_hold) - if !days_funds_on_hold.nil? && days_funds_on_hold < 0 - fail ArgumentError, 'invalid value for "days_funds_on_hold", must be greater than or equal to 0.' - end - - - @days_funds_on_hold = days_funds_on_hold - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - client_transaction_id == o.client_transaction_id && - initiated == o.initiated && - days_funds_on_hold == o.days_funds_on_hold && - decision_outcome == o.decision_outcome && - payment_method == o.payment_method && - amount_instantly_available == o.amount_instantly_available - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, client_transaction_id, initiated, days_funds_on_hold, decision_outcome, payment_method, amount_instantly_available].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/signal_decision_report_response.rb b/lib/plaid/models/signal_decision_report_response.rb deleted file mode 100644 index a80bb7605..000000000 --- a/lib/plaid/models/signal_decision_report_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SignalDecisionReportResponse defines the response schema for `/signal/decision/report` - class SignalDecisionReportResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SignalDecisionReportResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SignalDecisionReportResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/signal_device.rb b/lib/plaid/models/signal_device.rb deleted file mode 100644 index fd2c84c89..000000000 --- a/lib/plaid/models/signal_device.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class SignalDevice - # The IP address of the device that initiated the transaction - attr_accessor :ip_address - - # The user agent of the device that initiated the transaction (e.g. \"Mozilla/5.0\") - attr_accessor :user_agent - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ip_address' => :'ip_address', - :'user_agent' => :'user_agent' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ip_address' => :'String', - :'user_agent' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'ip_address', - :'user_agent' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SignalDevice` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SignalDevice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ip_address') - self.ip_address = attributes[:'ip_address'] - end - - if attributes.key?(:'user_agent') - self.user_agent = attributes[:'user_agent'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ip_address == o.ip_address && - user_agent == o.user_agent - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ip_address, user_agent].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/signal_evaluate_core_attributes.rb b/lib/plaid/models/signal_evaluate_core_attributes.rb deleted file mode 100644 index cc243f847..000000000 --- a/lib/plaid/models/signal_evaluate_core_attributes.rb +++ /dev/null @@ -1,1080 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The core attributes object contains additional data that can be used to assess the ACH return 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 `is_savings_or_money_market_account`: Indicates whether the ACH transaction funding account is a savings/money market account 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 - class SignalEvaluateCoreAttributes - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to unauthorized transactions over the past 7 days from the account that will be debited. - attr_accessor :unauthorized_transactions_count_7d - - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to unauthorized transactions over the past 30 days from the account that will be debited. - attr_accessor :unauthorized_transactions_count_30d - - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to unauthorized transactions over the past 60 days from the account that will be debited. - attr_accessor :unauthorized_transactions_count_60d - - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to unauthorized transactions over the past 90 days from the account that will be debited. - attr_accessor :unauthorized_transactions_count_90d - - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to non-sufficient funds/overdrafts over the past 7 days from the account that will be debited. - attr_accessor :nsf_overdraft_transactions_count_7d - - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to non-sufficient funds/overdrafts over the past 30 days from the account that will be debited. - attr_accessor :nsf_overdraft_transactions_count_30d - - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to non-sufficient funds/overdrafts over the past 60 days from the account that will be debited. - attr_accessor :nsf_overdraft_transactions_count_60d - - # We parse and analyze historical transaction metadata to identify the number of possible past returns due to non-sufficient funds/overdrafts over the past 90 days from the account that will be debited. - attr_accessor :nsf_overdraft_transactions_count_90d - - # The number of days since the first time the Item was connected to an application via Plaid - attr_accessor :days_since_first_plaid_connection - - # The number of times the Item has been connected to applications via Plaid over the past 7 days - attr_accessor :plaid_connections_count_7d - - # The number of times the Item has been connected to applications via Plaid over the past 30 days - attr_accessor :plaid_connections_count_30d - - # The total number of times the Item has been connected to applications via Plaid - attr_accessor :total_plaid_connections_count - - # Indicates if the ACH transaction funding account is a savings/money market account - attr_accessor :is_savings_or_money_market_account - - # The total credit (inflow) transaction amount over the past 10 days from the account that will be debited - attr_accessor :total_credit_transactions_amount_10d - - # The total debit (outflow) transaction amount over the past 10 days from the account that will be debited - attr_accessor :total_debit_transactions_amount_10d - - # The 50th percentile of all credit (inflow) transaction amounts over the past 28 days from the account that will be debited - attr_accessor :p50_credit_transactions_amount_28d - - # The 50th percentile of all debit (outflow) transaction amounts over the past 28 days from the account that will be debited - attr_accessor :p50_debit_transactions_amount_28d - - # The 95th percentile of all credit (inflow) transaction amounts over the past 28 days from the account that will be debited - attr_accessor :p95_credit_transactions_amount_28d - - # The 95th percentile of all debit (outflow) transaction amounts over the past 28 days from the account that will be debited - attr_accessor :p95_debit_transactions_amount_28d - - # The number of days within the past 90 days when the account that will be debited had a negative end-of-day available balance - attr_accessor :days_with_negative_balance_count_90d - - # The 90th percentile of the end-of-day available balance over the past 30 days of the account that will be debited - attr_accessor :p90_eod_balance_30d - - # The 90th percentile of the end-of-day available balance over the past 60 days of the account that will be debited - attr_accessor :p90_eod_balance_60d - - # The 90th percentile of the end-of-day available balance over the past 90 days of the account that will be debited - attr_accessor :p90_eod_balance_90d - - # The 10th percentile of the end-of-day available balance over the past 30 days of the account that will be debited - attr_accessor :p10_eod_balance_30d - - # The 10th percentile of the end-of-day available balance over the past 60 days of the account that will be debited - attr_accessor :p10_eod_balance_60d - - # The 10th percentile of the end-of-day available balance over the past 90 days of the account that will be debited - attr_accessor :p10_eod_balance_90d - - # Available balance, as of the `balance_last_updated` time. The available balance is the current balance less any outstanding holds or debits that have not yet posted to the account. - attr_accessor :available_balance - - # Current balance, as of the `balance_last_updated` time. The current balance is the total amount of funds in the account. - attr_accessor :current_balance - - # Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DDTHH:mm:ssZ) indicating the last time that the balance for the given account has been updated. - attr_accessor :balance_last_updated - - # The number of times the account's phone numbers on file have changed over the past 28 days - attr_accessor :phone_change_count_28d - - # The number of times the account's phone numbers on file have changed over the past 90 days - attr_accessor :phone_change_count_90d - - # The number of times the account's email addresses on file have changed over the past 28 days - attr_accessor :email_change_count_28d - - # The number of times the account's email addresses on file have changed over the past 90 days - attr_accessor :email_change_count_90d - - # The number of times the account's addresses on file have changed over the past 28 days - attr_accessor :address_change_count_28d - - # The number of times the account's addresses on file have changed over the past 90 days - attr_accessor :address_change_count_90d - - # The number of non-OAuth authentication attempts via Plaid for this bank account over the past 3 days - attr_accessor :plaid_non_oauth_authentication_attempts_count_3d - - # The number of non-OAuth authentication attempts via Plaid for this bank account over the past 7 days - attr_accessor :plaid_non_oauth_authentication_attempts_count_7d - - # The number of non-OAuth authentication attempts via Plaid for this bank account over the past 30 days - attr_accessor :plaid_non_oauth_authentication_attempts_count_30d - - # The number of failed non-OAuth authentication attempts via Plaid for this bank account over the past 3 days - attr_accessor :failed_plaid_non_oauth_authentication_attempts_count_3d - - # The number of failed non-OAuth authentication attempts via Plaid for this bank account over the past 7 days - attr_accessor :failed_plaid_non_oauth_authentication_attempts_count_7d - - # The number of failed non-OAuth authentication attempts via Plaid for this bank account over the past 30 days - attr_accessor :failed_plaid_non_oauth_authentication_attempts_count_30d - - # The total number of debit (outflow) transactions over the past 10 days from the account that will be debited - attr_accessor :debit_transactions_count_10d - - # The total number of credit (inflow) transactions over the past 10 days from the account that will be debited - attr_accessor :credit_transactions_count_10d - - # The total number of debit (outflow) transactions over the past 30 days from the account that will be debited - attr_accessor :debit_transactions_count_30d - - # The total number of credit (inflow) transactions over the past 30 days from the account that will be debited - attr_accessor :credit_transactions_count_30d - - # The total number of debit (outflow) transactions over the past 60 days from the account that will be debited - attr_accessor :debit_transactions_count_60d - - # The total number of credit (inflow) transactions over the past 60 days from the account that will be debited - attr_accessor :credit_transactions_count_60d - - # The total number of debit (outflow) transactions over the past 90 days from the account that will be debited - attr_accessor :debit_transactions_count_90d - - # The total number of credit (inflow) transactions over the past 90 days from the account that will be debited - attr_accessor :credit_transactions_count_90d - - # The total debit (outflow) transaction amount over the past 30 days from the account that will be debited - attr_accessor :total_debit_transactions_amount_30d - - # The total credit (inflow) transaction amount over the past 30 days from the account that will be debited - attr_accessor :total_credit_transactions_amount_30d - - # The total debit (outflow) transaction amount over the past 60 days from the account that will be debited - attr_accessor :total_debit_transactions_amount_60d - - # The total credit (inflow) transaction amount over the past 60 days from the account that will be debited - attr_accessor :total_credit_transactions_amount_60d - - # The total debit (outflow) transaction amount over the past 90 days from the account that will be debited - attr_accessor :total_debit_transactions_amount_90d - - # The total credit (inflow) transaction amount over the past 90 days from the account that will be debited - attr_accessor :total_credit_transactions_amount_90d - - # The 50th percentile of the end-of-day available balance over the past 30 days of the account that will be debited - attr_accessor :p50_eod_balance_30d - - # The 50th percentile of the end-of-day available balance over the past 60 days of the account that will be debited - attr_accessor :p50_eod_balance_60d - - # The 50th percentile of the end-of-day available balance over the past 90 days of the account that will be debited - attr_accessor :p50_eod_balance_90d - - # The 50th percentile of the end-of-day available balance between day 31 and day 60 over the past 60 days of the account that will be debited - attr_accessor :p50_eod_balance_31d_to_60d - - # The 50th percentile of the end-of-day available balance between day 61 and day 90 over the past 60 days of the account that will be debited - attr_accessor :p50_eod_balance_61d_to_90d - - # The 90th percentile of the end-of-day available balance between day 31 and day 60 over the past 60 days of the account that will be debited - attr_accessor :p90_eod_balance_31d_to_60d - - # The 90th percentile of the end-of-day available balance between day 61 and day 90 over the past 60 days of the account that will be debited - attr_accessor :p90_eod_balance_61d_to_90d - - # The 10th percentile of the end-of-day available balance between day 31 and day 60 over the past 60 days of the account that will be debited - attr_accessor :p10_eod_balance_31d_to_60d - - # The 10th percentile of the end-of-day available balance between day 61 and day 90 over the past 60 days of the account that will be debited - attr_accessor :p10_eod_balance_61d_to_90d - - # Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DDTHH:mm:ssZ) indicating the last time that the transactions for the given account have been updated. - attr_accessor :transactions_last_updated - - # Indicates if the receiver bank account is closed - attr_accessor :is_account_closed - - # Indicates if the receiver bank account is either frozen or restricted - attr_accessor :is_account_frozen_or_restricted - - # The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 3 days - attr_accessor :distinct_ip_addresses_count_3d - - # The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 7 days - attr_accessor :distinct_ip_addresses_count_7d - - # The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 30 days (max 100) - attr_accessor :distinct_ip_addresses_count_30d - - # The number of distinct IP addresses linked to the same bank account during Plaid authentication in the last 90 days (max 100) - attr_accessor :distinct_ip_addresses_count_90d - - # The number of distinct user agents linked to the same bank account during Plaid authentication in the last 3 days - attr_accessor :distinct_user_agents_count_3d - - # The number of distinct user agents linked to the same bank account during Plaid authentication in the last 7 days - attr_accessor :distinct_user_agents_count_7d - - # The number of distinct user agents linked to the same bank account during Plaid authentication in the last 30 days - attr_accessor :distinct_user_agents_count_30d - - # The number of distinct user agents linked to the same bank account during Plaid authentication in the last 90 days - attr_accessor :distinct_user_agents_count_90d - - # The number of distinct SSL/TLS connection sessions linked to the same bank account during Plaid authentication in the last 3 days - attr_accessor :distinct_ssl_tls_connection_sessions_count_3d - - # The number of distinct SSL/TLS connection sessions linked to the same bank account during Plaid authentication in the last 7 days - attr_accessor :distinct_ssl_tls_connection_sessions_count_7d - - # The number of distinct SSL/TLS connection sessions linked to the same bank account during Plaid authentication in the last 30 days - attr_accessor :distinct_ssl_tls_connection_sessions_count_30d - - # The number of distinct SSL/TLS connection sessions linked to the same bank account during Plaid authentication in the last 90 days - attr_accessor :distinct_ssl_tls_connection_sessions_count_90d - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'unauthorized_transactions_count_7d' => :'unauthorized_transactions_count_7d', - :'unauthorized_transactions_count_30d' => :'unauthorized_transactions_count_30d', - :'unauthorized_transactions_count_60d' => :'unauthorized_transactions_count_60d', - :'unauthorized_transactions_count_90d' => :'unauthorized_transactions_count_90d', - :'nsf_overdraft_transactions_count_7d' => :'nsf_overdraft_transactions_count_7d', - :'nsf_overdraft_transactions_count_30d' => :'nsf_overdraft_transactions_count_30d', - :'nsf_overdraft_transactions_count_60d' => :'nsf_overdraft_transactions_count_60d', - :'nsf_overdraft_transactions_count_90d' => :'nsf_overdraft_transactions_count_90d', - :'days_since_first_plaid_connection' => :'days_since_first_plaid_connection', - :'plaid_connections_count_7d' => :'plaid_connections_count_7d', - :'plaid_connections_count_30d' => :'plaid_connections_count_30d', - :'total_plaid_connections_count' => :'total_plaid_connections_count', - :'is_savings_or_money_market_account' => :'is_savings_or_money_market_account', - :'total_credit_transactions_amount_10d' => :'total_credit_transactions_amount_10d', - :'total_debit_transactions_amount_10d' => :'total_debit_transactions_amount_10d', - :'p50_credit_transactions_amount_28d' => :'p50_credit_transactions_amount_28d', - :'p50_debit_transactions_amount_28d' => :'p50_debit_transactions_amount_28d', - :'p95_credit_transactions_amount_28d' => :'p95_credit_transactions_amount_28d', - :'p95_debit_transactions_amount_28d' => :'p95_debit_transactions_amount_28d', - :'days_with_negative_balance_count_90d' => :'days_with_negative_balance_count_90d', - :'p90_eod_balance_30d' => :'p90_eod_balance_30d', - :'p90_eod_balance_60d' => :'p90_eod_balance_60d', - :'p90_eod_balance_90d' => :'p90_eod_balance_90d', - :'p10_eod_balance_30d' => :'p10_eod_balance_30d', - :'p10_eod_balance_60d' => :'p10_eod_balance_60d', - :'p10_eod_balance_90d' => :'p10_eod_balance_90d', - :'available_balance' => :'available_balance', - :'current_balance' => :'current_balance', - :'balance_last_updated' => :'balance_last_updated', - :'phone_change_count_28d' => :'phone_change_count_28d', - :'phone_change_count_90d' => :'phone_change_count_90d', - :'email_change_count_28d' => :'email_change_count_28d', - :'email_change_count_90d' => :'email_change_count_90d', - :'address_change_count_28d' => :'address_change_count_28d', - :'address_change_count_90d' => :'address_change_count_90d', - :'plaid_non_oauth_authentication_attempts_count_3d' => :'plaid_non_oauth_authentication_attempts_count_3d', - :'plaid_non_oauth_authentication_attempts_count_7d' => :'plaid_non_oauth_authentication_attempts_count_7d', - :'plaid_non_oauth_authentication_attempts_count_30d' => :'plaid_non_oauth_authentication_attempts_count_30d', - :'failed_plaid_non_oauth_authentication_attempts_count_3d' => :'failed_plaid_non_oauth_authentication_attempts_count_3d', - :'failed_plaid_non_oauth_authentication_attempts_count_7d' => :'failed_plaid_non_oauth_authentication_attempts_count_7d', - :'failed_plaid_non_oauth_authentication_attempts_count_30d' => :'failed_plaid_non_oauth_authentication_attempts_count_30d', - :'debit_transactions_count_10d' => :'debit_transactions_count_10d', - :'credit_transactions_count_10d' => :'credit_transactions_count_10d', - :'debit_transactions_count_30d' => :'debit_transactions_count_30d', - :'credit_transactions_count_30d' => :'credit_transactions_count_30d', - :'debit_transactions_count_60d' => :'debit_transactions_count_60d', - :'credit_transactions_count_60d' => :'credit_transactions_count_60d', - :'debit_transactions_count_90d' => :'debit_transactions_count_90d', - :'credit_transactions_count_90d' => :'credit_transactions_count_90d', - :'total_debit_transactions_amount_30d' => :'total_debit_transactions_amount_30d', - :'total_credit_transactions_amount_30d' => :'total_credit_transactions_amount_30d', - :'total_debit_transactions_amount_60d' => :'total_debit_transactions_amount_60d', - :'total_credit_transactions_amount_60d' => :'total_credit_transactions_amount_60d', - :'total_debit_transactions_amount_90d' => :'total_debit_transactions_amount_90d', - :'total_credit_transactions_amount_90d' => :'total_credit_transactions_amount_90d', - :'p50_eod_balance_30d' => :'p50_eod_balance_30d', - :'p50_eod_balance_60d' => :'p50_eod_balance_60d', - :'p50_eod_balance_90d' => :'p50_eod_balance_90d', - :'p50_eod_balance_31d_to_60d' => :'p50_eod_balance_31d_to_60d', - :'p50_eod_balance_61d_to_90d' => :'p50_eod_balance_61d_to_90d', - :'p90_eod_balance_31d_to_60d' => :'p90_eod_balance_31d_to_60d', - :'p90_eod_balance_61d_to_90d' => :'p90_eod_balance_61d_to_90d', - :'p10_eod_balance_31d_to_60d' => :'p10_eod_balance_31d_to_60d', - :'p10_eod_balance_61d_to_90d' => :'p10_eod_balance_61d_to_90d', - :'transactions_last_updated' => :'transactions_last_updated', - :'is_account_closed' => :'is_account_closed', - :'is_account_frozen_or_restricted' => :'is_account_frozen_or_restricted', - :'distinct_ip_addresses_count_3d' => :'distinct_ip_addresses_count_3d', - :'distinct_ip_addresses_count_7d' => :'distinct_ip_addresses_count_7d', - :'distinct_ip_addresses_count_30d' => :'distinct_ip_addresses_count_30d', - :'distinct_ip_addresses_count_90d' => :'distinct_ip_addresses_count_90d', - :'distinct_user_agents_count_3d' => :'distinct_user_agents_count_3d', - :'distinct_user_agents_count_7d' => :'distinct_user_agents_count_7d', - :'distinct_user_agents_count_30d' => :'distinct_user_agents_count_30d', - :'distinct_user_agents_count_90d' => :'distinct_user_agents_count_90d', - :'distinct_ssl_tls_connection_sessions_count_3d' => :'distinct_ssl_tls_connection_sessions_count_3d', - :'distinct_ssl_tls_connection_sessions_count_7d' => :'distinct_ssl_tls_connection_sessions_count_7d', - :'distinct_ssl_tls_connection_sessions_count_30d' => :'distinct_ssl_tls_connection_sessions_count_30d', - :'distinct_ssl_tls_connection_sessions_count_90d' => :'distinct_ssl_tls_connection_sessions_count_90d' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'unauthorized_transactions_count_7d' => :'Integer', - :'unauthorized_transactions_count_30d' => :'Integer', - :'unauthorized_transactions_count_60d' => :'Integer', - :'unauthorized_transactions_count_90d' => :'Integer', - :'nsf_overdraft_transactions_count_7d' => :'Integer', - :'nsf_overdraft_transactions_count_30d' => :'Integer', - :'nsf_overdraft_transactions_count_60d' => :'Integer', - :'nsf_overdraft_transactions_count_90d' => :'Integer', - :'days_since_first_plaid_connection' => :'Integer', - :'plaid_connections_count_7d' => :'Integer', - :'plaid_connections_count_30d' => :'Integer', - :'total_plaid_connections_count' => :'Integer', - :'is_savings_or_money_market_account' => :'Boolean', - :'total_credit_transactions_amount_10d' => :'Float', - :'total_debit_transactions_amount_10d' => :'Float', - :'p50_credit_transactions_amount_28d' => :'Float', - :'p50_debit_transactions_amount_28d' => :'Float', - :'p95_credit_transactions_amount_28d' => :'Float', - :'p95_debit_transactions_amount_28d' => :'Float', - :'days_with_negative_balance_count_90d' => :'Integer', - :'p90_eod_balance_30d' => :'Float', - :'p90_eod_balance_60d' => :'Float', - :'p90_eod_balance_90d' => :'Float', - :'p10_eod_balance_30d' => :'Float', - :'p10_eod_balance_60d' => :'Float', - :'p10_eod_balance_90d' => :'Float', - :'available_balance' => :'Float', - :'current_balance' => :'Float', - :'balance_last_updated' => :'Time', - :'phone_change_count_28d' => :'Integer', - :'phone_change_count_90d' => :'Integer', - :'email_change_count_28d' => :'Integer', - :'email_change_count_90d' => :'Integer', - :'address_change_count_28d' => :'Integer', - :'address_change_count_90d' => :'Integer', - :'plaid_non_oauth_authentication_attempts_count_3d' => :'Integer', - :'plaid_non_oauth_authentication_attempts_count_7d' => :'Integer', - :'plaid_non_oauth_authentication_attempts_count_30d' => :'Integer', - :'failed_plaid_non_oauth_authentication_attempts_count_3d' => :'Integer', - :'failed_plaid_non_oauth_authentication_attempts_count_7d' => :'Integer', - :'failed_plaid_non_oauth_authentication_attempts_count_30d' => :'Integer', - :'debit_transactions_count_10d' => :'Integer', - :'credit_transactions_count_10d' => :'Integer', - :'debit_transactions_count_30d' => :'Integer', - :'credit_transactions_count_30d' => :'Integer', - :'debit_transactions_count_60d' => :'Integer', - :'credit_transactions_count_60d' => :'Integer', - :'debit_transactions_count_90d' => :'Integer', - :'credit_transactions_count_90d' => :'Integer', - :'total_debit_transactions_amount_30d' => :'Float', - :'total_credit_transactions_amount_30d' => :'Float', - :'total_debit_transactions_amount_60d' => :'Float', - :'total_credit_transactions_amount_60d' => :'Float', - :'total_debit_transactions_amount_90d' => :'Float', - :'total_credit_transactions_amount_90d' => :'Float', - :'p50_eod_balance_30d' => :'Float', - :'p50_eod_balance_60d' => :'Float', - :'p50_eod_balance_90d' => :'Float', - :'p50_eod_balance_31d_to_60d' => :'Float', - :'p50_eod_balance_61d_to_90d' => :'Float', - :'p90_eod_balance_31d_to_60d' => :'Float', - :'p90_eod_balance_61d_to_90d' => :'Float', - :'p10_eod_balance_31d_to_60d' => :'Float', - :'p10_eod_balance_61d_to_90d' => :'Float', - :'transactions_last_updated' => :'Time', - :'is_account_closed' => :'Boolean', - :'is_account_frozen_or_restricted' => :'Boolean', - :'distinct_ip_addresses_count_3d' => :'Integer', - :'distinct_ip_addresses_count_7d' => :'Integer', - :'distinct_ip_addresses_count_30d' => :'Integer', - :'distinct_ip_addresses_count_90d' => :'Integer', - :'distinct_user_agents_count_3d' => :'Integer', - :'distinct_user_agents_count_7d' => :'Integer', - :'distinct_user_agents_count_30d' => :'Integer', - :'distinct_user_agents_count_90d' => :'Integer', - :'distinct_ssl_tls_connection_sessions_count_3d' => :'Integer', - :'distinct_ssl_tls_connection_sessions_count_7d' => :'Integer', - :'distinct_ssl_tls_connection_sessions_count_30d' => :'Integer', - :'distinct_ssl_tls_connection_sessions_count_90d' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'unauthorized_transactions_count_7d', - :'unauthorized_transactions_count_30d', - :'unauthorized_transactions_count_60d', - :'unauthorized_transactions_count_90d', - :'nsf_overdraft_transactions_count_7d', - :'nsf_overdraft_transactions_count_30d', - :'nsf_overdraft_transactions_count_60d', - :'nsf_overdraft_transactions_count_90d', - :'days_since_first_plaid_connection', - :'plaid_connections_count_7d', - :'plaid_connections_count_30d', - :'total_plaid_connections_count', - :'is_savings_or_money_market_account', - :'total_credit_transactions_amount_10d', - :'total_debit_transactions_amount_10d', - :'p50_credit_transactions_amount_28d', - :'p50_debit_transactions_amount_28d', - :'p95_credit_transactions_amount_28d', - :'p95_debit_transactions_amount_28d', - :'days_with_negative_balance_count_90d', - :'p90_eod_balance_30d', - :'p90_eod_balance_60d', - :'p90_eod_balance_90d', - :'p10_eod_balance_30d', - :'p10_eod_balance_60d', - :'p10_eod_balance_90d', - :'available_balance', - :'current_balance', - :'balance_last_updated', - :'phone_change_count_28d', - :'phone_change_count_90d', - :'email_change_count_28d', - :'email_change_count_90d', - :'address_change_count_28d', - :'address_change_count_90d', - :'plaid_non_oauth_authentication_attempts_count_3d', - :'plaid_non_oauth_authentication_attempts_count_7d', - :'plaid_non_oauth_authentication_attempts_count_30d', - :'failed_plaid_non_oauth_authentication_attempts_count_3d', - :'failed_plaid_non_oauth_authentication_attempts_count_7d', - :'failed_plaid_non_oauth_authentication_attempts_count_30d', - :'debit_transactions_count_10d', - :'credit_transactions_count_10d', - :'debit_transactions_count_30d', - :'credit_transactions_count_30d', - :'debit_transactions_count_60d', - :'credit_transactions_count_60d', - :'debit_transactions_count_90d', - :'credit_transactions_count_90d', - :'total_debit_transactions_amount_30d', - :'total_credit_transactions_amount_30d', - :'total_debit_transactions_amount_60d', - :'total_credit_transactions_amount_60d', - :'total_debit_transactions_amount_90d', - :'total_credit_transactions_amount_90d', - :'p50_eod_balance_30d', - :'p50_eod_balance_60d', - :'p50_eod_balance_90d', - :'p50_eod_balance_31d_to_60d', - :'p50_eod_balance_61d_to_90d', - :'p90_eod_balance_31d_to_60d', - :'p90_eod_balance_61d_to_90d', - :'p10_eod_balance_31d_to_60d', - :'p10_eod_balance_61d_to_90d', - :'transactions_last_updated', - :'is_account_closed', - :'is_account_frozen_or_restricted', - :'distinct_ip_addresses_count_3d', - :'distinct_ip_addresses_count_7d', - :'distinct_ip_addresses_count_30d', - :'distinct_ip_addresses_count_90d', - :'distinct_user_agents_count_3d', - :'distinct_user_agents_count_7d', - :'distinct_user_agents_count_30d', - :'distinct_user_agents_count_90d', - :'distinct_ssl_tls_connection_sessions_count_3d', - :'distinct_ssl_tls_connection_sessions_count_7d', - :'distinct_ssl_tls_connection_sessions_count_30d', - :'distinct_ssl_tls_connection_sessions_count_90d' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SignalEvaluateCoreAttributes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SignalEvaluateCoreAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'unauthorized_transactions_count_7d') - self.unauthorized_transactions_count_7d = attributes[:'unauthorized_transactions_count_7d'] - end - - if attributes.key?(:'unauthorized_transactions_count_30d') - self.unauthorized_transactions_count_30d = attributes[:'unauthorized_transactions_count_30d'] - end - - if attributes.key?(:'unauthorized_transactions_count_60d') - self.unauthorized_transactions_count_60d = attributes[:'unauthorized_transactions_count_60d'] - end - - if attributes.key?(:'unauthorized_transactions_count_90d') - self.unauthorized_transactions_count_90d = attributes[:'unauthorized_transactions_count_90d'] - end - - if attributes.key?(:'nsf_overdraft_transactions_count_7d') - self.nsf_overdraft_transactions_count_7d = attributes[:'nsf_overdraft_transactions_count_7d'] - end - - if attributes.key?(:'nsf_overdraft_transactions_count_30d') - self.nsf_overdraft_transactions_count_30d = attributes[:'nsf_overdraft_transactions_count_30d'] - end - - if attributes.key?(:'nsf_overdraft_transactions_count_60d') - self.nsf_overdraft_transactions_count_60d = attributes[:'nsf_overdraft_transactions_count_60d'] - end - - if attributes.key?(:'nsf_overdraft_transactions_count_90d') - self.nsf_overdraft_transactions_count_90d = attributes[:'nsf_overdraft_transactions_count_90d'] - end - - if attributes.key?(:'days_since_first_plaid_connection') - self.days_since_first_plaid_connection = attributes[:'days_since_first_plaid_connection'] - end - - if attributes.key?(:'plaid_connections_count_7d') - self.plaid_connections_count_7d = attributes[:'plaid_connections_count_7d'] - end - - if attributes.key?(:'plaid_connections_count_30d') - self.plaid_connections_count_30d = attributes[:'plaid_connections_count_30d'] - end - - if attributes.key?(:'total_plaid_connections_count') - self.total_plaid_connections_count = attributes[:'total_plaid_connections_count'] - end - - if attributes.key?(:'is_savings_or_money_market_account') - self.is_savings_or_money_market_account = attributes[:'is_savings_or_money_market_account'] - end - - if attributes.key?(:'total_credit_transactions_amount_10d') - self.total_credit_transactions_amount_10d = attributes[:'total_credit_transactions_amount_10d'] - end - - if attributes.key?(:'total_debit_transactions_amount_10d') - self.total_debit_transactions_amount_10d = attributes[:'total_debit_transactions_amount_10d'] - end - - if attributes.key?(:'p50_credit_transactions_amount_28d') - self.p50_credit_transactions_amount_28d = attributes[:'p50_credit_transactions_amount_28d'] - end - - if attributes.key?(:'p50_debit_transactions_amount_28d') - self.p50_debit_transactions_amount_28d = attributes[:'p50_debit_transactions_amount_28d'] - end - - if attributes.key?(:'p95_credit_transactions_amount_28d') - self.p95_credit_transactions_amount_28d = attributes[:'p95_credit_transactions_amount_28d'] - end - - if attributes.key?(:'p95_debit_transactions_amount_28d') - self.p95_debit_transactions_amount_28d = attributes[:'p95_debit_transactions_amount_28d'] - end - - if attributes.key?(:'days_with_negative_balance_count_90d') - self.days_with_negative_balance_count_90d = attributes[:'days_with_negative_balance_count_90d'] - end - - if attributes.key?(:'p90_eod_balance_30d') - self.p90_eod_balance_30d = attributes[:'p90_eod_balance_30d'] - end - - if attributes.key?(:'p90_eod_balance_60d') - self.p90_eod_balance_60d = attributes[:'p90_eod_balance_60d'] - end - - if attributes.key?(:'p90_eod_balance_90d') - self.p90_eod_balance_90d = attributes[:'p90_eod_balance_90d'] - end - - if attributes.key?(:'p10_eod_balance_30d') - self.p10_eod_balance_30d = attributes[:'p10_eod_balance_30d'] - end - - if attributes.key?(:'p10_eod_balance_60d') - self.p10_eod_balance_60d = attributes[:'p10_eod_balance_60d'] - end - - if attributes.key?(:'p10_eod_balance_90d') - self.p10_eod_balance_90d = attributes[:'p10_eod_balance_90d'] - end - - if attributes.key?(:'available_balance') - self.available_balance = attributes[:'available_balance'] - end - - if attributes.key?(:'current_balance') - self.current_balance = attributes[:'current_balance'] - end - - if attributes.key?(:'balance_last_updated') - self.balance_last_updated = attributes[:'balance_last_updated'] - end - - if attributes.key?(:'phone_change_count_28d') - self.phone_change_count_28d = attributes[:'phone_change_count_28d'] - end - - if attributes.key?(:'phone_change_count_90d') - self.phone_change_count_90d = attributes[:'phone_change_count_90d'] - end - - if attributes.key?(:'email_change_count_28d') - self.email_change_count_28d = attributes[:'email_change_count_28d'] - end - - if attributes.key?(:'email_change_count_90d') - self.email_change_count_90d = attributes[:'email_change_count_90d'] - end - - if attributes.key?(:'address_change_count_28d') - self.address_change_count_28d = attributes[:'address_change_count_28d'] - end - - if attributes.key?(:'address_change_count_90d') - self.address_change_count_90d = attributes[:'address_change_count_90d'] - end - - if attributes.key?(:'plaid_non_oauth_authentication_attempts_count_3d') - self.plaid_non_oauth_authentication_attempts_count_3d = attributes[:'plaid_non_oauth_authentication_attempts_count_3d'] - end - - if attributes.key?(:'plaid_non_oauth_authentication_attempts_count_7d') - self.plaid_non_oauth_authentication_attempts_count_7d = attributes[:'plaid_non_oauth_authentication_attempts_count_7d'] - end - - if attributes.key?(:'plaid_non_oauth_authentication_attempts_count_30d') - self.plaid_non_oauth_authentication_attempts_count_30d = attributes[:'plaid_non_oauth_authentication_attempts_count_30d'] - end - - if attributes.key?(:'failed_plaid_non_oauth_authentication_attempts_count_3d') - self.failed_plaid_non_oauth_authentication_attempts_count_3d = attributes[:'failed_plaid_non_oauth_authentication_attempts_count_3d'] - end - - if attributes.key?(:'failed_plaid_non_oauth_authentication_attempts_count_7d') - self.failed_plaid_non_oauth_authentication_attempts_count_7d = attributes[:'failed_plaid_non_oauth_authentication_attempts_count_7d'] - end - - if attributes.key?(:'failed_plaid_non_oauth_authentication_attempts_count_30d') - self.failed_plaid_non_oauth_authentication_attempts_count_30d = attributes[:'failed_plaid_non_oauth_authentication_attempts_count_30d'] - end - - if attributes.key?(:'debit_transactions_count_10d') - self.debit_transactions_count_10d = attributes[:'debit_transactions_count_10d'] - end - - if attributes.key?(:'credit_transactions_count_10d') - self.credit_transactions_count_10d = attributes[:'credit_transactions_count_10d'] - end - - if attributes.key?(:'debit_transactions_count_30d') - self.debit_transactions_count_30d = attributes[:'debit_transactions_count_30d'] - end - - if attributes.key?(:'credit_transactions_count_30d') - self.credit_transactions_count_30d = attributes[:'credit_transactions_count_30d'] - end - - if attributes.key?(:'debit_transactions_count_60d') - self.debit_transactions_count_60d = attributes[:'debit_transactions_count_60d'] - end - - if attributes.key?(:'credit_transactions_count_60d') - self.credit_transactions_count_60d = attributes[:'credit_transactions_count_60d'] - end - - if attributes.key?(:'debit_transactions_count_90d') - self.debit_transactions_count_90d = attributes[:'debit_transactions_count_90d'] - end - - if attributes.key?(:'credit_transactions_count_90d') - self.credit_transactions_count_90d = attributes[:'credit_transactions_count_90d'] - end - - if attributes.key?(:'total_debit_transactions_amount_30d') - self.total_debit_transactions_amount_30d = attributes[:'total_debit_transactions_amount_30d'] - end - - if attributes.key?(:'total_credit_transactions_amount_30d') - self.total_credit_transactions_amount_30d = attributes[:'total_credit_transactions_amount_30d'] - end - - if attributes.key?(:'total_debit_transactions_amount_60d') - self.total_debit_transactions_amount_60d = attributes[:'total_debit_transactions_amount_60d'] - end - - if attributes.key?(:'total_credit_transactions_amount_60d') - self.total_credit_transactions_amount_60d = attributes[:'total_credit_transactions_amount_60d'] - end - - if attributes.key?(:'total_debit_transactions_amount_90d') - self.total_debit_transactions_amount_90d = attributes[:'total_debit_transactions_amount_90d'] - end - - if attributes.key?(:'total_credit_transactions_amount_90d') - self.total_credit_transactions_amount_90d = attributes[:'total_credit_transactions_amount_90d'] - end - - if attributes.key?(:'p50_eod_balance_30d') - self.p50_eod_balance_30d = attributes[:'p50_eod_balance_30d'] - end - - if attributes.key?(:'p50_eod_balance_60d') - self.p50_eod_balance_60d = attributes[:'p50_eod_balance_60d'] - end - - if attributes.key?(:'p50_eod_balance_90d') - self.p50_eod_balance_90d = attributes[:'p50_eod_balance_90d'] - end - - if attributes.key?(:'p50_eod_balance_31d_to_60d') - self.p50_eod_balance_31d_to_60d = attributes[:'p50_eod_balance_31d_to_60d'] - end - - if attributes.key?(:'p50_eod_balance_61d_to_90d') - self.p50_eod_balance_61d_to_90d = attributes[:'p50_eod_balance_61d_to_90d'] - end - - if attributes.key?(:'p90_eod_balance_31d_to_60d') - self.p90_eod_balance_31d_to_60d = attributes[:'p90_eod_balance_31d_to_60d'] - end - - if attributes.key?(:'p90_eod_balance_61d_to_90d') - self.p90_eod_balance_61d_to_90d = attributes[:'p90_eod_balance_61d_to_90d'] - end - - if attributes.key?(:'p10_eod_balance_31d_to_60d') - self.p10_eod_balance_31d_to_60d = attributes[:'p10_eod_balance_31d_to_60d'] - end - - if attributes.key?(:'p10_eod_balance_61d_to_90d') - self.p10_eod_balance_61d_to_90d = attributes[:'p10_eod_balance_61d_to_90d'] - end - - if attributes.key?(:'transactions_last_updated') - self.transactions_last_updated = attributes[:'transactions_last_updated'] - end - - if attributes.key?(:'is_account_closed') - self.is_account_closed = attributes[:'is_account_closed'] - end - - if attributes.key?(:'is_account_frozen_or_restricted') - self.is_account_frozen_or_restricted = attributes[:'is_account_frozen_or_restricted'] - end - - if attributes.key?(:'distinct_ip_addresses_count_3d') - self.distinct_ip_addresses_count_3d = attributes[:'distinct_ip_addresses_count_3d'] - end - - if attributes.key?(:'distinct_ip_addresses_count_7d') - self.distinct_ip_addresses_count_7d = attributes[:'distinct_ip_addresses_count_7d'] - end - - if attributes.key?(:'distinct_ip_addresses_count_30d') - self.distinct_ip_addresses_count_30d = attributes[:'distinct_ip_addresses_count_30d'] - end - - if attributes.key?(:'distinct_ip_addresses_count_90d') - self.distinct_ip_addresses_count_90d = attributes[:'distinct_ip_addresses_count_90d'] - end - - if attributes.key?(:'distinct_user_agents_count_3d') - self.distinct_user_agents_count_3d = attributes[:'distinct_user_agents_count_3d'] - end - - if attributes.key?(:'distinct_user_agents_count_7d') - self.distinct_user_agents_count_7d = attributes[:'distinct_user_agents_count_7d'] - end - - if attributes.key?(:'distinct_user_agents_count_30d') - self.distinct_user_agents_count_30d = attributes[:'distinct_user_agents_count_30d'] - end - - if attributes.key?(:'distinct_user_agents_count_90d') - self.distinct_user_agents_count_90d = attributes[:'distinct_user_agents_count_90d'] - end - - if attributes.key?(:'distinct_ssl_tls_connection_sessions_count_3d') - self.distinct_ssl_tls_connection_sessions_count_3d = attributes[:'distinct_ssl_tls_connection_sessions_count_3d'] - end - - if attributes.key?(:'distinct_ssl_tls_connection_sessions_count_7d') - self.distinct_ssl_tls_connection_sessions_count_7d = attributes[:'distinct_ssl_tls_connection_sessions_count_7d'] - end - - if attributes.key?(:'distinct_ssl_tls_connection_sessions_count_30d') - self.distinct_ssl_tls_connection_sessions_count_30d = attributes[:'distinct_ssl_tls_connection_sessions_count_30d'] - end - - if attributes.key?(:'distinct_ssl_tls_connection_sessions_count_90d') - self.distinct_ssl_tls_connection_sessions_count_90d = attributes[:'distinct_ssl_tls_connection_sessions_count_90d'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - unauthorized_transactions_count_7d == o.unauthorized_transactions_count_7d && - unauthorized_transactions_count_30d == o.unauthorized_transactions_count_30d && - unauthorized_transactions_count_60d == o.unauthorized_transactions_count_60d && - unauthorized_transactions_count_90d == o.unauthorized_transactions_count_90d && - nsf_overdraft_transactions_count_7d == o.nsf_overdraft_transactions_count_7d && - nsf_overdraft_transactions_count_30d == o.nsf_overdraft_transactions_count_30d && - nsf_overdraft_transactions_count_60d == o.nsf_overdraft_transactions_count_60d && - nsf_overdraft_transactions_count_90d == o.nsf_overdraft_transactions_count_90d && - days_since_first_plaid_connection == o.days_since_first_plaid_connection && - plaid_connections_count_7d == o.plaid_connections_count_7d && - plaid_connections_count_30d == o.plaid_connections_count_30d && - total_plaid_connections_count == o.total_plaid_connections_count && - is_savings_or_money_market_account == o.is_savings_or_money_market_account && - total_credit_transactions_amount_10d == o.total_credit_transactions_amount_10d && - total_debit_transactions_amount_10d == o.total_debit_transactions_amount_10d && - p50_credit_transactions_amount_28d == o.p50_credit_transactions_amount_28d && - p50_debit_transactions_amount_28d == o.p50_debit_transactions_amount_28d && - p95_credit_transactions_amount_28d == o.p95_credit_transactions_amount_28d && - p95_debit_transactions_amount_28d == o.p95_debit_transactions_amount_28d && - days_with_negative_balance_count_90d == o.days_with_negative_balance_count_90d && - p90_eod_balance_30d == o.p90_eod_balance_30d && - p90_eod_balance_60d == o.p90_eod_balance_60d && - p90_eod_balance_90d == o.p90_eod_balance_90d && - p10_eod_balance_30d == o.p10_eod_balance_30d && - p10_eod_balance_60d == o.p10_eod_balance_60d && - p10_eod_balance_90d == o.p10_eod_balance_90d && - available_balance == o.available_balance && - current_balance == o.current_balance && - balance_last_updated == o.balance_last_updated && - phone_change_count_28d == o.phone_change_count_28d && - phone_change_count_90d == o.phone_change_count_90d && - email_change_count_28d == o.email_change_count_28d && - email_change_count_90d == o.email_change_count_90d && - address_change_count_28d == o.address_change_count_28d && - address_change_count_90d == o.address_change_count_90d && - plaid_non_oauth_authentication_attempts_count_3d == o.plaid_non_oauth_authentication_attempts_count_3d && - plaid_non_oauth_authentication_attempts_count_7d == o.plaid_non_oauth_authentication_attempts_count_7d && - plaid_non_oauth_authentication_attempts_count_30d == o.plaid_non_oauth_authentication_attempts_count_30d && - failed_plaid_non_oauth_authentication_attempts_count_3d == o.failed_plaid_non_oauth_authentication_attempts_count_3d && - failed_plaid_non_oauth_authentication_attempts_count_7d == o.failed_plaid_non_oauth_authentication_attempts_count_7d && - failed_plaid_non_oauth_authentication_attempts_count_30d == o.failed_plaid_non_oauth_authentication_attempts_count_30d && - debit_transactions_count_10d == o.debit_transactions_count_10d && - credit_transactions_count_10d == o.credit_transactions_count_10d && - debit_transactions_count_30d == o.debit_transactions_count_30d && - credit_transactions_count_30d == o.credit_transactions_count_30d && - debit_transactions_count_60d == o.debit_transactions_count_60d && - credit_transactions_count_60d == o.credit_transactions_count_60d && - debit_transactions_count_90d == o.debit_transactions_count_90d && - credit_transactions_count_90d == o.credit_transactions_count_90d && - total_debit_transactions_amount_30d == o.total_debit_transactions_amount_30d && - total_credit_transactions_amount_30d == o.total_credit_transactions_amount_30d && - total_debit_transactions_amount_60d == o.total_debit_transactions_amount_60d && - total_credit_transactions_amount_60d == o.total_credit_transactions_amount_60d && - total_debit_transactions_amount_90d == o.total_debit_transactions_amount_90d && - total_credit_transactions_amount_90d == o.total_credit_transactions_amount_90d && - p50_eod_balance_30d == o.p50_eod_balance_30d && - p50_eod_balance_60d == o.p50_eod_balance_60d && - p50_eod_balance_90d == o.p50_eod_balance_90d && - p50_eod_balance_31d_to_60d == o.p50_eod_balance_31d_to_60d && - p50_eod_balance_61d_to_90d == o.p50_eod_balance_61d_to_90d && - p90_eod_balance_31d_to_60d == o.p90_eod_balance_31d_to_60d && - p90_eod_balance_61d_to_90d == o.p90_eod_balance_61d_to_90d && - p10_eod_balance_31d_to_60d == o.p10_eod_balance_31d_to_60d && - p10_eod_balance_61d_to_90d == o.p10_eod_balance_61d_to_90d && - transactions_last_updated == o.transactions_last_updated && - is_account_closed == o.is_account_closed && - is_account_frozen_or_restricted == o.is_account_frozen_or_restricted && - distinct_ip_addresses_count_3d == o.distinct_ip_addresses_count_3d && - distinct_ip_addresses_count_7d == o.distinct_ip_addresses_count_7d && - distinct_ip_addresses_count_30d == o.distinct_ip_addresses_count_30d && - distinct_ip_addresses_count_90d == o.distinct_ip_addresses_count_90d && - distinct_user_agents_count_3d == o.distinct_user_agents_count_3d && - distinct_user_agents_count_7d == o.distinct_user_agents_count_7d && - distinct_user_agents_count_30d == o.distinct_user_agents_count_30d && - distinct_user_agents_count_90d == o.distinct_user_agents_count_90d && - distinct_ssl_tls_connection_sessions_count_3d == o.distinct_ssl_tls_connection_sessions_count_3d && - distinct_ssl_tls_connection_sessions_count_7d == o.distinct_ssl_tls_connection_sessions_count_7d && - distinct_ssl_tls_connection_sessions_count_30d == o.distinct_ssl_tls_connection_sessions_count_30d && - distinct_ssl_tls_connection_sessions_count_90d == o.distinct_ssl_tls_connection_sessions_count_90d - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [unauthorized_transactions_count_7d, unauthorized_transactions_count_30d, unauthorized_transactions_count_60d, unauthorized_transactions_count_90d, nsf_overdraft_transactions_count_7d, nsf_overdraft_transactions_count_30d, nsf_overdraft_transactions_count_60d, nsf_overdraft_transactions_count_90d, days_since_first_plaid_connection, plaid_connections_count_7d, plaid_connections_count_30d, total_plaid_connections_count, is_savings_or_money_market_account, total_credit_transactions_amount_10d, total_debit_transactions_amount_10d, p50_credit_transactions_amount_28d, p50_debit_transactions_amount_28d, p95_credit_transactions_amount_28d, p95_debit_transactions_amount_28d, days_with_negative_balance_count_90d, p90_eod_balance_30d, p90_eod_balance_60d, p90_eod_balance_90d, p10_eod_balance_30d, p10_eod_balance_60d, p10_eod_balance_90d, available_balance, current_balance, balance_last_updated, phone_change_count_28d, phone_change_count_90d, email_change_count_28d, email_change_count_90d, address_change_count_28d, address_change_count_90d, plaid_non_oauth_authentication_attempts_count_3d, plaid_non_oauth_authentication_attempts_count_7d, plaid_non_oauth_authentication_attempts_count_30d, failed_plaid_non_oauth_authentication_attempts_count_3d, failed_plaid_non_oauth_authentication_attempts_count_7d, failed_plaid_non_oauth_authentication_attempts_count_30d, debit_transactions_count_10d, credit_transactions_count_10d, debit_transactions_count_30d, credit_transactions_count_30d, debit_transactions_count_60d, credit_transactions_count_60d, debit_transactions_count_90d, credit_transactions_count_90d, total_debit_transactions_amount_30d, total_credit_transactions_amount_30d, total_debit_transactions_amount_60d, total_credit_transactions_amount_60d, total_debit_transactions_amount_90d, total_credit_transactions_amount_90d, p50_eod_balance_30d, p50_eod_balance_60d, p50_eod_balance_90d, p50_eod_balance_31d_to_60d, p50_eod_balance_61d_to_90d, p90_eod_balance_31d_to_60d, p90_eod_balance_61d_to_90d, p10_eod_balance_31d_to_60d, p10_eod_balance_61d_to_90d, transactions_last_updated, is_account_closed, is_account_frozen_or_restricted, distinct_ip_addresses_count_3d, distinct_ip_addresses_count_7d, distinct_ip_addresses_count_30d, distinct_ip_addresses_count_90d, distinct_user_agents_count_3d, distinct_user_agents_count_7d, distinct_user_agents_count_30d, distinct_user_agents_count_90d, distinct_ssl_tls_connection_sessions_count_3d, distinct_ssl_tls_connection_sessions_count_7d, distinct_ssl_tls_connection_sessions_count_30d, distinct_ssl_tls_connection_sessions_count_90d].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/signal_evaluate_request.rb b/lib/plaid/models/signal_evaluate_request.rb deleted file mode 100644 index 77495c636..000000000 --- a/lib/plaid/models/signal_evaluate_request.rb +++ /dev/null @@ -1,419 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SignalEvaluateRequest defines the request schema for `/signal/evaluate` - class SignalEvaluateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # 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. - attr_accessor :account_id - - # 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 ID/identifier for this transaction. The max length for this field is 36 characters. - attr_accessor :client_transaction_id - - # The transaction amount, in USD (e.g. `102.05`) - attr_accessor :amount - - # `true` if the end user is present while initiating the ACH transfer and the endpoint is being called; `false` otherwise (for example, when the ACH transfer is scheduled and the end user is not present, or you call this endpoint after the ACH transfer but before submitting the Nacha file for ACH processing). - attr_accessor :user_present - - # A unique ID that identifies the end user in your system. This ID is used to correlate requests by a user with multiple Items. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`. - attr_accessor :client_user_id - - # `true` if the ACH transaction is a recurring transaction; `false` otherwise - attr_accessor :is_recurring - - # The default ACH or non-ACH payment method to complete the transaction. `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` - attr_accessor :default_payment_method - - attr_accessor :user - - attr_accessor :device - - # The name of the risk profile to use for this transaction. A risk profile can be configured using via the Plaid Dashboard. If not provided, no risk profile will be used. This feature is currently in closed beta; to request access, contact your account manager. - attr_accessor :risk_profile_key - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'account_id' => :'account_id', - :'client_transaction_id' => :'client_transaction_id', - :'amount' => :'amount', - :'user_present' => :'user_present', - :'client_user_id' => :'client_user_id', - :'is_recurring' => :'is_recurring', - :'default_payment_method' => :'default_payment_method', - :'user' => :'user', - :'device' => :'device', - :'risk_profile_key' => :'risk_profile_key' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'account_id' => :'String', - :'client_transaction_id' => :'String', - :'amount' => :'Float', - :'user_present' => :'Boolean', - :'client_user_id' => :'String', - :'is_recurring' => :'Boolean', - :'default_payment_method' => :'String', - :'user' => :'SignalUser', - :'device' => :'SignalDevice', - :'risk_profile_key' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'user_present', - :'is_recurring', - :'default_payment_method', - :'risk_profile_key' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SignalEvaluateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SignalEvaluateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'client_transaction_id') - self.client_transaction_id = attributes[:'client_transaction_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'user_present') - self.user_present = attributes[:'user_present'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'is_recurring') - self.is_recurring = attributes[:'is_recurring'] - end - - if attributes.key?(:'default_payment_method') - self.default_payment_method = attributes[:'default_payment_method'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'device') - self.device = attributes[:'device'] - end - - if attributes.key?(:'risk_profile_key') - self.risk_profile_key = attributes[:'risk_profile_key'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @client_transaction_id.nil? - invalid_properties.push('invalid value for "client_transaction_id", client_transaction_id cannot be nil.') - end - - if @client_transaction_id.to_s.length > 36 - invalid_properties.push('invalid value for "client_transaction_id", the character length must be smaller than or equal to 36.') - end - - if @client_transaction_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_transaction_id", the character length must be great than or equal to 1.') - end - - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if !@risk_profile_key.nil? && @risk_profile_key.to_s.length > 32 - invalid_properties.push('invalid value for "risk_profile_key", the character length must be smaller than or equal to 32.') - end - - if !@risk_profile_key.nil? && @risk_profile_key.to_s.length < 1 - invalid_properties.push('invalid value for "risk_profile_key", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @account_id.nil? - return false if @client_transaction_id.nil? - return false if @client_transaction_id.to_s.length > 36 - return false if @client_transaction_id.to_s.length < 1 - return false if @amount.nil? - return false if !@risk_profile_key.nil? && @risk_profile_key.to_s.length > 32 - return false if !@risk_profile_key.nil? && @risk_profile_key.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] client_transaction_id Value to be assigned - def client_transaction_id=(client_transaction_id) - if client_transaction_id.nil? - fail ArgumentError, 'client_transaction_id cannot be nil' - end - - if client_transaction_id.to_s.length > 36 - fail ArgumentError, 'invalid value for "client_transaction_id", the character length must be smaller than or equal to 36.' - end - - if client_transaction_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_transaction_id", the character length must be great than or equal to 1.' - end - - - @client_transaction_id = client_transaction_id - end - - # Custom attribute writer method with validation - # @param [Object] risk_profile_key Value to be assigned - def risk_profile_key=(risk_profile_key) - if !risk_profile_key.nil? && risk_profile_key.to_s.length > 32 - fail ArgumentError, 'invalid value for "risk_profile_key", the character length must be smaller than or equal to 32.' - end - - if !risk_profile_key.nil? && risk_profile_key.to_s.length < 1 - fail ArgumentError, 'invalid value for "risk_profile_key", the character length must be great than or equal to 1.' - end - - - @risk_profile_key = risk_profile_key - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - account_id == o.account_id && - client_transaction_id == o.client_transaction_id && - amount == o.amount && - user_present == o.user_present && - client_user_id == o.client_user_id && - is_recurring == o.is_recurring && - default_payment_method == o.default_payment_method && - user == o.user && - device == o.device && - risk_profile_key == o.risk_profile_key - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, account_id, client_transaction_id, amount, user_present, client_user_id, is_recurring, default_payment_method, user, device, risk_profile_key].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/signal_evaluate_response.rb b/lib/plaid/models/signal_evaluate_response.rb deleted file mode 100644 index 6a357ab8d..000000000 --- a/lib/plaid/models/signal_evaluate_response.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SignalEvaluateResponse defines the response schema for `/signal/income/evaluate` - class SignalEvaluateResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - attr_accessor :scores - - attr_accessor :core_attributes - - attr_accessor :risk_profile - - # 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. - attr_accessor :warnings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id', - :'scores' => :'scores', - :'core_attributes' => :'core_attributes', - :'risk_profile' => :'risk_profile', - :'warnings' => :'warnings' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String', - :'scores' => :'SignalScores', - :'core_attributes' => :'SignalEvaluateCoreAttributes', - :'risk_profile' => :'RiskProfile', - :'warnings' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'risk_profile', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SignalEvaluateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SignalEvaluateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'scores') - self.scores = attributes[:'scores'] - end - - if attributes.key?(:'core_attributes') - self.core_attributes = attributes[:'core_attributes'] - end - - if attributes.key?(:'risk_profile') - self.risk_profile = attributes[:'risk_profile'] - end - - if attributes.key?(:'warnings') - if (value = attributes[:'warnings']).is_a?(Array) - self.warnings = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - if @scores.nil? - invalid_properties.push('invalid value for "scores", scores cannot be nil.') - end - - if @warnings.nil? - invalid_properties.push('invalid value for "warnings", warnings cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - return false if @scores.nil? - return false if @warnings.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id && - scores == o.scores && - core_attributes == o.core_attributes && - risk_profile == o.risk_profile && - warnings == o.warnings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id, scores, core_attributes, risk_profile, warnings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/signal_payment_method.rb b/lib/plaid/models/signal_payment_method.rb deleted file mode 100644 index 0b94f280e..000000000 --- a/lib/plaid/models/signal_payment_method.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class SignalPaymentMethod - SAME_DAY_ACH = "SAME_DAY_ACH".freeze - NEXT_DAY_ACH = "NEXT_DAY_ACH".freeze - STANDARD_ACH = "STANDARD_ACH".freeze - REAL_TIME_PAYMENTS = "REAL_TIME_PAYMENTS".freeze - DEBIT_CARD = "DEBIT_CARD".freeze - MULTIPLE_PAYMENT_METHODS = "MULTIPLE_PAYMENT_METHODS".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/signal_person_name.rb b/lib/plaid/models/signal_person_name.rb deleted file mode 100644 index 8bec43d0d..000000000 --- a/lib/plaid/models/signal_person_name.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The user's legal name - class SignalPersonName - # The user's name prefix (e.g. \"Mr.\") - attr_accessor :prefix - - # The user's given name. If the user has a one-word name, it should be provided in this field. - attr_accessor :given_name - - # The user's middle name - attr_accessor :middle_name - - # The user's family name / surname - attr_accessor :family_name - - # The user's name suffix (e.g. \"II\") - attr_accessor :suffix - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'prefix' => :'prefix', - :'given_name' => :'given_name', - :'middle_name' => :'middle_name', - :'family_name' => :'family_name', - :'suffix' => :'suffix' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'prefix' => :'String', - :'given_name' => :'String', - :'middle_name' => :'String', - :'family_name' => :'String', - :'suffix' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'prefix', - :'given_name', - :'middle_name', - :'family_name', - :'suffix' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SignalPersonName` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SignalPersonName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'prefix') - self.prefix = attributes[:'prefix'] - end - - if attributes.key?(:'given_name') - self.given_name = attributes[:'given_name'] - end - - if attributes.key?(:'middle_name') - self.middle_name = attributes[:'middle_name'] - end - - if attributes.key?(:'family_name') - self.family_name = attributes[:'family_name'] - end - - if attributes.key?(:'suffix') - self.suffix = attributes[:'suffix'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - prefix == o.prefix && - given_name == o.given_name && - middle_name == o.middle_name && - family_name == o.family_name && - suffix == o.suffix - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [prefix, given_name, middle_name, family_name, suffix].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/signal_prepare_request.rb b/lib/plaid/models/signal_prepare_request.rb deleted file mode 100644 index bc40a5ad7..000000000 --- a/lib/plaid/models/signal_prepare_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SignalPrepareRequest defines the request schema for `/signal/prepare` - class SignalPrepareRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SignalPrepareRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SignalPrepareRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/signal_prepare_response.rb b/lib/plaid/models/signal_prepare_response.rb deleted file mode 100644 index 080989634..000000000 --- a/lib/plaid/models/signal_prepare_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SignalPrepareResponse defines the response schema for `/signal/prepare` - class SignalPrepareResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SignalPrepareResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SignalPrepareResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/signal_return_report_request.rb b/lib/plaid/models/signal_return_report_request.rb deleted file mode 100644 index e58257599..000000000 --- a/lib/plaid/models/signal_return_report_request.rb +++ /dev/null @@ -1,302 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SignalReturnReportRequest defines the request schema for `/signal/return/report` - class SignalReturnReportRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Must be the same as the `client_transaction_id` supplied when calling `/signal/evaluate` - attr_accessor :client_transaction_id - - # Must be a valid ACH return code (e.g. \"R01\") If formatted incorrectly, this will result in an [`INVALID_FIELD`](/docs/errors/invalid-request/#invalid_field) error. - attr_accessor :return_code - - # Date and time when you receive the returns from your payment processors, in ISO 8601 format (`YYYY-MM-DDTHH:mm:ssZ`). - attr_accessor :returned_at - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'client_transaction_id' => :'client_transaction_id', - :'return_code' => :'return_code', - :'returned_at' => :'returned_at' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'client_transaction_id' => :'String', - :'return_code' => :'String', - :'returned_at' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'returned_at' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SignalReturnReportRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SignalReturnReportRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_transaction_id') - self.client_transaction_id = attributes[:'client_transaction_id'] - end - - if attributes.key?(:'return_code') - self.return_code = attributes[:'return_code'] - end - - if attributes.key?(:'returned_at') - self.returned_at = attributes[:'returned_at'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @client_transaction_id.nil? - invalid_properties.push('invalid value for "client_transaction_id", client_transaction_id cannot be nil.') - end - - if @client_transaction_id.to_s.length > 36 - invalid_properties.push('invalid value for "client_transaction_id", the character length must be smaller than or equal to 36.') - end - - if @client_transaction_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_transaction_id", the character length must be great than or equal to 1.') - end - - - if @return_code.nil? - invalid_properties.push('invalid value for "return_code", return_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @client_transaction_id.nil? - return false if @client_transaction_id.to_s.length > 36 - return false if @client_transaction_id.to_s.length < 1 - return false if @return_code.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_transaction_id Value to be assigned - def client_transaction_id=(client_transaction_id) - if client_transaction_id.nil? - fail ArgumentError, 'client_transaction_id cannot be nil' - end - - if client_transaction_id.to_s.length > 36 - fail ArgumentError, 'invalid value for "client_transaction_id", the character length must be smaller than or equal to 36.' - end - - if client_transaction_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_transaction_id", the character length must be great than or equal to 1.' - end - - - @client_transaction_id = client_transaction_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - client_transaction_id == o.client_transaction_id && - return_code == o.return_code && - returned_at == o.returned_at - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, client_transaction_id, return_code, returned_at].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/signal_return_report_response.rb b/lib/plaid/models/signal_return_report_response.rb deleted file mode 100644 index 7a18646df..000000000 --- a/lib/plaid/models/signal_return_report_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # SignalReturnReportResponse defines the response schema for `/signal/return/report` - class SignalReturnReportResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SignalReturnReportResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SignalReturnReportResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/signal_scores.rb b/lib/plaid/models/signal_scores.rb deleted file mode 100644 index 904d7033e..000000000 --- a/lib/plaid/models/signal_scores.rb +++ /dev/null @@ -1,229 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Risk scoring details broken down by risk category. - class SignalScores - attr_accessor :customer_initiated_return_risk - - attr_accessor :bank_initiated_return_risk - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'customer_initiated_return_risk' => :'customer_initiated_return_risk', - :'bank_initiated_return_risk' => :'bank_initiated_return_risk' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'customer_initiated_return_risk' => :'CustomerInitiatedReturnRisk', - :'bank_initiated_return_risk' => :'BankInitiatedReturnRisk' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SignalScores` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SignalScores`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'customer_initiated_return_risk') - self.customer_initiated_return_risk = attributes[:'customer_initiated_return_risk'] - end - - if attributes.key?(:'bank_initiated_return_risk') - self.bank_initiated_return_risk = attributes[:'bank_initiated_return_risk'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - customer_initiated_return_risk == o.customer_initiated_return_risk && - bank_initiated_return_risk == o.bank_initiated_return_risk - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [customer_initiated_return_risk, bank_initiated_return_risk].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/signal_user.rb b/lib/plaid/models/signal_user.rb deleted file mode 100644 index 9daa7e73d..000000000 --- a/lib/plaid/models/signal_user.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class SignalUser - attr_accessor :name - - # The user's phone number, in E.164 format: +{countrycode}{number}. For example: \"+14151234567\" - attr_accessor :phone_number - - # The user's email address. - attr_accessor :email_address - - attr_accessor :address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'phone_number' => :'phone_number', - :'email_address' => :'email_address', - :'address' => :'address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'SignalPersonName', - :'phone_number' => :'String', - :'email_address' => :'String', - :'address' => :'SignalAddressData' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'phone_number', - :'email_address', - :'address' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SignalUser` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SignalUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - phone_number == o.phone_number && - email_address == o.email_address && - address == o.address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, phone_number, email_address, address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/signal_warning.rb b/lib/plaid/models/signal_warning.rb deleted file mode 100644 index 164d253ac..000000000 --- a/lib/plaid/models/signal_warning.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Conveys information about the errors causing missing or stale bank data used to construct the /signal/evaluate scores and response - class SignalWarning - # A broad categorization of the warning. Safe for programmatic use. - attr_accessor :warning_type - - # The warning code identifies a specific kind of warning that pertains to the error causing bank data to be missing. Safe for programmatic use. For more details on warning codes, please refer to Plaid standard error codes documentation. If you receive the `ITEM_LOGIN_REQUIRED` warning, we recommend re-authenticating your user by implementing Link's update mode. This will guide your user to fix their credentials, allowing Plaid to start fetching data again for future Signal requests. - attr_accessor :warning_code - - # A developer-friendly representation of the warning type. This may change over time and is not safe for programmatic use. - attr_accessor :warning_message - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'warning_type' => :'warning_type', - :'warning_code' => :'warning_code', - :'warning_message' => :'warning_message' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'warning_type' => :'String', - :'warning_code' => :'String', - :'warning_message' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SignalWarning` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SignalWarning`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'warning_type') - self.warning_type = attributes[:'warning_type'] - end - - if attributes.key?(:'warning_code') - self.warning_code = attributes[:'warning_code'] - end - - if attributes.key?(:'warning_message') - self.warning_message = attributes[:'warning_message'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - warning_type == o.warning_type && - warning_code == o.warning_code && - warning_message == o.warning_message - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [warning_type, warning_code, warning_message].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/simulated_transfer_sweep.rb b/lib/plaid/models/simulated_transfer_sweep.rb deleted file mode 100644 index 4714cb13e..000000000 --- a/lib/plaid/models/simulated_transfer_sweep.rb +++ /dev/null @@ -1,367 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A sweep returned from the `/sandbox/transfer/sweep/simulate` endpoint. Can be null if there are no transfers to include in a sweep. - class SimulatedTransferSweep - # Identifier of the sweep. - attr_accessor :id - - # The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited. - attr_accessor :funding_account_id - - # The datetime when the sweep occurred, in RFC 3339 format. - attr_accessor :created - - # Signed decimal amount of the sweep as it appears on your sweep account ledger (e.g. \"-10.00\") If amount is not present, the sweep was net-settled to zero and outstanding debits and credits between the sweep account and Plaid are balanced. - attr_accessor :amount - - # The currency of the sweep, e.g. \"USD\". - attr_accessor :iso_currency_code - - # The date when the sweep settled, in the YYYY-MM-DD format. - attr_accessor :settled - - attr_accessor :status - - attr_accessor :trigger - - # The description of the deposit that will be passed to the receiving bank (up to 10 characters). Note that banks utilize this field differently, and may or may not show it on the bank statement. - attr_accessor :description - - # 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. For `wire` transfers, this will be in the format of `/`. The field will remain null for transfers on other rails. - attr_accessor :network_trace_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'funding_account_id' => :'funding_account_id', - :'created' => :'created', - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code', - :'settled' => :'settled', - :'status' => :'status', - :'trigger' => :'trigger', - :'description' => :'description', - :'network_trace_id' => :'network_trace_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'funding_account_id' => :'String', - :'created' => :'Time', - :'amount' => :'String', - :'iso_currency_code' => :'String', - :'settled' => :'Date', - :'status' => :'SweepStatus', - :'trigger' => :'SweepTrigger', - :'description' => :'String', - :'network_trace_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'settled', - :'status', - :'trigger', - :'network_trace_id' - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'TransferSweep' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SimulatedTransferSweep` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SimulatedTransferSweep`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - - if attributes.key?(:'created') - self.created = attributes[:'created'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'settled') - self.settled = attributes[:'settled'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'trigger') - self.trigger = attributes[:'trigger'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'network_trace_id') - self.network_trace_id = attributes[:'network_trace_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @funding_account_id.nil? - invalid_properties.push('invalid value for "funding_account_id", funding_account_id cannot be nil.') - end - - if @created.nil? - invalid_properties.push('invalid value for "created", created cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @funding_account_id.nil? - return false if @created.nil? - return false if @amount.nil? - return false if @iso_currency_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - funding_account_id == o.funding_account_id && - created == o.created && - amount == o.amount && - iso_currency_code == o.iso_currency_code && - settled == o.settled && - status == o.status && - trigger == o.trigger && - description == o.description && - network_trace_id == o.network_trace_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, funding_account_id, created, amount, iso_currency_code, settled, status, trigger, description, network_trace_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/single_document_risk_signal.rb b/lib/plaid/models/single_document_risk_signal.rb deleted file mode 100644 index 13cca1baa..000000000 --- a/lib/plaid/models/single_document_risk_signal.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Object containing all risk signals and relevant metadata for a single document - class SingleDocumentRiskSignal - attr_accessor :document_reference - - # Array of attributes that indicate whether or not there is fraud risk with a document - attr_accessor :risk_signals - - attr_accessor :risk_summary - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'document_reference' => :'document_reference', - :'risk_signals' => :'risk_signals', - :'risk_summary' => :'risk_summary' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'document_reference' => :'RiskSignalDocumentReference', - :'risk_signals' => :'Array', - :'risk_summary' => :'DocumentRiskSummary' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SingleDocumentRiskSignal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SingleDocumentRiskSignal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'document_reference') - self.document_reference = attributes[:'document_reference'] - end - - if attributes.key?(:'risk_signals') - if (value = attributes[:'risk_signals']).is_a?(Array) - self.risk_signals = value - end - end - - if attributes.key?(:'risk_summary') - self.risk_summary = attributes[:'risk_summary'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @document_reference.nil? - invalid_properties.push('invalid value for "document_reference", document_reference cannot be nil.') - end - - if @risk_signals.nil? - invalid_properties.push('invalid value for "risk_signals", risk_signals cannot be nil.') - end - - if @risk_summary.nil? - invalid_properties.push('invalid value for "risk_summary", risk_summary cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @document_reference.nil? - return false if @risk_signals.nil? - return false if @risk_summary.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - document_reference == o.document_reference && - risk_signals == o.risk_signals && - risk_summary == o.risk_summary - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [document_reference, risk_signals, risk_summary].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/source.rb b/lib/plaid/models/source.rb deleted file mode 100644 index 91928c770..000000000 --- a/lib/plaid/models/source.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class Source - DASHBOARD = "dashboard".freeze - LINK = "link".freeze - API = "api".freeze - SYSTEM = "system".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/standalone_account_type.rb b/lib/plaid/models/standalone_account_type.rb deleted file mode 100644 index 61a9b10c1..000000000 --- a/lib/plaid/models/standalone_account_type.rb +++ /dev/null @@ -1,286 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The schema below describes the various `types` and corresponding `subtypes` that Plaid recognizes and reports for financial institution accounts. - class StandaloneAccountType - # An account type holding cash, in which funds are deposited. Supported products for `depository` accounts are: Auth (`checking` and `savings` types only), Balance, Transactions, Identity, Payment Initiation, Assets, and Investments (`cash management` type only). - attr_accessor :depository - - # A credit card type account. Supported products for `credit` accounts are: Balance, Transactions, Identity, and Liabilities. - attr_accessor :credit - - # A loan type account. Supported products for `loan` accounts are: Balance, Liabilities, and Transactions. - attr_accessor :loan - - # An investment account. Supported products for `investment` accounts are: Balance and Investments. In API versions 2018-05-22 and earlier, this type is called `brokerage`. - attr_accessor :investment - - # Other or unknown account type. Supported products for `other` accounts are: Balance, Transactions, Identity, and Assets. - attr_accessor :other - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'depository' => :'depository', - :'credit' => :'credit', - :'loan' => :'loan', - :'investment' => :'investment', - :'other' => :'other' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'depository' => :'String', - :'credit' => :'String', - :'loan' => :'String', - :'investment' => :'String', - :'other' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::StandaloneAccountType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::StandaloneAccountType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'depository') - self.depository = attributes[:'depository'] - end - - if attributes.key?(:'credit') - self.credit = attributes[:'credit'] - end - - if attributes.key?(:'loan') - self.loan = attributes[:'loan'] - end - - if attributes.key?(:'investment') - self.investment = attributes[:'investment'] - end - - if attributes.key?(:'other') - self.other = attributes[:'other'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @depository.nil? - invalid_properties.push('invalid value for "depository", depository cannot be nil.') - end - - if @credit.nil? - invalid_properties.push('invalid value for "credit", credit cannot be nil.') - end - - if @loan.nil? - invalid_properties.push('invalid value for "loan", loan cannot be nil.') - end - - if @investment.nil? - invalid_properties.push('invalid value for "investment", investment cannot be nil.') - end - - if @other.nil? - invalid_properties.push('invalid value for "other", other cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @depository.nil? - return false if @credit.nil? - return false if @loan.nil? - return false if @investment.nil? - return false if @other.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - depository == o.depository && - credit == o.credit && - loan == o.loan && - investment == o.investment && - other == o.other - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [depository, credit, loan, investment, other].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/standalone_currency_code_list.rb b/lib/plaid/models/standalone_currency_code_list.rb deleted file mode 100644 index df52c9e7b..000000000 --- a/lib/plaid/models/standalone_currency_code_list.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The following currency codes are supported by Plaid. - class StandaloneCurrencyCodeList - # Plaid supports all ISO 4217 currency codes. - attr_accessor :iso_currency_code - - # List of unofficial currency codes - attr_accessor :unofficial_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::StandaloneCurrencyCodeList` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::StandaloneCurrencyCodeList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - if @unofficial_currency_code.nil? - invalid_properties.push('invalid value for "unofficial_currency_code", unofficial_currency_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @iso_currency_code.nil? - return false if @unofficial_currency_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [iso_currency_code, unofficial_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/standalone_investment_transaction_type.rb b/lib/plaid/models/standalone_investment_transaction_type.rb deleted file mode 100644 index 02a6937be..000000000 --- a/lib/plaid/models/standalone_investment_transaction_type.rb +++ /dev/null @@ -1,301 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Valid values for investment transaction types and subtypes. Note that transactions representing inflow of cash will appear as negative amounts, outflow of cash will appear as positive amounts. - class StandaloneInvestmentTransactionType - # Buying an investment - attr_accessor :buy - - # Selling an investment - attr_accessor :sell - - # A cancellation of a pending transaction - attr_accessor :cancel - - # Activity that modifies a cash position - attr_accessor :cash - - # Fees on the account, e.g. commission, bookkeeping, options-related. - attr_accessor :fee - - # Activity that modifies a position, but not through buy/sell activity e.g. options exercise, portfolio transfer - attr_accessor :transfer - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'buy' => :'buy', - :'sell' => :'sell', - :'cancel' => :'cancel', - :'cash' => :'cash', - :'fee' => :'fee', - :'transfer' => :'transfer' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'buy' => :'String', - :'sell' => :'String', - :'cancel' => :'String', - :'cash' => :'String', - :'fee' => :'String', - :'transfer' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::StandaloneInvestmentTransactionType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::StandaloneInvestmentTransactionType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'buy') - self.buy = attributes[:'buy'] - end - - if attributes.key?(:'sell') - self.sell = attributes[:'sell'] - end - - if attributes.key?(:'cancel') - self.cancel = attributes[:'cancel'] - end - - if attributes.key?(:'cash') - self.cash = attributes[:'cash'] - end - - if attributes.key?(:'fee') - self.fee = attributes[:'fee'] - end - - if attributes.key?(:'transfer') - self.transfer = attributes[:'transfer'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @buy.nil? - invalid_properties.push('invalid value for "buy", buy cannot be nil.') - end - - if @sell.nil? - invalid_properties.push('invalid value for "sell", sell cannot be nil.') - end - - if @cancel.nil? - invalid_properties.push('invalid value for "cancel", cancel cannot be nil.') - end - - if @cash.nil? - invalid_properties.push('invalid value for "cash", cash cannot be nil.') - end - - if @fee.nil? - invalid_properties.push('invalid value for "fee", fee cannot be nil.') - end - - if @transfer.nil? - invalid_properties.push('invalid value for "transfer", transfer cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @buy.nil? - return false if @sell.nil? - return false if @cancel.nil? - return false if @cash.nil? - return false if @fee.nil? - return false if @transfer.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - buy == o.buy && - sell == o.sell && - cancel == o.cancel && - cash == o.cash && - fee == o.fee && - transfer == o.transfer - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [buy, sell, cancel, cash, fee, transfer].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/statements_account.rb b/lib/plaid/models/statements_account.rb deleted file mode 100644 index 1c202bc6b..000000000 --- a/lib/plaid/models/statements_account.rb +++ /dev/null @@ -1,318 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Account associated with the Item. - class StatementsAccount - # Plaid's unique identifier for the account. - attr_accessor :account_id - - # 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. - attr_accessor :account_mask - - # The name of the account, either assigned by the user or by the financial institution itself. - attr_accessor :account_name - - # The official name of the account as given by the financial institution. - attr_accessor :account_official_name - - # The subtype of the account. For a full list of valid types and subtypes, see the [Account schema](https://plaid.com/docs/api/accounts#account-type-schema). - attr_accessor :account_subtype - - # The type of account. For a full list of valid types and subtypes, see the [Account schema](https://plaid.com/docs/api/accounts#account-type-schema). - attr_accessor :account_type - - # The list of statements' metadata associated with this account. - attr_accessor :statements - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'account_mask' => :'account_mask', - :'account_name' => :'account_name', - :'account_official_name' => :'account_official_name', - :'account_subtype' => :'account_subtype', - :'account_type' => :'account_type', - :'statements' => :'statements' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'account_mask' => :'String', - :'account_name' => :'String', - :'account_official_name' => :'String', - :'account_subtype' => :'String', - :'account_type' => :'String', - :'statements' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::StatementsAccount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::StatementsAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'account_mask') - self.account_mask = attributes[:'account_mask'] - end - - if attributes.key?(:'account_name') - self.account_name = attributes[:'account_name'] - end - - if attributes.key?(:'account_official_name') - self.account_official_name = attributes[:'account_official_name'] - end - - if attributes.key?(:'account_subtype') - self.account_subtype = attributes[:'account_subtype'] - end - - if attributes.key?(:'account_type') - self.account_type = attributes[:'account_type'] - end - - if attributes.key?(:'statements') - if (value = attributes[:'statements']).is_a?(Array) - self.statements = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @account_mask.nil? - invalid_properties.push('invalid value for "account_mask", account_mask cannot be nil.') - end - - if @account_name.nil? - invalid_properties.push('invalid value for "account_name", account_name cannot be nil.') - end - - if @account_official_name.nil? - invalid_properties.push('invalid value for "account_official_name", account_official_name cannot be nil.') - end - - if @account_subtype.nil? - invalid_properties.push('invalid value for "account_subtype", account_subtype cannot be nil.') - end - - if @account_type.nil? - invalid_properties.push('invalid value for "account_type", account_type cannot be nil.') - end - - if @statements.nil? - invalid_properties.push('invalid value for "statements", statements cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @account_mask.nil? - return false if @account_name.nil? - return false if @account_official_name.nil? - return false if @account_subtype.nil? - return false if @account_type.nil? - return false if @statements.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - account_mask == o.account_mask && - account_name == o.account_name && - account_official_name == o.account_official_name && - account_subtype == o.account_subtype && - account_type == o.account_type && - statements == o.statements - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, account_mask, account_name, account_official_name, account_subtype, account_type, statements].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/statements_download_request.rb b/lib/plaid/models/statements_download_request.rb deleted file mode 100644 index e475c8333..000000000 --- a/lib/plaid/models/statements_download_request.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # StatementsDownloadRequest defines the request schema for `/statements/download` - class StatementsDownloadRequest - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid's unique identifier for the statements. - attr_accessor :statement_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'access_token' => :'access_token', - :'client_id' => :'client_id', - :'secret' => :'secret', - :'statement_id' => :'statement_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'access_token' => :'String', - :'client_id' => :'String', - :'secret' => :'String', - :'statement_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::StatementsDownloadRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::StatementsDownloadRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'statement_id') - self.statement_id = attributes[:'statement_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @statement_id.nil? - invalid_properties.push('invalid value for "statement_id", statement_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @statement_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - access_token == o.access_token && - client_id == o.client_id && - secret == o.secret && - statement_id == o.statement_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [access_token, client_id, secret, statement_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/statements_list_request.rb b/lib/plaid/models/statements_list_request.rb deleted file mode 100644 index c49c8616b..000000000 --- a/lib/plaid/models/statements_list_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # StatementsListRequest defines the request schema for `/statements/list` - class StatementsListRequest - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'access_token' => :'access_token', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'access_token' => :'String', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::StatementsListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::StatementsListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - access_token == o.access_token && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [access_token, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/statements_list_response.rb b/lib/plaid/models/statements_list_response.rb deleted file mode 100644 index 8fcb89b48..000000000 --- a/lib/plaid/models/statements_list_response.rb +++ /dev/null @@ -1,287 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # StatementsListResponse defines the response schema for `/statements/list` - class StatementsListResponse - attr_accessor :accounts - - # The Plaid Institution ID associated with the Item. - attr_accessor :institution_id - - # The name of the institution associated with the Item. - attr_accessor :institution_name - - # 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. - attr_accessor :item_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'accounts' => :'accounts', - :'institution_id' => :'institution_id', - :'institution_name' => :'institution_name', - :'item_id' => :'item_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'accounts' => :'Array', - :'institution_id' => :'String', - :'institution_name' => :'String', - :'item_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::StatementsListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::StatementsListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - - if attributes.key?(:'institution_id') - self.institution_id = attributes[:'institution_id'] - end - - if attributes.key?(:'institution_name') - self.institution_name = attributes[:'institution_name'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @accounts.nil? - invalid_properties.push('invalid value for "accounts", accounts cannot be nil.') - end - - if @institution_id.nil? - invalid_properties.push('invalid value for "institution_id", institution_id cannot be nil.') - end - - if @institution_name.nil? - invalid_properties.push('invalid value for "institution_name", institution_name cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @accounts.nil? - return false if @institution_id.nil? - return false if @institution_name.nil? - return false if @item_id.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - accounts == o.accounts && - institution_id == o.institution_id && - institution_name == o.institution_name && - item_id == o.item_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [accounts, institution_id, institution_name, item_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/statements_refresh_complete_result.rb b/lib/plaid/models/statements_refresh_complete_result.rb deleted file mode 100644 index 176e7b54f..000000000 --- a/lib/plaid/models/statements_refresh_complete_result.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class StatementsRefreshCompleteResult - SUCCESS = "SUCCESS".freeze - FAILURE = "FAILURE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/statements_refresh_complete_webhook.rb b/lib/plaid/models/statements_refresh_complete_webhook.rb deleted file mode 100644 index 42ee45b64..000000000 --- a/lib/plaid/models/statements_refresh_complete_webhook.rb +++ /dev/null @@ -1,306 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when refreshed statements extraction is completed or failed to be completed. Triggered by calling `/statements/refresh`. - class StatementsRefreshCompleteWebhook - # `STATEMENTS` - attr_accessor :webhook_type - - # `STATEMENTS_REFRESH_COMPLETE` - attr_accessor :webhook_code - - # 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. - attr_accessor :item_id - - attr_accessor :result - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'result' => :'result', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'result' => :'StatementsRefreshCompleteResult', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::StatementsRefreshCompleteWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::StatementsRefreshCompleteWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'result') - self.result = attributes[:'result'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @result.nil? - invalid_properties.push('invalid value for "result", result cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @result.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - result == o.result && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, result, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/statements_refresh_request.rb b/lib/plaid/models/statements_refresh_request.rb deleted file mode 100644 index 57e6d8acc..000000000 --- a/lib/plaid/models/statements_refresh_request.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # StatementsRefreshRequest defines the request schema for `/statements/refresh` - class StatementsRefreshRequest - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The start date for statements, in “YYYY-MM-DD” format, e.g. \"2023-08-30\". To determine whether a statement falls within the specified date range, Plaid will use the statement posted date. The statement posted date is typically either the last day of the statement period, or the following day. - attr_accessor :start_date - - # The end date for statements, in “YYYY-MM-DD” format, e.g. \"2023-10-30\". You can request up to two years of data. To determine whether a statement falls within the specified date range, Plaid will use the statement posted date. The statement posted date is typically either the last day of the statement period, or the following day. - attr_accessor :end_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'access_token' => :'access_token', - :'client_id' => :'client_id', - :'secret' => :'secret', - :'start_date' => :'start_date', - :'end_date' => :'end_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'access_token' => :'String', - :'client_id' => :'String', - :'secret' => :'String', - :'start_date' => :'Date', - :'end_date' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::StatementsRefreshRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::StatementsRefreshRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @start_date.nil? - invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') - end - - if @end_date.nil? - invalid_properties.push('invalid value for "end_date", end_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @start_date.nil? - return false if @end_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - access_token == o.access_token && - client_id == o.client_id && - secret == o.secret && - start_date == o.start_date && - end_date == o.end_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [access_token, client_id, secret, start_date, end_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/statements_refresh_response.rb b/lib/plaid/models/statements_refresh_response.rb deleted file mode 100644 index 91602e2ae..000000000 --- a/lib/plaid/models/statements_refresh_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # StatementsRefreshResponse defines the response schema for `/statements/refresh` - class StatementsRefreshResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::StatementsRefreshResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::StatementsRefreshResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/statements_statement.rb b/lib/plaid/models/statements_statement.rb deleted file mode 100644 index a7275bfae..000000000 --- a/lib/plaid/models/statements_statement.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A statement's metadata associated with an account - class StatementsStatement - # Plaid's unique identifier for the statement. - attr_accessor :statement_id - - # Month of the year. Possible values: 1 through 12 (January through December). - attr_accessor :month - - # The year of statement. - attr_accessor :year - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'statement_id' => :'statement_id', - :'month' => :'month', - :'year' => :'year' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'statement_id' => :'String', - :'month' => :'Integer', - :'year' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::StatementsStatement` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::StatementsStatement`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'statement_id') - self.statement_id = attributes[:'statement_id'] - end - - if attributes.key?(:'month') - self.month = attributes[:'month'] - end - - if attributes.key?(:'year') - self.year = attributes[:'year'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @statement_id.nil? - invalid_properties.push('invalid value for "statement_id", statement_id cannot be nil.') - end - - if @month.nil? - invalid_properties.push('invalid value for "month", month cannot be nil.') - end - - if @year.nil? - invalid_properties.push('invalid value for "year", year cannot be nil.') - end - - if @year < 2010 - invalid_properties.push('invalid value for "year", must be greater than or equal to 2010.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @statement_id.nil? - return false if @month.nil? - return false if @year.nil? - return false if @year < 2010 - true - end - - # Custom attribute writer method with validation - # @param [Object] year Value to be assigned - def year=(year) - if year.nil? - fail ArgumentError, 'year cannot be nil' - end - - if year < 2010 - fail ArgumentError, 'invalid value for "year", must be greater than or equal to 2010.' - end - - - @year = year - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - statement_id == o.statement_id && - month == o.month && - year == o.year - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [statement_id, month, year].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/status.rb b/lib/plaid/models/status.rb deleted file mode 100644 index 55f60df9d..000000000 --- a/lib/plaid/models/status.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class Status - # Satus Code. - attr_accessor :status_code - - # Status Description. - attr_accessor :status_description - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status_code' => :'StatusCode', - :'status_description' => :'StatusDescription' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'status_code' => :'String', - :'status_description' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'status_code', - :'status_description' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Status` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Status`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status_code') - self.status_code = attributes[:'status_code'] - end - - if attributes.key?(:'status_description') - self.status_description = attributes[:'status_description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status_code == o.status_code && - status_description == o.status_description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status_code, status_description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/statuses.rb b/lib/plaid/models/statuses.rb deleted file mode 100644 index 850ff1b4d..000000000 --- a/lib/plaid/models/statuses.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A collection of STATUS containers. - class Statuses - attr_accessor :status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'STATUS' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'Status' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Statuses` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Statuses`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/strategy.rb b/lib/plaid/models/strategy.rb deleted file mode 100644 index 1fc0f8170..000000000 --- a/lib/plaid/models/strategy.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class Strategy - RESET = "reset".freeze - INCOMPLETE = "incomplete".freeze - INFER = "infer".freeze - CUSTOM = "custom".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/student_loan.rb b/lib/plaid/models/student_loan.rb deleted file mode 100644 index 5bf9d92aa..000000000 --- a/lib/plaid/models/student_loan.rb +++ /dev/null @@ -1,493 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Contains details about a student loan account - class StudentLoan - # The ID of the account that this liability belongs to. - attr_accessor :account_id - - # 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). - attr_accessor :account_number - - # The dates on which loaned funds were disbursed or will be disbursed. These are often in the past. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). - attr_accessor :disbursement_dates - - # The date when the student loan is expected to be paid off. Availability for this field is limited. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). - attr_accessor :expected_payoff_date - - # The guarantor of the student loan. - attr_accessor :guarantor - - # The interest rate on the loan as a percentage. - attr_accessor :interest_rate_percentage - - # `true` if a payment is currently overdue. Availability for this field is limited. - attr_accessor :is_overdue - - # The amount of the last payment. - attr_accessor :last_payment_amount - - # The date of the last payment. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). - attr_accessor :last_payment_date - - # The date of the last statement. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). - attr_accessor :last_statement_issue_date - - # The type of loan, e.g., \"Consolidation Loans\". - attr_accessor :loan_name - - attr_accessor :loan_status - - # 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`). Firstmark (`ins_116295` ) and Navient (`ins_116248`) will display as $0 if there is an autopay program in effect. - attr_accessor :minimum_payment_amount - - # The due date for the next payment. The due date is `null` if a payment is not expected. A payment is not expected if `loan_status.type` is `deferment`, `in_school`, `consolidated`, `paid in full`, or `transferred`. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). - attr_accessor :next_payment_due_date - - # The date on which the loan was initially lent. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). - attr_accessor :origination_date - - # The original principal balance of the loan. - attr_accessor :origination_principal_amount - - # The total dollar amount of the accrued interest balance. For Sallie Mae ( `ins_116944`), this amount is included in the current balance of the loan, so this field will return as `null`. - attr_accessor :outstanding_interest_amount - - # 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. - attr_accessor :payment_reference_number - - attr_accessor :pslf_status - - attr_accessor :repayment_plan - - # The sequence number of the student loan. Heartland ECSI (`ins_116948`) does not make this field available. - attr_accessor :sequence_number - - attr_accessor :servicer_address - - # The year to date (YTD) interest paid. Availability for this field is limited. - attr_accessor :ytd_interest_paid - - # The year to date (YTD) principal paid. Availability for this field is limited. - attr_accessor :ytd_principal_paid - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'account_number' => :'account_number', - :'disbursement_dates' => :'disbursement_dates', - :'expected_payoff_date' => :'expected_payoff_date', - :'guarantor' => :'guarantor', - :'interest_rate_percentage' => :'interest_rate_percentage', - :'is_overdue' => :'is_overdue', - :'last_payment_amount' => :'last_payment_amount', - :'last_payment_date' => :'last_payment_date', - :'last_statement_issue_date' => :'last_statement_issue_date', - :'loan_name' => :'loan_name', - :'loan_status' => :'loan_status', - :'minimum_payment_amount' => :'minimum_payment_amount', - :'next_payment_due_date' => :'next_payment_due_date', - :'origination_date' => :'origination_date', - :'origination_principal_amount' => :'origination_principal_amount', - :'outstanding_interest_amount' => :'outstanding_interest_amount', - :'payment_reference_number' => :'payment_reference_number', - :'pslf_status' => :'pslf_status', - :'repayment_plan' => :'repayment_plan', - :'sequence_number' => :'sequence_number', - :'servicer_address' => :'servicer_address', - :'ytd_interest_paid' => :'ytd_interest_paid', - :'ytd_principal_paid' => :'ytd_principal_paid' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'account_number' => :'String', - :'disbursement_dates' => :'Array', - :'expected_payoff_date' => :'Date', - :'guarantor' => :'String', - :'interest_rate_percentage' => :'Float', - :'is_overdue' => :'Boolean', - :'last_payment_amount' => :'Float', - :'last_payment_date' => :'Date', - :'last_statement_issue_date' => :'Date', - :'loan_name' => :'String', - :'loan_status' => :'StudentLoanStatus', - :'minimum_payment_amount' => :'Float', - :'next_payment_due_date' => :'Date', - :'origination_date' => :'Date', - :'origination_principal_amount' => :'Float', - :'outstanding_interest_amount' => :'Float', - :'payment_reference_number' => :'String', - :'pslf_status' => :'PSLFStatus', - :'repayment_plan' => :'StudentRepaymentPlan', - :'sequence_number' => :'String', - :'servicer_address' => :'ServicerAddressData', - :'ytd_interest_paid' => :'Float', - :'ytd_principal_paid' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_id', - :'account_number', - :'disbursement_dates', - :'expected_payoff_date', - :'guarantor', - :'is_overdue', - :'last_payment_amount', - :'last_payment_date', - :'last_statement_issue_date', - :'loan_name', - :'minimum_payment_amount', - :'next_payment_due_date', - :'origination_date', - :'origination_principal_amount', - :'outstanding_interest_amount', - :'payment_reference_number', - :'sequence_number', - :'ytd_interest_paid', - :'ytd_principal_paid' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::StudentLoan` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::StudentLoan`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'account_number') - self.account_number = attributes[:'account_number'] - end - - if attributes.key?(:'disbursement_dates') - if (value = attributes[:'disbursement_dates']).is_a?(Array) - self.disbursement_dates = value - end - end - - if attributes.key?(:'expected_payoff_date') - self.expected_payoff_date = attributes[:'expected_payoff_date'] - end - - if attributes.key?(:'guarantor') - self.guarantor = attributes[:'guarantor'] - end - - if attributes.key?(:'interest_rate_percentage') - self.interest_rate_percentage = attributes[:'interest_rate_percentage'] - end - - if attributes.key?(:'is_overdue') - self.is_overdue = attributes[:'is_overdue'] - end - - if attributes.key?(:'last_payment_amount') - self.last_payment_amount = attributes[:'last_payment_amount'] - end - - if attributes.key?(:'last_payment_date') - self.last_payment_date = attributes[:'last_payment_date'] - end - - if attributes.key?(:'last_statement_issue_date') - self.last_statement_issue_date = attributes[:'last_statement_issue_date'] - end - - if attributes.key?(:'loan_name') - self.loan_name = attributes[:'loan_name'] - end - - if attributes.key?(:'loan_status') - self.loan_status = attributes[:'loan_status'] - end - - if attributes.key?(:'minimum_payment_amount') - self.minimum_payment_amount = attributes[:'minimum_payment_amount'] - end - - if attributes.key?(:'next_payment_due_date') - self.next_payment_due_date = attributes[:'next_payment_due_date'] - end - - if attributes.key?(:'origination_date') - self.origination_date = attributes[:'origination_date'] - end - - if attributes.key?(:'origination_principal_amount') - self.origination_principal_amount = attributes[:'origination_principal_amount'] - end - - if attributes.key?(:'outstanding_interest_amount') - self.outstanding_interest_amount = attributes[:'outstanding_interest_amount'] - end - - if attributes.key?(:'payment_reference_number') - self.payment_reference_number = attributes[:'payment_reference_number'] - end - - if attributes.key?(:'pslf_status') - self.pslf_status = attributes[:'pslf_status'] - end - - if attributes.key?(:'repayment_plan') - self.repayment_plan = attributes[:'repayment_plan'] - end - - if attributes.key?(:'sequence_number') - self.sequence_number = attributes[:'sequence_number'] - end - - if attributes.key?(:'servicer_address') - self.servicer_address = attributes[:'servicer_address'] - end - - if attributes.key?(:'ytd_interest_paid') - self.ytd_interest_paid = attributes[:'ytd_interest_paid'] - end - - if attributes.key?(:'ytd_principal_paid') - self.ytd_principal_paid = attributes[:'ytd_principal_paid'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @interest_rate_percentage.nil? - invalid_properties.push('invalid value for "interest_rate_percentage", interest_rate_percentage cannot be nil.') - end - - if @loan_status.nil? - invalid_properties.push('invalid value for "loan_status", loan_status cannot be nil.') - end - - if @pslf_status.nil? - invalid_properties.push('invalid value for "pslf_status", pslf_status cannot be nil.') - end - - if @repayment_plan.nil? - invalid_properties.push('invalid value for "repayment_plan", repayment_plan cannot be nil.') - end - - if @servicer_address.nil? - invalid_properties.push('invalid value for "servicer_address", servicer_address cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @interest_rate_percentage.nil? - return false if @loan_status.nil? - return false if @pslf_status.nil? - return false if @repayment_plan.nil? - return false if @servicer_address.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - account_number == o.account_number && - disbursement_dates == o.disbursement_dates && - expected_payoff_date == o.expected_payoff_date && - guarantor == o.guarantor && - interest_rate_percentage == o.interest_rate_percentage && - is_overdue == o.is_overdue && - last_payment_amount == o.last_payment_amount && - last_payment_date == o.last_payment_date && - last_statement_issue_date == o.last_statement_issue_date && - loan_name == o.loan_name && - loan_status == o.loan_status && - minimum_payment_amount == o.minimum_payment_amount && - next_payment_due_date == o.next_payment_due_date && - origination_date == o.origination_date && - origination_principal_amount == o.origination_principal_amount && - outstanding_interest_amount == o.outstanding_interest_amount && - payment_reference_number == o.payment_reference_number && - pslf_status == o.pslf_status && - repayment_plan == o.repayment_plan && - sequence_number == o.sequence_number && - servicer_address == o.servicer_address && - ytd_interest_paid == o.ytd_interest_paid && - ytd_principal_paid == o.ytd_principal_paid - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, account_number, disbursement_dates, expected_payoff_date, guarantor, interest_rate_percentage, is_overdue, last_payment_amount, last_payment_date, last_statement_issue_date, loan_name, loan_status, minimum_payment_amount, next_payment_due_date, origination_date, origination_principal_amount, outstanding_interest_amount, payment_reference_number, pslf_status, repayment_plan, sequence_number, servicer_address, ytd_interest_paid, ytd_principal_paid].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/student_loan_repayment_model.rb b/lib/plaid/models/student_loan_repayment_model.rb deleted file mode 100644 index 88fea8e48..000000000 --- a/lib/plaid/models/student_loan_repayment_model.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Student loan repayment information used to configure Sandbox test data for the Liabilities product - class StudentLoanRepaymentModel - # The only currently supported value for this field is `standard`. - attr_accessor :type - - # Configures the number of months before repayment starts. - attr_accessor :non_repayment_months - - # Configures the number of months of repayments before the loan is paid off. - attr_accessor :repayment_months - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'non_repayment_months' => :'non_repayment_months', - :'repayment_months' => :'repayment_months' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'non_repayment_months' => :'Float', - :'repayment_months' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::StudentLoanRepaymentModel` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::StudentLoanRepaymentModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'non_repayment_months') - self.non_repayment_months = attributes[:'non_repayment_months'] - end - - if attributes.key?(:'repayment_months') - self.repayment_months = attributes[:'repayment_months'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @non_repayment_months.nil? - invalid_properties.push('invalid value for "non_repayment_months", non_repayment_months cannot be nil.') - end - - if @repayment_months.nil? - invalid_properties.push('invalid value for "repayment_months", repayment_months cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - return false if @non_repayment_months.nil? - return false if @repayment_months.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - non_repayment_months == o.non_repayment_months && - repayment_months == o.repayment_months - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, non_repayment_months, repayment_months].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/student_loan_status.rb b/lib/plaid/models/student_loan_status.rb deleted file mode 100644 index b09f8cde1..000000000 --- a/lib/plaid/models/student_loan_status.rb +++ /dev/null @@ -1,267 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing the status of the student loan - class StudentLoanStatus - # The date until which the loan will be in its current status. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DD). - attr_accessor :end_date - - # The status type of the student loan - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'end_date' => :'end_date', - :'type' => :'type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'end_date' => :'Date', - :'type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'end_date', - :'type' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::StudentLoanStatus` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::StudentLoanStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - type_validator = EnumAttributeValidator.new('String', ["cancelled", "charged off", "claim", "consolidated", "deferment", "delinquent", "discharged", "extension", "forbearance", "in grace", "in military", "in school", "not fully disbursed", "other", "paid in full", "refunded", "repayment", "transferred", "pending idr"]) - return false unless type_validator.valid?(@type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["cancelled", "charged off", "claim", "consolidated", "deferment", "delinquent", "discharged", "extension", "forbearance", "in grace", "in military", "in school", "not fully disbursed", "other", "paid in full", "refunded", "repayment", "transferred", "pending idr"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - end_date == o.end_date && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [end_date, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/student_repayment_plan.rb b/lib/plaid/models/student_repayment_plan.rb deleted file mode 100644 index 125d8bef1..000000000 --- a/lib/plaid/models/student_repayment_plan.rb +++ /dev/null @@ -1,267 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing the repayment plan for the student loan - class StudentRepaymentPlan - # The description of the repayment plan as provided by the servicer. - attr_accessor :description - - # The type of the repayment plan. - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'description' => :'description', - :'type' => :'type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'description' => :'String', - :'type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'description', - :'type' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::StudentRepaymentPlan` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::StudentRepaymentPlan`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - type_validator = EnumAttributeValidator.new('String', ["extended graduated", "extended standard", "graduated", "income-contingent repayment", "income-based repayment", "interest-only", "other", "pay as you earn", "revised pay as you earn", "standard", "saving on a valuable education", "null"]) - return false unless type_validator.valid?(@type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["extended graduated", "extended standard", "graduated", "income-contingent repayment", "income-based repayment", "interest-only", "other", "pay as you earn", "revised pay as you earn", "standard", "saving on a valuable education", "null"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - description == o.description && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [description, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/sweep_status.rb b/lib/plaid/models/sweep_status.rb deleted file mode 100644 index 70362d05e..000000000 --- a/lib/plaid/models/sweep_status.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class SweepStatus - PENDING = "pending".freeze - POSTED = "posted".freeze - SETTLED = "settled".freeze - RETURNED = "returned".freeze - FAILED = "failed".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/sweep_trigger.rb b/lib/plaid/models/sweep_trigger.rb deleted file mode 100644 index a4fa356e6..000000000 --- a/lib/plaid/models/sweep_trigger.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class SweepTrigger - MANUAL = "manual".freeze - INCOMING = "incoming".freeze - BALANCE_THRESHOLD = "balance_threshold".freeze - AUTOMATIC_AGGREGATE = "automatic_aggregate".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/sync_updates_available_webhook.rb b/lib/plaid/models/sync_updates_available_webhook.rb deleted file mode 100644 index 67ca12735..000000000 --- a/lib/plaid/models/sync_updates_available_webhook.rb +++ /dev/null @@ -1,322 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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`. 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`. - class SyncUpdatesAvailableWebhook - # `TRANSACTIONS` - attr_accessor :webhook_type - - # `SYNC_UPDATES_AVAILABLE` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - # Indicates if initial pull information (most recent 30 days of transaction history) is available. - attr_accessor :initial_update_complete - - # Indicates if historical pull information (maximum transaction history requested, up to 2 years) is available. - attr_accessor :historical_update_complete - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'initial_update_complete' => :'initial_update_complete', - :'historical_update_complete' => :'historical_update_complete', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'initial_update_complete' => :'Boolean', - :'historical_update_complete' => :'Boolean', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::SyncUpdatesAvailableWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::SyncUpdatesAvailableWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'initial_update_complete') - self.initial_update_complete = attributes[:'initial_update_complete'] - end - - if attributes.key?(:'historical_update_complete') - self.historical_update_complete = attributes[:'historical_update_complete'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @initial_update_complete.nil? - invalid_properties.push('invalid value for "initial_update_complete", initial_update_complete cannot be nil.') - end - - if @historical_update_complete.nil? - invalid_properties.push('invalid value for "historical_update_complete", historical_update_complete cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @initial_update_complete.nil? - return false if @historical_update_complete.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - initial_update_complete == o.initial_update_complete && - historical_update_complete == o.historical_update_complete && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, initial_update_complete, historical_update_complete, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/taxform.rb b/lib/plaid/models/taxform.rb deleted file mode 100644 index 1d543644b..000000000 --- a/lib/plaid/models/taxform.rb +++ /dev/null @@ -1,245 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data about an official document used to report the user's income to the IRS. - class Taxform - # An identifier of the document referenced by the document metadata. - attr_accessor :doc_id - - # The type of tax document. Currently, the only supported value is `w2`. - attr_accessor :document_type - - attr_accessor :w2 - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'doc_id' => :'doc_id', - :'document_type' => :'document_type', - :'w2' => :'w2' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'doc_id' => :'String', - :'document_type' => :'String', - :'w2' => :'W2' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Taxform` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Taxform`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'doc_id') - self.doc_id = attributes[:'doc_id'] - end - - if attributes.key?(:'document_type') - self.document_type = attributes[:'document_type'] - end - - if attributes.key?(:'w2') - self.w2 = attributes[:'w2'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @document_type.nil? - invalid_properties.push('invalid value for "document_type", document_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @document_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - doc_id == o.doc_id && - document_type == o.document_type && - w2 == o.w2 - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [doc_id, document_type, w2].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/taxpayer_id.rb b/lib/plaid/models/taxpayer_id.rb deleted file mode 100644 index e19701d64..000000000 --- a/lib/plaid/models/taxpayer_id.rb +++ /dev/null @@ -1,270 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Taxpayer ID of the individual receiving the paystub. - class TaxpayerID - # Type of ID, e.g. 'SSN' - attr_accessor :id_type - - # ID mask; i.e. last 4 digits of the taxpayer ID - attr_accessor :id_mask - - # Last 4 digits of unique number of ID. - attr_accessor :last_4_digits - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id_type' => :'id_type', - :'id_mask' => :'id_mask', - :'last_4_digits' => :'last_4_digits' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id_type' => :'String', - :'id_mask' => :'String', - :'last_4_digits' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'id_type', - :'id_mask', - :'last_4_digits' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TaxpayerID` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TaxpayerID`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id_type') - self.id_type = attributes[:'id_type'] - end - - if attributes.key?(:'id_mask') - self.id_mask = attributes[:'id_mask'] - end - - if attributes.key?(:'last_4_digits') - self.last_4_digits = attributes[:'last_4_digits'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@last_4_digits.nil? && @last_4_digits.to_s.length > 4 - invalid_properties.push('invalid value for "last_4_digits", the character length must be smaller than or equal to 4.') - end - - if !@last_4_digits.nil? && @last_4_digits.to_s.length < 4 - invalid_properties.push('invalid value for "last_4_digits", the character length must be great than or equal to 4.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@last_4_digits.nil? && @last_4_digits.to_s.length > 4 - return false if !@last_4_digits.nil? && @last_4_digits.to_s.length < 4 - true - end - - # Custom attribute writer method with validation - # @param [Object] last_4_digits Value to be assigned - def last_4_digits=(last_4_digits) - if !last_4_digits.nil? && last_4_digits.to_s.length > 4 - fail ArgumentError, 'invalid value for "last_4_digits", the character length must be smaller than or equal to 4.' - end - - if !last_4_digits.nil? && last_4_digits.to_s.length < 4 - fail ArgumentError, 'invalid value for "last_4_digits", the character length must be great than or equal to 4.' - end - - - @last_4_digits = last_4_digits - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id_type == o.id_type && - id_mask == o.id_mask && - last_4_digits == o.last_4_digits - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id_type, id_mask, last_4_digits].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/taxpayer_identifier.rb b/lib/plaid/models/taxpayer_identifier.rb deleted file mode 100644 index 2e1389176..000000000 --- a/lib/plaid/models/taxpayer_identifier.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class TaxpayerIdentifier - attr_accessor :taxpayer_identifier_type - - # The value of the taxpayer identifier as assigned by the IRS to the individual or legal entity. - attr_accessor :taxpayer_identifier_value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'taxpayer_identifier_type' => :'TaxpayerIdentifierType', - :'taxpayer_identifier_value' => :'TaxpayerIdentifierValue' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'taxpayer_identifier_type' => :'TaxpayerIdentifierType', - :'taxpayer_identifier_value' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'taxpayer_identifier_type', - :'taxpayer_identifier_value' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TaxpayerIdentifier` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TaxpayerIdentifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'taxpayer_identifier_type') - self.taxpayer_identifier_type = attributes[:'taxpayer_identifier_type'] - end - - if attributes.key?(:'taxpayer_identifier_value') - self.taxpayer_identifier_value = attributes[:'taxpayer_identifier_value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - taxpayer_identifier_type == o.taxpayer_identifier_type && - taxpayer_identifier_value == o.taxpayer_identifier_value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [taxpayer_identifier_type, taxpayer_identifier_value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/taxpayer_identifier_type.rb b/lib/plaid/models/taxpayer_identifier_type.rb deleted file mode 100644 index 93c11bec2..000000000 --- a/lib/plaid/models/taxpayer_identifier_type.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TaxpayerIdentifierType - INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER = "IndividualTaxpayerIdentificationNumber".freeze - SOCIAL_SECURITY_NUMBER = "SocialSecurityNumber".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/taxpayer_identifiers.rb b/lib/plaid/models/taxpayer_identifiers.rb deleted file mode 100644 index 790fcb5a0..000000000 --- a/lib/plaid/models/taxpayer_identifiers.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The collection of TAXPAYER_IDENTIFICATION elements - class TaxpayerIdentifiers - attr_accessor :taxpayer_identifier - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'taxpayer_identifier' => :'TAXPAYER_IDENTIFIER' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'taxpayer_identifier' => :'TaxpayerIdentifier' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TaxpayerIdentifiers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TaxpayerIdentifiers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'taxpayer_identifier') - self.taxpayer_identifier = attributes[:'taxpayer_identifier'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @taxpayer_identifier.nil? - invalid_properties.push('invalid value for "taxpayer_identifier", taxpayer_identifier cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @taxpayer_identifier.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - taxpayer_identifier == o.taxpayer_identifier - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [taxpayer_identifier].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/total.rb b/lib/plaid/models/total.rb deleted file mode 100644 index 9c7986a21..000000000 --- a/lib/plaid/models/total.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing both the current pay period and year to date amount for a category. - class Total - attr_accessor :canonical_description - - # Text of the line item as printed on the paystub. - attr_accessor :description - - attr_accessor :current_pay - - attr_accessor :ytd_pay - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'canonical_description' => :'canonical_description', - :'description' => :'description', - :'current_pay' => :'current_pay', - :'ytd_pay' => :'ytd_pay' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'canonical_description' => :'TotalCanonicalDescription', - :'description' => :'String', - :'current_pay' => :'Pay', - :'ytd_pay' => :'Pay' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'canonical_description', - :'description', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Total` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Total`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'canonical_description') - self.canonical_description = attributes[:'canonical_description'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'current_pay') - self.current_pay = attributes[:'current_pay'] - end - - if attributes.key?(:'ytd_pay') - self.ytd_pay = attributes[:'ytd_pay'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - canonical_description == o.canonical_description && - description == o.description && - current_pay == o.current_pay && - ytd_pay == o.ytd_pay - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [canonical_description, description, current_pay, ytd_pay].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/total_canonical_description.rb b/lib/plaid/models/total_canonical_description.rb deleted file mode 100644 index 5a05ca473..000000000 --- a/lib/plaid/models/total_canonical_description.rb +++ /dev/null @@ -1,54 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TotalCanonicalDescription - BONUS = "BONUS".freeze - COMMISSION = "COMMISSION".freeze - OVERTIME = "OVERTIME".freeze - PAID_TIME_OFF = "PAID TIME OFF".freeze - REGULAR_PAY = "REGULAR PAY".freeze - VACATION = "VACATION".freeze - EMPLOYEE_MEDICARE = "EMPLOYEE MEDICARE".freeze - FICA = "FICA".freeze - SOCIAL_SECURITY_EMPLOYEE_TAX = "SOCIAL SECURITY EMPLOYEE TAX".freeze - MEDICAL = "MEDICAL".freeze - VISION = "VISION".freeze - DENTAL = "DENTAL".freeze - NET_PAY = "NET PAY".freeze - TAXES = "TAXES".freeze - NOT_FOUND = "NOT_FOUND".freeze - OTHER = "OTHER".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transaction.rb b/lib/plaid/models/transaction.rb deleted file mode 100644 index 5b4f0a0f5..000000000 --- a/lib/plaid/models/transaction.rb +++ /dev/null @@ -1,617 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A representation of a transaction - class Transaction - # The ID of the account in which this transaction occurred. - attr_accessor :account_id - - # 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. - attr_accessor :amount - - # The ISO-4217 currency code of the transaction. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # 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 `iso_currency_code`s. - attr_accessor :unofficial_currency_code - - # 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). All Transactions implementations are recommended to use the new `personal_finance_category` instead of `category`, as it provides greater accuracy and more meaningful categorization. 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. - attr_accessor :category - - # 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). All Transactions implementations are recommended to use the new `personal_finance_category` instead of `category`, as it provides greater accuracy and more meaningful categorization. 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. - attr_accessor :category_id - - # The check number of the transaction. This field is only populated for check transactions. - attr_accessor :check_number - - # 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](https://wikipedia.org/wiki/ISO_8601) format ( `YYYY-MM-DD` ). To receive information about the date that a posted transaction was initiated, see the `authorized_date` field. - attr_accessor :date - - attr_accessor :location - - # The merchant name or transaction description. 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. - attr_accessor :name - - # The merchant name, as enriched by Plaid from the `name` field. This is typically a more human-readable version of the merchant counterparty in the transaction. For some bank transactions (such as checks or account transfers) where there is no meaningful merchant name, this value will be `null`. - attr_accessor :merchant_name - - # 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`. - attr_accessor :original_description - - attr_accessor :payment_meta - - # When `true`, identifies the transaction as pending or unsettled. Pending transaction details (name, type, amount, category ID) may change before they are settled. - attr_accessor :pending - - # The ID of a posted transaction's associated pending transaction, where applicable. - attr_accessor :pending_transaction_id - - # The name of the account owner. This field is not typically populated and only relevant when dealing with sub-accounts. - attr_accessor :account_owner - - # The unique ID of the transaction. Like all Plaid identifiers, the `transaction_id` is case sensitive. - attr_accessor :transaction_id - - # Please use the `payment_channel` field, `transaction_type` will be deprecated in the future. `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. - attr_accessor :transaction_type - - # The URL of a logo associated with this transaction, if available. The logo will always be 100×100 pixel PNG file. - attr_accessor :logo_url - - # The website associated with this transaction, if available. - attr_accessor :website - - # The date that the transaction was authorized. For posted transactions, the `date` field will indicate the posted date, but `authorized_date` will indicate the day the transaction was authorized by the financial institution. If presenting transactions to the user in a UI, the `authorized_date`, when available, is generally preferable to use over the `date` field for posted transactions, as it will generally represent the date the user actually made the transaction. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format ( `YYYY-MM-DD` ). - attr_accessor :authorized_date - - # Date and time when a transaction was authorized in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format ( `YYYY-MM-DDTHH:mm:ssZ` ). For posted transactions, the `datetime` field will indicate the posted date, but `authorized_datetime` will indicate the day the transaction was authorized by the financial institution. If presenting transactions to the user in a UI, the `authorized_datetime`, when available, is generally preferable to use over the `datetime` field for posted transactions, as it will generally represent the date the user actually made the transaction. 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. - attr_accessor :authorized_datetime - - # 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. - attr_accessor :datetime - - # 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. This field replaces the `transaction_type` field. - attr_accessor :payment_channel - - attr_accessor :personal_finance_category - - attr_accessor :transaction_code - - # The URL of an icon associated with the primary personal finance category. The icon will always be 100×100 pixel PNG file. - attr_accessor :personal_finance_category_icon_url - - # The counterparties present in the transaction. Counterparties, such as the merchant or the financial institution, are extracted by Plaid from the raw description. - attr_accessor :counterparties - - # A unique, stable, Plaid-generated ID that maps to the merchant. - attr_accessor :merchant_entity_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'category' => :'category', - :'category_id' => :'category_id', - :'check_number' => :'check_number', - :'date' => :'date', - :'location' => :'location', - :'name' => :'name', - :'merchant_name' => :'merchant_name', - :'original_description' => :'original_description', - :'payment_meta' => :'payment_meta', - :'pending' => :'pending', - :'pending_transaction_id' => :'pending_transaction_id', - :'account_owner' => :'account_owner', - :'transaction_id' => :'transaction_id', - :'transaction_type' => :'transaction_type', - :'logo_url' => :'logo_url', - :'website' => :'website', - :'authorized_date' => :'authorized_date', - :'authorized_datetime' => :'authorized_datetime', - :'datetime' => :'datetime', - :'payment_channel' => :'payment_channel', - :'personal_finance_category' => :'personal_finance_category', - :'transaction_code' => :'transaction_code', - :'personal_finance_category_icon_url' => :'personal_finance_category_icon_url', - :'counterparties' => :'counterparties', - :'merchant_entity_id' => :'merchant_entity_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'amount' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'category' => :'Array', - :'category_id' => :'String', - :'check_number' => :'String', - :'date' => :'Date', - :'location' => :'Location', - :'name' => :'String', - :'merchant_name' => :'String', - :'original_description' => :'String', - :'payment_meta' => :'PaymentMeta', - :'pending' => :'Boolean', - :'pending_transaction_id' => :'String', - :'account_owner' => :'String', - :'transaction_id' => :'String', - :'transaction_type' => :'String', - :'logo_url' => :'String', - :'website' => :'String', - :'authorized_date' => :'Date', - :'authorized_datetime' => :'Time', - :'datetime' => :'Time', - :'payment_channel' => :'String', - :'personal_finance_category' => :'PersonalFinanceCategory', - :'transaction_code' => :'TransactionCode', - :'personal_finance_category_icon_url' => :'String', - :'counterparties' => :'Array', - :'merchant_entity_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'iso_currency_code', - :'unofficial_currency_code', - :'category', - :'category_id', - :'check_number', - :'merchant_name', - :'original_description', - :'pending_transaction_id', - :'account_owner', - :'logo_url', - :'website', - :'authorized_date', - :'authorized_datetime', - :'datetime', - :'personal_finance_category', - :'transaction_code', - :'merchant_entity_id' - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'TransactionAllOf', - :'TransactionBase' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Transaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Transaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'category') - if (value = attributes[:'category']).is_a?(Array) - self.category = value - end - end - - if attributes.key?(:'category_id') - self.category_id = attributes[:'category_id'] - end - - if attributes.key?(:'check_number') - self.check_number = attributes[:'check_number'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'location') - self.location = attributes[:'location'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'merchant_name') - self.merchant_name = attributes[:'merchant_name'] - end - - if attributes.key?(:'original_description') - self.original_description = attributes[:'original_description'] - end - - if attributes.key?(:'payment_meta') - self.payment_meta = attributes[:'payment_meta'] - end - - if attributes.key?(:'pending') - self.pending = attributes[:'pending'] - end - - if attributes.key?(:'pending_transaction_id') - self.pending_transaction_id = attributes[:'pending_transaction_id'] - end - - if attributes.key?(:'account_owner') - self.account_owner = attributes[:'account_owner'] - end - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - - if attributes.key?(:'transaction_type') - self.transaction_type = attributes[:'transaction_type'] - end - - if attributes.key?(:'logo_url') - self.logo_url = attributes[:'logo_url'] - end - - if attributes.key?(:'website') - self.website = attributes[:'website'] - end - - if attributes.key?(:'authorized_date') - self.authorized_date = attributes[:'authorized_date'] - end - - if attributes.key?(:'authorized_datetime') - self.authorized_datetime = attributes[:'authorized_datetime'] - end - - if attributes.key?(:'datetime') - self.datetime = attributes[:'datetime'] - end - - if attributes.key?(:'payment_channel') - self.payment_channel = attributes[:'payment_channel'] - end - - if attributes.key?(:'personal_finance_category') - self.personal_finance_category = attributes[:'personal_finance_category'] - end - - if attributes.key?(:'transaction_code') - self.transaction_code = attributes[:'transaction_code'] - end - - if attributes.key?(:'personal_finance_category_icon_url') - self.personal_finance_category_icon_url = attributes[:'personal_finance_category_icon_url'] - end - - if attributes.key?(:'counterparties') - if (value = attributes[:'counterparties']).is_a?(Array) - self.counterparties = value - end - end - - if attributes.key?(:'merchant_entity_id') - self.merchant_entity_id = attributes[:'merchant_entity_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @date.nil? - invalid_properties.push('invalid value for "date", date cannot be nil.') - end - - if @location.nil? - invalid_properties.push('invalid value for "location", location cannot be nil.') - end - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @payment_meta.nil? - invalid_properties.push('invalid value for "payment_meta", payment_meta cannot be nil.') - end - - if @pending.nil? - invalid_properties.push('invalid value for "pending", pending cannot be nil.') - end - - if @transaction_id.nil? - invalid_properties.push('invalid value for "transaction_id", transaction_id cannot be nil.') - end - - if @payment_channel.nil? - invalid_properties.push('invalid value for "payment_channel", payment_channel cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @amount.nil? - return false if @date.nil? - return false if @location.nil? - return false if @name.nil? - return false if @payment_meta.nil? - return false if @pending.nil? - return false if @transaction_id.nil? - transaction_type_validator = EnumAttributeValidator.new('String', ["digital", "place", "special", "unresolved"]) - return false unless transaction_type_validator.valid?(@transaction_type) - return false if @payment_channel.nil? - payment_channel_validator = EnumAttributeValidator.new('String', ["online", "in store", "other"]) - return false unless payment_channel_validator.valid?(@payment_channel) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] transaction_type Object to be assigned - def transaction_type=(transaction_type) - validator = EnumAttributeValidator.new('String', ["digital", "place", "special", "unresolved"]) - unless validator.valid?(transaction_type) - fail ArgumentError, "invalid value for \"transaction_type\", must be one of #{validator.allowable_values}." - end - @transaction_type = transaction_type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] payment_channel Object to be assigned - def payment_channel=(payment_channel) - validator = EnumAttributeValidator.new('String', ["online", "in store", "other"]) - unless validator.valid?(payment_channel) - fail ArgumentError, "invalid value for \"payment_channel\", must be one of #{validator.allowable_values}." - end - @payment_channel = payment_channel - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - amount == o.amount && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - category == o.category && - category_id == o.category_id && - check_number == o.check_number && - date == o.date && - location == o.location && - name == o.name && - merchant_name == o.merchant_name && - original_description == o.original_description && - payment_meta == o.payment_meta && - pending == o.pending && - pending_transaction_id == o.pending_transaction_id && - account_owner == o.account_owner && - transaction_id == o.transaction_id && - transaction_type == o.transaction_type && - logo_url == o.logo_url && - website == o.website && - authorized_date == o.authorized_date && - authorized_datetime == o.authorized_datetime && - datetime == o.datetime && - payment_channel == o.payment_channel && - personal_finance_category == o.personal_finance_category && - transaction_code == o.transaction_code && - personal_finance_category_icon_url == o.personal_finance_category_icon_url && - counterparties == o.counterparties && - merchant_entity_id == o.merchant_entity_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, amount, iso_currency_code, unofficial_currency_code, category, category_id, check_number, date, location, name, merchant_name, original_description, payment_meta, pending, pending_transaction_id, account_owner, transaction_id, transaction_type, logo_url, website, authorized_date, authorized_datetime, datetime, payment_channel, personal_finance_category, transaction_code, personal_finance_category_icon_url, counterparties, merchant_entity_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transaction_all_of.rb b/lib/plaid/models/transaction_all_of.rb deleted file mode 100644 index 1567d0ed1..000000000 --- a/lib/plaid/models/transaction_all_of.rb +++ /dev/null @@ -1,345 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransactionAllOf - # The date that the transaction was authorized. For posted transactions, the `date` field will indicate the posted date, but `authorized_date` will indicate the day the transaction was authorized by the financial institution. If presenting transactions to the user in a UI, the `authorized_date`, when available, is generally preferable to use over the `date` field for posted transactions, as it will generally represent the date the user actually made the transaction. Dates are returned in an [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format ( `YYYY-MM-DD` ). - attr_accessor :authorized_date - - # Date and time when a transaction was authorized in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format ( `YYYY-MM-DDTHH:mm:ssZ` ). For posted transactions, the `datetime` field will indicate the posted date, but `authorized_datetime` will indicate the day the transaction was authorized by the financial institution. If presenting transactions to the user in a UI, the `authorized_datetime`, when available, is generally preferable to use over the `datetime` field for posted transactions, as it will generally represent the date the user actually made the transaction. 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. - attr_accessor :authorized_datetime - - # 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. - attr_accessor :datetime - - # 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. This field replaces the `transaction_type` field. - attr_accessor :payment_channel - - attr_accessor :personal_finance_category - - attr_accessor :transaction_code - - # The URL of an icon associated with the primary personal finance category. The icon will always be 100×100 pixel PNG file. - attr_accessor :personal_finance_category_icon_url - - # The counterparties present in the transaction. Counterparties, such as the merchant or the financial institution, are extracted by Plaid from the raw description. - attr_accessor :counterparties - - # A unique, stable, Plaid-generated ID that maps to the merchant. - attr_accessor :merchant_entity_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'authorized_date' => :'authorized_date', - :'authorized_datetime' => :'authorized_datetime', - :'datetime' => :'datetime', - :'payment_channel' => :'payment_channel', - :'personal_finance_category' => :'personal_finance_category', - :'transaction_code' => :'transaction_code', - :'personal_finance_category_icon_url' => :'personal_finance_category_icon_url', - :'counterparties' => :'counterparties', - :'merchant_entity_id' => :'merchant_entity_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'authorized_date' => :'Date', - :'authorized_datetime' => :'Time', - :'datetime' => :'Time', - :'payment_channel' => :'String', - :'personal_finance_category' => :'PersonalFinanceCategory', - :'transaction_code' => :'TransactionCode', - :'personal_finance_category_icon_url' => :'String', - :'counterparties' => :'Array', - :'merchant_entity_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'authorized_date', - :'authorized_datetime', - :'datetime', - :'personal_finance_category', - :'transaction_code', - :'merchant_entity_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'authorized_date') - self.authorized_date = attributes[:'authorized_date'] - end - - if attributes.key?(:'authorized_datetime') - self.authorized_datetime = attributes[:'authorized_datetime'] - end - - if attributes.key?(:'datetime') - self.datetime = attributes[:'datetime'] - end - - if attributes.key?(:'payment_channel') - self.payment_channel = attributes[:'payment_channel'] - end - - if attributes.key?(:'personal_finance_category') - self.personal_finance_category = attributes[:'personal_finance_category'] - end - - if attributes.key?(:'transaction_code') - self.transaction_code = attributes[:'transaction_code'] - end - - if attributes.key?(:'personal_finance_category_icon_url') - self.personal_finance_category_icon_url = attributes[:'personal_finance_category_icon_url'] - end - - if attributes.key?(:'counterparties') - if (value = attributes[:'counterparties']).is_a?(Array) - self.counterparties = value - end - end - - if attributes.key?(:'merchant_entity_id') - self.merchant_entity_id = attributes[:'merchant_entity_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @payment_channel.nil? - invalid_properties.push('invalid value for "payment_channel", payment_channel cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @payment_channel.nil? - payment_channel_validator = EnumAttributeValidator.new('String', ["online", "in store", "other"]) - return false unless payment_channel_validator.valid?(@payment_channel) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] payment_channel Object to be assigned - def payment_channel=(payment_channel) - validator = EnumAttributeValidator.new('String', ["online", "in store", "other"]) - unless validator.valid?(payment_channel) - fail ArgumentError, "invalid value for \"payment_channel\", must be one of #{validator.allowable_values}." - end - @payment_channel = payment_channel - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - authorized_date == o.authorized_date && - authorized_datetime == o.authorized_datetime && - datetime == o.datetime && - payment_channel == o.payment_channel && - personal_finance_category == o.personal_finance_category && - transaction_code == o.transaction_code && - personal_finance_category_icon_url == o.personal_finance_category_icon_url && - counterparties == o.counterparties && - merchant_entity_id == o.merchant_entity_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [authorized_date, authorized_datetime, datetime, payment_channel, personal_finance_category, transaction_code, personal_finance_category_icon_url, counterparties, merchant_entity_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transaction_base.rb b/lib/plaid/models/transaction_base.rb deleted file mode 100644 index cb74c178d..000000000 --- a/lib/plaid/models/transaction_base.rb +++ /dev/null @@ -1,481 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A representation of a transaction - class TransactionBase - # The ID of the account in which this transaction occurred. - attr_accessor :account_id - - # 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. - attr_accessor :amount - - # The ISO-4217 currency code of the transaction. Always `null` if `unofficial_currency_code` is non-null. - attr_accessor :iso_currency_code - - # 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 `iso_currency_code`s. - attr_accessor :unofficial_currency_code - - # 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). All Transactions implementations are recommended to use the new `personal_finance_category` instead of `category`, as it provides greater accuracy and more meaningful categorization. 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. - attr_accessor :category - - # 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). All Transactions implementations are recommended to use the new `personal_finance_category` instead of `category`, as it provides greater accuracy and more meaningful categorization. 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. - attr_accessor :category_id - - # The check number of the transaction. This field is only populated for check transactions. - attr_accessor :check_number - - # 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](https://wikipedia.org/wiki/ISO_8601) format ( `YYYY-MM-DD` ). To receive information about the date that a posted transaction was initiated, see the `authorized_date` field. - attr_accessor :date - - attr_accessor :location - - # The merchant name or transaction description. 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. - attr_accessor :name - - # The merchant name, as enriched by Plaid from the `name` field. This is typically a more human-readable version of the merchant counterparty in the transaction. For some bank transactions (such as checks or account transfers) where there is no meaningful merchant name, this value will be `null`. - attr_accessor :merchant_name - - # 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`. - attr_accessor :original_description - - attr_accessor :payment_meta - - # When `true`, identifies the transaction as pending or unsettled. Pending transaction details (name, type, amount, category ID) may change before they are settled. - attr_accessor :pending - - # The ID of a posted transaction's associated pending transaction, where applicable. - attr_accessor :pending_transaction_id - - # The name of the account owner. This field is not typically populated and only relevant when dealing with sub-accounts. - attr_accessor :account_owner - - # The unique ID of the transaction. Like all Plaid identifiers, the `transaction_id` is case sensitive. - attr_accessor :transaction_id - - # Please use the `payment_channel` field, `transaction_type` will be deprecated in the future. `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. - attr_accessor :transaction_type - - # The URL of a logo associated with this transaction, if available. The logo will always be 100×100 pixel PNG file. - attr_accessor :logo_url - - # The website associated with this transaction, if available. - attr_accessor :website - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code', - :'category' => :'category', - :'category_id' => :'category_id', - :'check_number' => :'check_number', - :'date' => :'date', - :'location' => :'location', - :'name' => :'name', - :'merchant_name' => :'merchant_name', - :'original_description' => :'original_description', - :'payment_meta' => :'payment_meta', - :'pending' => :'pending', - :'pending_transaction_id' => :'pending_transaction_id', - :'account_owner' => :'account_owner', - :'transaction_id' => :'transaction_id', - :'transaction_type' => :'transaction_type', - :'logo_url' => :'logo_url', - :'website' => :'website' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'amount' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String', - :'category' => :'Array', - :'category_id' => :'String', - :'check_number' => :'String', - :'date' => :'Date', - :'location' => :'Location', - :'name' => :'String', - :'merchant_name' => :'String', - :'original_description' => :'String', - :'payment_meta' => :'PaymentMeta', - :'pending' => :'Boolean', - :'pending_transaction_id' => :'String', - :'account_owner' => :'String', - :'transaction_id' => :'String', - :'transaction_type' => :'String', - :'logo_url' => :'String', - :'website' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'iso_currency_code', - :'unofficial_currency_code', - :'category', - :'category_id', - :'check_number', - :'merchant_name', - :'original_description', - :'pending_transaction_id', - :'account_owner', - :'logo_url', - :'website' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionBase` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - - if attributes.key?(:'category') - if (value = attributes[:'category']).is_a?(Array) - self.category = value - end - end - - if attributes.key?(:'category_id') - self.category_id = attributes[:'category_id'] - end - - if attributes.key?(:'check_number') - self.check_number = attributes[:'check_number'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'location') - self.location = attributes[:'location'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'merchant_name') - self.merchant_name = attributes[:'merchant_name'] - end - - if attributes.key?(:'original_description') - self.original_description = attributes[:'original_description'] - end - - if attributes.key?(:'payment_meta') - self.payment_meta = attributes[:'payment_meta'] - end - - if attributes.key?(:'pending') - self.pending = attributes[:'pending'] - end - - if attributes.key?(:'pending_transaction_id') - self.pending_transaction_id = attributes[:'pending_transaction_id'] - end - - if attributes.key?(:'account_owner') - self.account_owner = attributes[:'account_owner'] - end - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - - if attributes.key?(:'transaction_type') - self.transaction_type = attributes[:'transaction_type'] - end - - if attributes.key?(:'logo_url') - self.logo_url = attributes[:'logo_url'] - end - - if attributes.key?(:'website') - self.website = attributes[:'website'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @date.nil? - invalid_properties.push('invalid value for "date", date cannot be nil.') - end - - if @pending.nil? - invalid_properties.push('invalid value for "pending", pending cannot be nil.') - end - - if @transaction_id.nil? - invalid_properties.push('invalid value for "transaction_id", transaction_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @amount.nil? - return false if @date.nil? - return false if @pending.nil? - return false if @transaction_id.nil? - transaction_type_validator = EnumAttributeValidator.new('String', ["digital", "place", "special", "unresolved"]) - return false unless transaction_type_validator.valid?(@transaction_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] transaction_type Object to be assigned - def transaction_type=(transaction_type) - validator = EnumAttributeValidator.new('String', ["digital", "place", "special", "unresolved"]) - unless validator.valid?(transaction_type) - fail ArgumentError, "invalid value for \"transaction_type\", must be one of #{validator.allowable_values}." - end - @transaction_type = transaction_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - amount == o.amount && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code && - category == o.category && - category_id == o.category_id && - check_number == o.check_number && - date == o.date && - location == o.location && - name == o.name && - merchant_name == o.merchant_name && - original_description == o.original_description && - payment_meta == o.payment_meta && - pending == o.pending && - pending_transaction_id == o.pending_transaction_id && - account_owner == o.account_owner && - transaction_id == o.transaction_id && - transaction_type == o.transaction_type && - logo_url == o.logo_url && - website == o.website - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, amount, iso_currency_code, unofficial_currency_code, category, category_id, check_number, date, location, name, merchant_name, original_description, payment_meta, pending, pending_transaction_id, account_owner, transaction_id, transaction_type, logo_url, website].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transaction_code.rb b/lib/plaid/models/transaction_code.rb deleted file mode 100644 index 35c9e9a27..000000000 --- a/lib/plaid/models/transaction_code.rb +++ /dev/null @@ -1,50 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransactionCode - ADJUSTMENT = "adjustment".freeze - ATM = "atm".freeze - BANK_CHARGE = "bank charge".freeze - BILL_PAYMENT = "bill payment".freeze - CASH = "cash".freeze - CASHBACK = "cashback".freeze - CHEQUE = "cheque".freeze - DIRECT_DEBIT = "direct debit".freeze - INTEREST = "interest".freeze - PURCHASE = "purchase".freeze - STANDING_ORDER = "standing order".freeze - TRANSFER = "transfer".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transaction_counterparty.rb b/lib/plaid/models/transaction_counterparty.rb deleted file mode 100644 index 6e369036c..000000000 --- a/lib/plaid/models/transaction_counterparty.rb +++ /dev/null @@ -1,306 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The counterparty, such as the merchant or financial institution, is extracted by Plaid from the raw description. - class TransactionCounterparty - # The name of the counterparty, such as the merchant or the financial institution, as extracted by Plaid from the raw description. - attr_accessor :name - - # A unique, stable, Plaid-generated ID that maps to the counterparty. - attr_accessor :entity_id - - attr_accessor :type - - # The website associated with the counterparty. - attr_accessor :website - - # The URL of a logo associated with the counterparty, if available. The logo will always be 100×100 pixel PNG file. - attr_accessor :logo_url - - # A description of how confident we are that the provided counterparty is involved in the transaction. `VERY_HIGH`: We recognize this counterparty and we are more than 98% confident that it is involved in this transaction. `HIGH`: We recognize this counterparty and we are more than 90% confident that it is involved in this transaction. `MEDIUM`: We are moderately confident that this counterparty was involved in this transaction, but some details may differ from our records. `LOW`: We didn’t find a matching counterparty in our records, so we are returning a cleansed name parsed out of the request description. `UNKNOWN`: We don’t know the confidence level for this counterparty. - attr_accessor :confidence_level - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'entity_id' => :'entity_id', - :'type' => :'type', - :'website' => :'website', - :'logo_url' => :'logo_url', - :'confidence_level' => :'confidence_level' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'entity_id' => :'String', - :'type' => :'CounterpartyType', - :'website' => :'String', - :'logo_url' => :'String', - :'confidence_level' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'entity_id', - :'website', - :'logo_url', - :'confidence_level' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionCounterparty` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionCounterparty`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'entity_id') - self.entity_id = attributes[:'entity_id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'website') - self.website = attributes[:'website'] - end - - if attributes.key?(:'logo_url') - self.logo_url = attributes[:'logo_url'] - end - - if attributes.key?(:'confidence_level') - self.confidence_level = attributes[:'confidence_level'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - entity_id == o.entity_id && - type == o.type && - website == o.website && - logo_url == o.logo_url && - confidence_level == o.confidence_level - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, entity_id, type, website, logo_url, confidence_level].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transaction_data.rb b/lib/plaid/models/transaction_data.rb deleted file mode 100644 index d9d824b23..000000000 --- a/lib/plaid/models/transaction_data.rb +++ /dev/null @@ -1,286 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the matched direct deposit transaction used to verify a user's payroll information. - class TransactionData - # The description of the transaction. - attr_accessor :description - - # The amount of the transaction. - attr_accessor :amount - - # The date of the transaction, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (\"yyyy-mm-dd\"). - attr_accessor :date - - # A unique identifier for the end user's account. - attr_accessor :account_id - - # A unique identifier for the transaction. - attr_accessor :transaction_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'description' => :'description', - :'amount' => :'amount', - :'date' => :'date', - :'account_id' => :'account_id', - :'transaction_id' => :'transaction_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'description' => :'String', - :'amount' => :'Float', - :'date' => :'Date', - :'account_id' => :'String', - :'transaction_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionData` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @date.nil? - invalid_properties.push('invalid value for "date", date cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @transaction_id.nil? - invalid_properties.push('invalid value for "transaction_id", transaction_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @description.nil? - return false if @amount.nil? - return false if @date.nil? - return false if @account_id.nil? - return false if @transaction_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - description == o.description && - amount == o.amount && - date == o.date && - account_id == o.account_id && - transaction_id == o.transaction_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [description, amount, date, account_id, transaction_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transaction_override.rb b/lib/plaid/models/transaction_override.rb deleted file mode 100644 index 426f5fe62..000000000 --- a/lib/plaid/models/transaction_override.rb +++ /dev/null @@ -1,281 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data to populate as test transaction data. If not specified, random transactions will be generated instead. - class TransactionOverride - # The date of the transaction, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format. Transactions in Sandbox will move from pending to posted once their transaction date has been reached. If a `date_transacted` is not provided by the institution, a transaction date may be available in the [`authorized_date`](https://plaid.com/docs/api/products/transactions/#transactions-get-response-transactions-authorized-date) field. - attr_accessor :date_transacted - - # The date the transaction posted, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format. Posted dates in the past or present will result in posted transactions; posted dates in the future will result in pending transactions. - attr_accessor :date_posted - - # The transaction amount. Can be negative. - attr_accessor :amount - - # The transaction description. - attr_accessor :description - - # The ISO-4217 format currency code for the transaction. - attr_accessor :currency - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'date_transacted' => :'date_transacted', - :'date_posted' => :'date_posted', - :'amount' => :'amount', - :'description' => :'description', - :'currency' => :'currency' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'date_transacted' => :'Date', - :'date_posted' => :'Date', - :'amount' => :'Float', - :'description' => :'String', - :'currency' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionOverride` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionOverride`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'date_transacted') - self.date_transacted = attributes[:'date_transacted'] - end - - if attributes.key?(:'date_posted') - self.date_posted = attributes[:'date_posted'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'currency') - self.currency = attributes[:'currency'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @date_transacted.nil? - invalid_properties.push('invalid value for "date_transacted", date_transacted cannot be nil.') - end - - if @date_posted.nil? - invalid_properties.push('invalid value for "date_posted", date_posted cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @date_transacted.nil? - return false if @date_posted.nil? - return false if @amount.nil? - return false if @description.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - date_transacted == o.date_transacted && - date_posted == o.date_posted && - amount == o.amount && - description == o.description && - currency == o.currency - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [date_transacted, date_posted, amount, description, currency].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transaction_stream.rb b/lib/plaid/models/transaction_stream.rb deleted file mode 100644 index 376b344b1..000000000 --- a/lib/plaid/models/transaction_stream.rb +++ /dev/null @@ -1,474 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A grouping of related transactions - class TransactionStream - # The ID of the account to which the stream belongs - attr_accessor :account_id - - # A unique id for the stream - attr_accessor :stream_id - - # A hierarchical array of the categories to which this transaction belongs. See [Categories](https://plaid.com/docs/api/products/transactions/#categoriesget). All implementations are encouraged to use the new `personal_finance_category` instead of `category`. `personal_finance_category` provides more meaningful categorization and greater accuracy. - attr_accessor :category - - # The ID of the category to which this transaction belongs. See [Categories](https://plaid.com/docs/api/products/transactions/#categoriesget). All implementations are encouraged to use the new `personal_finance_category` instead of `category`. `personal_finance_category` provides more meaningful categorization and greater accuracy. - attr_accessor :category_id - - # A description of the transaction stream. - attr_accessor :description - - # The merchant associated with the transaction stream. - attr_accessor :merchant_name - - # The posted date of the earliest transaction in the stream. - attr_accessor :first_date - - # The posted date of the latest transaction in the stream. - attr_accessor :last_date - - attr_accessor :frequency - - # An array of Plaid transaction IDs belonging to the stream, sorted by posted date. - attr_accessor :transaction_ids - - attr_accessor :average_amount - - attr_accessor :last_amount - - # Indicates whether the transaction stream is still live. - attr_accessor :is_active - - attr_accessor :status - - attr_accessor :personal_finance_category - - # 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. - attr_accessor :is_user_modified - - # The date and time of the most recent user modification. This will only be set if `is_user_modified` is `true`. - attr_accessor :last_user_modified_datetime - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'account_id', - :'stream_id' => :'stream_id', - :'category' => :'category', - :'category_id' => :'category_id', - :'description' => :'description', - :'merchant_name' => :'merchant_name', - :'first_date' => :'first_date', - :'last_date' => :'last_date', - :'frequency' => :'frequency', - :'transaction_ids' => :'transaction_ids', - :'average_amount' => :'average_amount', - :'last_amount' => :'last_amount', - :'is_active' => :'is_active', - :'status' => :'status', - :'personal_finance_category' => :'personal_finance_category', - :'is_user_modified' => :'is_user_modified', - :'last_user_modified_datetime' => :'last_user_modified_datetime' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'stream_id' => :'String', - :'category' => :'Array', - :'category_id' => :'String', - :'description' => :'String', - :'merchant_name' => :'String', - :'first_date' => :'Date', - :'last_date' => :'Date', - :'frequency' => :'RecurringTransactionFrequency', - :'transaction_ids' => :'Array', - :'average_amount' => :'TransactionStreamAmount', - :'last_amount' => :'TransactionStreamAmount', - :'is_active' => :'Boolean', - :'status' => :'TransactionStreamStatus', - :'personal_finance_category' => :'PersonalFinanceCategory', - :'is_user_modified' => :'Boolean', - :'last_user_modified_datetime' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'merchant_name', - :'personal_finance_category', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionStream` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionStream`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'stream_id') - self.stream_id = attributes[:'stream_id'] - end - - if attributes.key?(:'category') - if (value = attributes[:'category']).is_a?(Array) - self.category = value - end - end - - if attributes.key?(:'category_id') - self.category_id = attributes[:'category_id'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'merchant_name') - self.merchant_name = attributes[:'merchant_name'] - end - - if attributes.key?(:'first_date') - self.first_date = attributes[:'first_date'] - end - - if attributes.key?(:'last_date') - self.last_date = attributes[:'last_date'] - end - - if attributes.key?(:'frequency') - self.frequency = attributes[:'frequency'] - end - - if attributes.key?(:'transaction_ids') - if (value = attributes[:'transaction_ids']).is_a?(Array) - self.transaction_ids = value - end - end - - if attributes.key?(:'average_amount') - self.average_amount = attributes[:'average_amount'] - end - - if attributes.key?(:'last_amount') - self.last_amount = attributes[:'last_amount'] - end - - if attributes.key?(:'is_active') - self.is_active = attributes[:'is_active'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'personal_finance_category') - self.personal_finance_category = attributes[:'personal_finance_category'] - end - - if attributes.key?(:'is_user_modified') - self.is_user_modified = attributes[:'is_user_modified'] - end - - if attributes.key?(:'last_user_modified_datetime') - self.last_user_modified_datetime = attributes[:'last_user_modified_datetime'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @stream_id.nil? - invalid_properties.push('invalid value for "stream_id", stream_id cannot be nil.') - end - - if @category.nil? - invalid_properties.push('invalid value for "category", category cannot be nil.') - end - - if @category_id.nil? - invalid_properties.push('invalid value for "category_id", category_id cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @first_date.nil? - invalid_properties.push('invalid value for "first_date", first_date cannot be nil.') - end - - if @last_date.nil? - invalid_properties.push('invalid value for "last_date", last_date cannot be nil.') - end - - if @frequency.nil? - invalid_properties.push('invalid value for "frequency", frequency cannot be nil.') - end - - if @transaction_ids.nil? - invalid_properties.push('invalid value for "transaction_ids", transaction_ids cannot be nil.') - end - - if @average_amount.nil? - invalid_properties.push('invalid value for "average_amount", average_amount cannot be nil.') - end - - if @last_amount.nil? - invalid_properties.push('invalid value for "last_amount", last_amount cannot be nil.') - end - - if @is_active.nil? - invalid_properties.push('invalid value for "is_active", is_active cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @is_user_modified.nil? - invalid_properties.push('invalid value for "is_user_modified", is_user_modified cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_id.nil? - return false if @stream_id.nil? - return false if @category.nil? - return false if @category_id.nil? - return false if @description.nil? - return false if @first_date.nil? - return false if @last_date.nil? - return false if @frequency.nil? - return false if @transaction_ids.nil? - return false if @average_amount.nil? - return false if @last_amount.nil? - return false if @is_active.nil? - return false if @status.nil? - return false if @is_user_modified.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - stream_id == o.stream_id && - category == o.category && - category_id == o.category_id && - description == o.description && - merchant_name == o.merchant_name && - first_date == o.first_date && - last_date == o.last_date && - frequency == o.frequency && - transaction_ids == o.transaction_ids && - average_amount == o.average_amount && - last_amount == o.last_amount && - is_active == o.is_active && - status == o.status && - personal_finance_category == o.personal_finance_category && - is_user_modified == o.is_user_modified && - last_user_modified_datetime == o.last_user_modified_datetime - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, stream_id, category, category_id, description, merchant_name, first_date, last_date, frequency, transaction_ids, average_amount, last_amount, is_active, status, personal_finance_category, is_user_modified, last_user_modified_datetime].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transaction_stream_amount.rb b/lib/plaid/models/transaction_stream_amount.rb deleted file mode 100644 index 73ad2e7a5..000000000 --- a/lib/plaid/models/transaction_stream_amount.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Object with data pertaining to an amount on the transaction stream. - class TransactionStreamAmount - # Represents the numerical value of an amount. - attr_accessor :amount - - # The ISO-4217 currency code of the amount. Always `null` if `unofficial_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 `iso_currency_code`s. - attr_accessor :iso_currency_code - - # The unofficial currency code of the amount. 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. - attr_accessor :unofficial_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code', - :'unofficial_currency_code' => :'unofficial_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'amount' => :'Float', - :'iso_currency_code' => :'String', - :'unofficial_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'iso_currency_code', - :'unofficial_currency_code' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionStreamAmount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionStreamAmount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'unofficial_currency_code') - self.unofficial_currency_code = attributes[:'unofficial_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - amount == o.amount && - iso_currency_code == o.iso_currency_code && - unofficial_currency_code == o.unofficial_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [amount, iso_currency_code, unofficial_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transaction_stream_status.rb b/lib/plaid/models/transaction_stream_status.rb deleted file mode 100644 index a5f38d342..000000000 --- a/lib/plaid/models/transaction_stream_status.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransactionStreamStatus - UNKNOWN = "UNKNOWN".freeze - MATURE = "MATURE".freeze - EARLY_DETECTION = "EARLY_DETECTION".freeze - TOMBSTONED = "TOMBSTONED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transactions_category_rule.rb b/lib/plaid/models/transactions_category_rule.rb deleted file mode 100644 index 74717eb55..000000000 --- a/lib/plaid/models/transactions_category_rule.rb +++ /dev/null @@ -1,260 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A representation of a transactions category rule. - class TransactionsCategoryRule - # A unique identifier of the rule created - attr_accessor :id - - # A unique identifier of the Item the rule was created for. - attr_accessor :item_id - - # Date and time when a rule was created in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format ( `YYYY-MM-DDTHH:mm:ssZ` ). - attr_accessor :created_at - - # Personal finance category unique identifier. In the personal finance category taxonomy, this field is represented by the detailed category field. - attr_accessor :personal_finance_category - - attr_accessor :rule_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'item_id' => :'item_id', - :'created_at' => :'created_at', - :'personal_finance_category' => :'personal_finance_category', - :'rule_details' => :'rule_details' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'item_id' => :'String', - :'created_at' => :'Time', - :'personal_finance_category' => :'String', - :'rule_details' => :'TransactionsRuleDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsCategoryRule` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsCategoryRule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'personal_finance_category') - self.personal_finance_category = attributes[:'personal_finance_category'] - end - - if attributes.key?(:'rule_details') - self.rule_details = attributes[:'rule_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - item_id == o.item_id && - created_at == o.created_at && - personal_finance_category == o.personal_finance_category && - rule_details == o.rule_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, item_id, created_at, personal_finance_category, rule_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_enhance_get_request.rb b/lib/plaid/models/transactions_enhance_get_request.rb deleted file mode 100644 index 5a035fd61..000000000 --- a/lib/plaid/models/transactions_enhance_get_request.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsEnhanceGetRequest defines the request schema for `/transactions/enhance`. - class TransactionsEnhanceGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The type of account for the requested transactions (`depository` or `credit`). - attr_accessor :account_type - - # An array of raw transactions to be enhanced. - attr_accessor :transactions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'account_type' => :'account_type', - :'transactions' => :'transactions' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'account_type' => :'String', - :'transactions' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsEnhanceGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsEnhanceGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'account_type') - self.account_type = attributes[:'account_type'] - end - - if attributes.key?(:'transactions') - if (value = attributes[:'transactions']).is_a?(Array) - self.transactions = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_type.nil? - invalid_properties.push('invalid value for "account_type", account_type cannot be nil.') - end - - if @transactions.nil? - invalid_properties.push('invalid value for "transactions", transactions cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_type.nil? - return false if @transactions.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - account_type == o.account_type && - transactions == o.transactions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, account_type, transactions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_enhance_get_response.rb b/lib/plaid/models/transactions_enhance_get_response.rb deleted file mode 100644 index d9e9992f1..000000000 --- a/lib/plaid/models/transactions_enhance_get_response.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsEnhanceGetResponse defines the response schema for `/beta/transactions/v1/enhance`. - class TransactionsEnhanceGetResponse - # An array of enhanced transactions. - attr_accessor :enhanced_transactions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'enhanced_transactions' => :'enhanced_transactions' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'enhanced_transactions' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsEnhanceGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsEnhanceGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'enhanced_transactions') - if (value = attributes[:'enhanced_transactions']).is_a?(Array) - self.enhanced_transactions = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @enhanced_transactions.nil? - invalid_properties.push('invalid value for "enhanced_transactions", enhanced_transactions cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @enhanced_transactions.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - enhanced_transactions == o.enhanced_transactions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [enhanced_transactions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_enrich_request.rb b/lib/plaid/models/transactions_enrich_request.rb deleted file mode 100644 index 999a21889..000000000 --- a/lib/plaid/models/transactions_enrich_request.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsEnrichRequest defines the request schema for `/transactions/enrich`. - class TransactionsEnrichRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The account type for the requested transactions (either `depository` or `credit`). - attr_accessor :account_type - - # An array of transaction objects to be enriched by Plaid. Maximum of 100 transactions per request. - attr_accessor :transactions - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'account_type' => :'account_type', - :'transactions' => :'transactions', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'account_type' => :'String', - :'transactions' => :'Array', - :'options' => :'TransactionsEnrichRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsEnrichRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsEnrichRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'account_type') - self.account_type = attributes[:'account_type'] - end - - if attributes.key?(:'transactions') - if (value = attributes[:'transactions']).is_a?(Array) - self.transactions = value - end - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_type.nil? - invalid_properties.push('invalid value for "account_type", account_type cannot be nil.') - end - - if @transactions.nil? - invalid_properties.push('invalid value for "transactions", transactions cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_type.nil? - return false if @transactions.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - account_type == o.account_type && - transactions == o.transactions && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, account_type, transactions, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_enrich_request_options.rb b/lib/plaid/models/transactions_enrich_request_options.rb deleted file mode 100644 index a2401c383..000000000 --- a/lib/plaid/models/transactions_enrich_request_options.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to be used with the request. - class TransactionsEnrichRequestOptions - # Include `legacy_category` and `legacy_category_id` in the response (in addition to the default `personal_finance_category`). Categories are based on Plaid's legacy taxonomy. For a full list of legacy categories, see [`/categories/get`](https://plaid.com/docs/api/products/transactions/#categoriesget). - attr_accessor :include_legacy_category - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'include_legacy_category' => :'include_legacy_category' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'include_legacy_category' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsEnrichRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsEnrichRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'include_legacy_category') - self.include_legacy_category = attributes[:'include_legacy_category'] - else - self.include_legacy_category = false - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - include_legacy_category == o.include_legacy_category - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [include_legacy_category].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_enrich_response.rb b/lib/plaid/models/transactions_enrich_response.rb deleted file mode 100644 index 5702920fb..000000000 --- a/lib/plaid/models/transactions_enrich_response.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsEnrichResponse defines the response schema for `/transactions/enrich`. - class TransactionsEnrichResponse - # A list of enriched transactions. - attr_accessor :enriched_transactions - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'enriched_transactions' => :'enriched_transactions', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'enriched_transactions' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsEnrichResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsEnrichResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'enriched_transactions') - if (value = attributes[:'enriched_transactions']).is_a?(Array) - self.enriched_transactions = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @enriched_transactions.nil? - invalid_properties.push('invalid value for "enriched_transactions", enriched_transactions cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @enriched_transactions.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - enriched_transactions == o.enriched_transactions && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [enriched_transactions, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_get_request.rb b/lib/plaid/models/transactions_get_request.rb deleted file mode 100644 index 4fee34835..000000000 --- a/lib/plaid/models/transactions_get_request.rb +++ /dev/null @@ -1,285 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsGetRequest defines the request schema for `/transactions/get` - class TransactionsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - attr_accessor :options - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The earliest date for which data should be returned. Dates should be formatted as YYYY-MM-DD. - attr_accessor :start_date - - # The latest date for which data should be returned. Dates should be formatted as YYYY-MM-DD. - attr_accessor :end_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'options' => :'options', - :'access_token' => :'access_token', - :'secret' => :'secret', - :'start_date' => :'start_date', - :'end_date' => :'end_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'options' => :'TransactionsGetRequestOptions', - :'access_token' => :'String', - :'secret' => :'String', - :'start_date' => :'Date', - :'end_date' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @start_date.nil? - invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') - end - - if @end_date.nil? - invalid_properties.push('invalid value for "end_date", end_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @start_date.nil? - return false if @end_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - options == o.options && - access_token == o.access_token && - secret == o.secret && - start_date == o.start_date && - end_date == o.end_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, options, access_token, secret, start_date, end_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_get_request_options.rb b/lib/plaid/models/transactions_get_request_options.rb deleted file mode 100644 index 306a3e507..000000000 --- a/lib/plaid/models/transactions_get_request_options.rb +++ /dev/null @@ -1,377 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to be used with the request. If specified, `options` must not be `null`. - class TransactionsGetRequestOptions - # 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. - attr_accessor :account_ids - - # The number of transactions to fetch. - attr_accessor :count - - # The number of transactions to skip. The default value is 0. - attr_accessor :offset - - # 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). - attr_accessor :include_original_description - - # Personal finance categories are now returned by default. - attr_accessor :include_personal_finance_category_beta - - # Personal finance categories are now returned by default. - attr_accessor :include_personal_finance_category - - # Counterparties and extra merchant fields are now returned by default. - attr_accessor :include_logo_and_counterparty_beta - - # 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. If Transactions has already been added to the Item prior to this call, this field will have no effect. 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. - attr_accessor :days_requested - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_ids' => :'account_ids', - :'count' => :'count', - :'offset' => :'offset', - :'include_original_description' => :'include_original_description', - :'include_personal_finance_category_beta' => :'include_personal_finance_category_beta', - :'include_personal_finance_category' => :'include_personal_finance_category', - :'include_logo_and_counterparty_beta' => :'include_logo_and_counterparty_beta', - :'days_requested' => :'days_requested' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_ids' => :'Array', - :'count' => :'Integer', - :'offset' => :'Integer', - :'include_original_description' => :'Boolean', - :'include_personal_finance_category_beta' => :'Boolean', - :'include_personal_finance_category' => :'Boolean', - :'include_logo_and_counterparty_beta' => :'Boolean', - :'days_requested' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'include_original_description', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_ids') - if (value = attributes[:'account_ids']).is_a?(Array) - self.account_ids = value - end - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 100 - end - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - else - self.offset = 0 - end - - if attributes.key?(:'include_original_description') - self.include_original_description = attributes[:'include_original_description'] - else - self.include_original_description = false - end - - if attributes.key?(:'include_personal_finance_category_beta') - self.include_personal_finance_category_beta = attributes[:'include_personal_finance_category_beta'] - else - self.include_personal_finance_category_beta = false - end - - if attributes.key?(:'include_personal_finance_category') - self.include_personal_finance_category = attributes[:'include_personal_finance_category'] - else - self.include_personal_finance_category = false - end - - if attributes.key?(:'include_logo_and_counterparty_beta') - self.include_logo_and_counterparty_beta = attributes[:'include_logo_and_counterparty_beta'] - else - self.include_logo_and_counterparty_beta = false - end - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - else - self.days_requested = 90 - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@count.nil? && @count > 500 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 500.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - if !@offset.nil? && @offset < 0 - invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.') - end - - - if !@days_requested.nil? && @days_requested > 730 - invalid_properties.push('invalid value for "days_requested", must be smaller than or equal to 730.') - end - - if !@days_requested.nil? && @days_requested < 1 - invalid_properties.push('invalid value for "days_requested", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@count.nil? && @count > 500 - return false if !@count.nil? && @count < 1 - return false if !@offset.nil? && @offset < 0 - return false if !@days_requested.nil? && @days_requested > 730 - return false if !@days_requested.nil? && @days_requested < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 500 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 500.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Custom attribute writer method with validation - # @param [Object] offset Value to be assigned - def offset=(offset) - if !offset.nil? && offset < 0 - fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.' - end - - - @offset = offset - end - - # Custom attribute writer method with validation - # @param [Object] days_requested Value to be assigned - def days_requested=(days_requested) - if !days_requested.nil? && days_requested > 730 - fail ArgumentError, 'invalid value for "days_requested", must be smaller than or equal to 730.' - end - - if !days_requested.nil? && days_requested < 1 - fail ArgumentError, 'invalid value for "days_requested", must be greater than or equal to 1.' - end - - - @days_requested = days_requested - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_ids == o.account_ids && - count == o.count && - offset == o.offset && - include_original_description == o.include_original_description && - include_personal_finance_category_beta == o.include_personal_finance_category_beta && - include_personal_finance_category == o.include_personal_finance_category && - include_logo_and_counterparty_beta == o.include_logo_and_counterparty_beta && - days_requested == o.days_requested - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_ids, count, offset, include_original_description, include_personal_finance_category_beta, include_personal_finance_category, include_logo_and_counterparty_beta, days_requested].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_get_response.rb b/lib/plaid/models/transactions_get_response.rb deleted file mode 100644 index 88b506a47..000000000 --- a/lib/plaid/models/transactions_get_response.rb +++ /dev/null @@ -1,289 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsGetResponse defines the response schema for `/transactions/get` - class 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. - attr_accessor :accounts - - # An array containing transactions from the account. Transactions are returned in reverse chronological order, with the most recent at the beginning of the array. The maximum number of transactions returned is determined by the `count` parameter. - attr_accessor :transactions - - # The total number of transactions available within the date range specified. If `total_transactions` is larger than the size of the `transactions` array, more transactions are available and can be fetched via manipulating the `offset` parameter. - attr_accessor :total_transactions - - attr_accessor :item - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'accounts' => :'accounts', - :'transactions' => :'transactions', - :'total_transactions' => :'total_transactions', - :'item' => :'item', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'accounts' => :'Array', - :'transactions' => :'Array', - :'total_transactions' => :'Integer', - :'item' => :'Item', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - - if attributes.key?(:'transactions') - if (value = attributes[:'transactions']).is_a?(Array) - self.transactions = value - end - end - - if attributes.key?(:'total_transactions') - self.total_transactions = attributes[:'total_transactions'] - end - - if attributes.key?(:'item') - self.item = attributes[:'item'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @accounts.nil? - invalid_properties.push('invalid value for "accounts", accounts cannot be nil.') - end - - if @transactions.nil? - invalid_properties.push('invalid value for "transactions", transactions cannot be nil.') - end - - if @total_transactions.nil? - invalid_properties.push('invalid value for "total_transactions", total_transactions cannot be nil.') - end - - if @item.nil? - invalid_properties.push('invalid value for "item", item cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @accounts.nil? - return false if @transactions.nil? - return false if @total_transactions.nil? - return false if @item.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - accounts == o.accounts && - transactions == o.transactions && - total_transactions == o.total_transactions && - item == o.item && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [accounts, transactions, total_transactions, item, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_recurring_create_input.rb b/lib/plaid/models/transactions_recurring_create_input.rb deleted file mode 100644 index f93e7d11c..000000000 --- a/lib/plaid/models/transactions_recurring_create_input.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRecurringCreateInput defines a single input to the `/transactions/recurring/streams/create` endpoint. - class TransactionsRecurringCreateInput - # IDs of all the transactions that will be merged into one stream. If any transaction currently exists in another stream, it will be removed from the other stream. - attr_accessor :transaction_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_ids' => :'transaction_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRecurringCreateInput` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRecurringCreateInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_ids') - if (value = attributes[:'transaction_ids']).is_a?(Array) - self.transaction_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_ids == o.transaction_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_recurring_create_request.rb b/lib/plaid/models/transactions_recurring_create_request.rb deleted file mode 100644 index 06e58cee3..000000000 --- a/lib/plaid/models/transactions_recurring_create_request.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRecurringCreateRequest defined the request schema for `/transactions/recurring/streams/create` endpoint. - class TransactionsRecurringCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A list of all the operations to be performed. This will either all succeed or all fail. - attr_accessor :inputs - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'access_token' => :'access_token', - :'secret' => :'secret', - :'inputs' => :'inputs' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'access_token' => :'String', - :'secret' => :'String', - :'inputs' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRecurringCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRecurringCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'inputs') - if (value = attributes[:'inputs']).is_a?(Array) - self.inputs = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @inputs.nil? - invalid_properties.push('invalid value for "inputs", inputs cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @inputs.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - access_token == o.access_token && - secret == o.secret && - inputs == o.inputs - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, access_token, secret, inputs].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_recurring_create_response.rb b/lib/plaid/models/transactions_recurring_create_response.rb deleted file mode 100644 index d468f0225..000000000 --- a/lib/plaid/models/transactions_recurring_create_response.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRecurringCreateResponse defines the response schema for the `/transactions/recurring/streams/create` endpoint. - class TransactionsRecurringCreateResponse - # Streams created as a result of the operation. - attr_accessor :added_streams - - # Other streams with transactions removed from them as a result of the operation (in no particular order). - attr_accessor :modified_streams - - # The ids of streams that are no longer qualified as recurring transaction streams (in no particular order). - attr_accessor :removed_stream_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'added_streams' => :'added_streams', - :'modified_streams' => :'modified_streams', - :'removed_stream_ids' => :'removed_stream_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'added_streams' => :'Array', - :'modified_streams' => :'Array', - :'removed_stream_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRecurringCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRecurringCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'added_streams') - if (value = attributes[:'added_streams']).is_a?(Array) - self.added_streams = value - end - end - - if attributes.key?(:'modified_streams') - if (value = attributes[:'modified_streams']).is_a?(Array) - self.modified_streams = value - end - end - - if attributes.key?(:'removed_stream_ids') - if (value = attributes[:'removed_stream_ids']).is_a?(Array) - self.removed_stream_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @added_streams.nil? - invalid_properties.push('invalid value for "added_streams", added_streams cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @added_streams.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - added_streams == o.added_streams && - modified_streams == o.modified_streams && - removed_stream_ids == o.removed_stream_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [added_streams, modified_streams, removed_stream_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_recurring_get_request.rb b/lib/plaid/models/transactions_recurring_get_request.rb deleted file mode 100644 index eccb47ad7..000000000 --- a/lib/plaid/models/transactions_recurring_get_request.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRecurringGetRequest defines the request schema for `/transactions/recurring/get` - class TransactionsRecurringGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - attr_accessor :options - - # 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. - attr_accessor :account_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'access_token' => :'access_token', - :'secret' => :'secret', - :'options' => :'options', - :'account_ids' => :'account_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'access_token' => :'String', - :'secret' => :'String', - :'options' => :'TransactionsRecurringGetRequestOptions', - :'account_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRecurringGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRecurringGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - - if attributes.key?(:'account_ids') - if (value = attributes[:'account_ids']).is_a?(Array) - self.account_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @account_ids.nil? - invalid_properties.push('invalid value for "account_ids", account_ids cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @account_ids.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - access_token == o.access_token && - secret == o.secret && - options == o.options && - account_ids == o.account_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, access_token, secret, options, account_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_recurring_get_request_options.rb b/lib/plaid/models/transactions_recurring_get_request_options.rb deleted file mode 100644 index 06432ae63..000000000 --- a/lib/plaid/models/transactions_recurring_get_request_options.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to be used with the request. If specified, `options` must not be `null`. - class TransactionsRecurringGetRequestOptions - # Personal finance categories are now returned by default. - attr_accessor :include_personal_finance_category - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'include_personal_finance_category' => :'include_personal_finance_category' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'include_personal_finance_category' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRecurringGetRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRecurringGetRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'include_personal_finance_category') - self.include_personal_finance_category = attributes[:'include_personal_finance_category'] - else - self.include_personal_finance_category = false - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - include_personal_finance_category == o.include_personal_finance_category - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [include_personal_finance_category].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_recurring_get_response.rb b/lib/plaid/models/transactions_recurring_get_response.rb deleted file mode 100644 index 41528e63f..000000000 --- a/lib/plaid/models/transactions_recurring_get_response.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRecurringGetResponse defines the response schema for `/transactions/recurring/get` - class TransactionsRecurringGetResponse - # An array of depository transaction streams. - attr_accessor :inflow_streams - - # An array of expense transaction streams. - attr_accessor :outflow_streams - - # Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (`YYYY-MM-DDTHH:mm:ssZ`) indicating the last time transaction streams for the given account were updated on - attr_accessor :updated_datetime - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'inflow_streams' => :'inflow_streams', - :'outflow_streams' => :'outflow_streams', - :'updated_datetime' => :'updated_datetime', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'inflow_streams' => :'Array', - :'outflow_streams' => :'Array', - :'updated_datetime' => :'Time', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRecurringGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRecurringGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'inflow_streams') - if (value = attributes[:'inflow_streams']).is_a?(Array) - self.inflow_streams = value - end - end - - if attributes.key?(:'outflow_streams') - if (value = attributes[:'outflow_streams']).is_a?(Array) - self.outflow_streams = value - end - end - - if attributes.key?(:'updated_datetime') - self.updated_datetime = attributes[:'updated_datetime'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @inflow_streams.nil? - invalid_properties.push('invalid value for "inflow_streams", inflow_streams cannot be nil.') - end - - if @outflow_streams.nil? - invalid_properties.push('invalid value for "outflow_streams", outflow_streams cannot be nil.') - end - - if @updated_datetime.nil? - invalid_properties.push('invalid value for "updated_datetime", updated_datetime cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @inflow_streams.nil? - return false if @outflow_streams.nil? - return false if @updated_datetime.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - inflow_streams == o.inflow_streams && - outflow_streams == o.outflow_streams && - updated_datetime == o.updated_datetime && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [inflow_streams, outflow_streams, updated_datetime, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_recurring_merge_input.rb b/lib/plaid/models/transactions_recurring_merge_input.rb deleted file mode 100644 index 4427295a4..000000000 --- a/lib/plaid/models/transactions_recurring_merge_input.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRecurringMergeInput defines a single input to the `/transactions/recurring/streams/merge` endpoint. - class TransactionsRecurringMergeInput - # IDs of all the streams that will be merged into the first stream. This operation will retain the stream_id of the first stream. - attr_accessor :stream_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'stream_ids' => :'stream_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'stream_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRecurringMergeInput` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRecurringMergeInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'stream_ids') - if (value = attributes[:'stream_ids']).is_a?(Array) - self.stream_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @stream_ids.nil? - invalid_properties.push('invalid value for "stream_ids", stream_ids cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @stream_ids.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - stream_ids == o.stream_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [stream_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_recurring_merge_request.rb b/lib/plaid/models/transactions_recurring_merge_request.rb deleted file mode 100644 index 53f7b37bb..000000000 --- a/lib/plaid/models/transactions_recurring_merge_request.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRecurringMergeRequest defined the request schema for `/transactions/recurring/streams/merge` endpoint. - class TransactionsRecurringMergeRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A list of all the operations to be performed. This will either all succeed or all fail. - attr_accessor :inputs - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'access_token' => :'access_token', - :'secret' => :'secret', - :'inputs' => :'inputs' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'access_token' => :'String', - :'secret' => :'String', - :'inputs' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRecurringMergeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRecurringMergeRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'inputs') - if (value = attributes[:'inputs']).is_a?(Array) - self.inputs = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @inputs.nil? - invalid_properties.push('invalid value for "inputs", inputs cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @inputs.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - access_token == o.access_token && - secret == o.secret && - inputs == o.inputs - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, access_token, secret, inputs].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_recurring_merge_response.rb b/lib/plaid/models/transactions_recurring_merge_response.rb deleted file mode 100644 index 17a8b65dd..000000000 --- a/lib/plaid/models/transactions_recurring_merge_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRecurringMergeResponse defines the response schema for the `/transactions/recurring/streams/merge` endpoint. - class TransactionsRecurringMergeResponse - # Directly modified stream, along with other streams with transactions removed from them as a result of the operation (in no particular order). - attr_accessor :modified_streams - - # The ids of streams that are no longer qualified as recurring transaction streams (in no particular order). - attr_accessor :removed_stream_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'modified_streams' => :'modified_streams', - :'removed_stream_ids' => :'removed_stream_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'modified_streams' => :'Array', - :'removed_stream_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRecurringMergeResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRecurringMergeResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'modified_streams') - if (value = attributes[:'modified_streams']).is_a?(Array) - self.modified_streams = value - end - end - - if attributes.key?(:'removed_stream_ids') - if (value = attributes[:'removed_stream_ids']).is_a?(Array) - self.removed_stream_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @modified_streams.nil? - invalid_properties.push('invalid value for "modified_streams", modified_streams cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @modified_streams.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - modified_streams == o.modified_streams && - removed_stream_ids == o.removed_stream_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [modified_streams, removed_stream_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_recurring_update_input.rb b/lib/plaid/models/transactions_recurring_update_input.rb deleted file mode 100644 index dd139c059..000000000 --- a/lib/plaid/models/transactions_recurring_update_input.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRecurringUpdateInput defines a single operation to the `/transactions/recurring/streams/update` endpoint. - class TransactionsRecurringUpdateInput - # ID of the stream that all the transactions will be added in to. - attr_accessor :stream_id - - # IDs of all the transactions that will be added into the stream. If any transaction currently exist in another stream, it will be removed from the other stream. - attr_accessor :transaction_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'stream_id' => :'stream_id', - :'transaction_ids' => :'transaction_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'stream_id' => :'String', - :'transaction_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRecurringUpdateInput` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRecurringUpdateInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'stream_id') - self.stream_id = attributes[:'stream_id'] - end - - if attributes.key?(:'transaction_ids') - if (value = attributes[:'transaction_ids']).is_a?(Array) - self.transaction_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @stream_id.nil? - invalid_properties.push('invalid value for "stream_id", stream_id cannot be nil.') - end - - if @transaction_ids.nil? - invalid_properties.push('invalid value for "transaction_ids", transaction_ids cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @stream_id.nil? - return false if @transaction_ids.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - stream_id == o.stream_id && - transaction_ids == o.transaction_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [stream_id, transaction_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_recurring_update_request.rb b/lib/plaid/models/transactions_recurring_update_request.rb deleted file mode 100644 index 328a17641..000000000 --- a/lib/plaid/models/transactions_recurring_update_request.rb +++ /dev/null @@ -1,263 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRecurringUpdateRequest defined the request schema for `/transactions/recurring/streams/update` endpoint. - class TransactionsRecurringUpdateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A list of all the operations to be performed. This will either all succeed or all fail. - attr_accessor :inputs - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'access_token' => :'access_token', - :'secret' => :'secret', - :'inputs' => :'inputs' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'access_token' => :'String', - :'secret' => :'String', - :'inputs' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRecurringUpdateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRecurringUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'inputs') - if (value = attributes[:'inputs']).is_a?(Array) - self.inputs = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @inputs.nil? - invalid_properties.push('invalid value for "inputs", inputs cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @inputs.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - access_token == o.access_token && - secret == o.secret && - inputs == o.inputs - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, access_token, secret, inputs].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_recurring_update_response.rb b/lib/plaid/models/transactions_recurring_update_response.rb deleted file mode 100644 index 363a7d4a2..000000000 --- a/lib/plaid/models/transactions_recurring_update_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRecurringUpdateResponse defines the response schema for the `/transactions/recurring/streams/update` endpoint. - class TransactionsRecurringUpdateResponse - # Directly modified stream, along with other streams with transactions removed from them as a result of the operation (in no particular order). - attr_accessor :modified_streams - - # The ids of streams that are no longer qualified as recurring transaction streams (in no particular order). - attr_accessor :removed_stream_ids - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'modified_streams' => :'modified_streams', - :'removed_stream_ids' => :'removed_stream_ids' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'modified_streams' => :'Array', - :'removed_stream_ids' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRecurringUpdateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRecurringUpdateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'modified_streams') - if (value = attributes[:'modified_streams']).is_a?(Array) - self.modified_streams = value - end - end - - if attributes.key?(:'removed_stream_ids') - if (value = attributes[:'removed_stream_ids']).is_a?(Array) - self.removed_stream_ids = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @modified_streams.nil? - invalid_properties.push('invalid value for "modified_streams", modified_streams cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @modified_streams.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - modified_streams == o.modified_streams && - removed_stream_ids == o.removed_stream_ids - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [modified_streams, removed_stream_ids].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_refresh_request.rb b/lib/plaid/models/transactions_refresh_request.rb deleted file mode 100644 index c2ee56249..000000000 --- a/lib/plaid/models/transactions_refresh_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRefreshRequest defines the request schema for `/transactions/refresh` - class TransactionsRefreshRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'access_token' => :'access_token', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'access_token' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRefreshRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRefreshRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - access_token == o.access_token && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, access_token, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_refresh_response.rb b/lib/plaid/models/transactions_refresh_response.rb deleted file mode 100644 index fb142fafc..000000000 --- a/lib/plaid/models/transactions_refresh_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRefreshResponse defines the response schema for `/transactions/refresh` - class TransactionsRefreshResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRefreshResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRefreshResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_removed_webhook.rb b/lib/plaid/models/transactions_removed_webhook.rb deleted file mode 100644 index 7e09f6319..000000000 --- a/lib/plaid/models/transactions_removed_webhook.rb +++ /dev/null @@ -1,319 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class TransactionsRemovedWebhook - # `TRANSACTIONS` - attr_accessor :webhook_type - - # `TRANSACTIONS_REMOVED` - attr_accessor :webhook_code - - attr_accessor :error - - # An array of `transaction_ids` corresponding to the removed transactions - attr_accessor :removed_transactions - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'error' => :'error', - :'removed_transactions' => :'removed_transactions', - :'item_id' => :'item_id', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'error' => :'PlaidError', - :'removed_transactions' => :'Array', - :'item_id' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRemovedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRemovedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'removed_transactions') - if (value = attributes[:'removed_transactions']).is_a?(Array) - self.removed_transactions = value - end - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @removed_transactions.nil? - invalid_properties.push('invalid value for "removed_transactions", removed_transactions cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @removed_transactions.nil? - return false if @item_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - error == o.error && - removed_transactions == o.removed_transactions && - item_id == o.item_id && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, error, removed_transactions, item_id, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_rule_details.rb b/lib/plaid/models/transactions_rule_details.rb deleted file mode 100644 index f43d44e25..000000000 --- a/lib/plaid/models/transactions_rule_details.rb +++ /dev/null @@ -1,276 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A representation of transactions rule details. - class TransactionsRuleDetails - attr_accessor :field - - attr_accessor :type - - # For TRANSACTION_ID field, provide transaction_id. For NAME field, provide a string pattern. - attr_accessor :query - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'field' => :'field', - :'type' => :'type', - :'query' => :'query' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'field' => :'TransactionsRuleField', - :'type' => :'TransactionsRuleType', - :'query' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRuleDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRuleDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'field') - self.field = attributes[:'field'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'query') - self.query = attributes[:'query'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @field.nil? - invalid_properties.push('invalid value for "field", field cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @query.nil? - invalid_properties.push('invalid value for "query", query cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @field.nil? - return false if @type.nil? - return false if @query.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - field == o.field && - type == o.type && - query == o.query - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [field, type, query].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_rule_field.rb b/lib/plaid/models/transactions_rule_field.rb deleted file mode 100644 index 3b63b6689..000000000 --- a/lib/plaid/models/transactions_rule_field.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransactionsRuleField - TRANSACTION_ID = "TRANSACTION_ID".freeze - NAME = "NAME".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transactions_rule_type.rb b/lib/plaid/models/transactions_rule_type.rb deleted file mode 100644 index 16fcff84f..000000000 --- a/lib/plaid/models/transactions_rule_type.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransactionsRuleType - EXACT_MATCH = "EXACT_MATCH".freeze - SUBSTRING_MATCH = "SUBSTRING_MATCH".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transactions_rules_create_request.rb b/lib/plaid/models/transactions_rules_create_request.rb deleted file mode 100644 index df50313e3..000000000 --- a/lib/plaid/models/transactions_rules_create_request.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRulesCreateRequest defines the request schema for `beta/transactions/rules/v1/create` - class TransactionsRulesCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Personal finance detailed category. All implementations are encouraged to use this field instead of `category`, as it provides more meaningful and accurate categorization. See the [`taxonomy csv file`](https://plaid.com/documents/transactions-personal-finance-category-taxonomy.csv) for a full list of personal finance categories. - attr_accessor :personal_finance_category - - attr_accessor :rule_details - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'access_token' => :'access_token', - :'secret' => :'secret', - :'personal_finance_category' => :'personal_finance_category', - :'rule_details' => :'rule_details' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'access_token' => :'String', - :'secret' => :'String', - :'personal_finance_category' => :'String', - :'rule_details' => :'TransactionsRuleDetails' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRulesCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRulesCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'personal_finance_category') - self.personal_finance_category = attributes[:'personal_finance_category'] - end - - if attributes.key?(:'rule_details') - self.rule_details = attributes[:'rule_details'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @personal_finance_category.nil? - invalid_properties.push('invalid value for "personal_finance_category", personal_finance_category cannot be nil.') - end - - if @rule_details.nil? - invalid_properties.push('invalid value for "rule_details", rule_details cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @personal_finance_category.nil? - return false if @rule_details.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - access_token == o.access_token && - secret == o.secret && - personal_finance_category == o.personal_finance_category && - rule_details == o.rule_details - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, access_token, secret, personal_finance_category, rule_details].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_rules_create_response.rb b/lib/plaid/models/transactions_rules_create_response.rb deleted file mode 100644 index 0d8b4472d..000000000 --- a/lib/plaid/models/transactions_rules_create_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRulesCreateResponse defines the response schema for `/beta/transactions/rules/v1/create` - class TransactionsRulesCreateResponse - attr_accessor :rule - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'rule' => :'rule', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'rule' => :'TransactionsCategoryRule', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRulesCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRulesCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'rule') - self.rule = attributes[:'rule'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @rule.nil? - invalid_properties.push('invalid value for "rule", rule cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @rule.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - rule == o.rule && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [rule, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_rules_list_request.rb b/lib/plaid/models/transactions_rules_list_request.rb deleted file mode 100644 index d9ba6d6df..000000000 --- a/lib/plaid/models/transactions_rules_list_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRulesListRequest defines the request schema for `/beta/transactions/rules/v1/list` - class TransactionsRulesListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'access_token' => :'access_token', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'access_token' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRulesListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRulesListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - access_token == o.access_token && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, access_token, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_rules_list_response.rb b/lib/plaid/models/transactions_rules_list_response.rb deleted file mode 100644 index de2b674a0..000000000 --- a/lib/plaid/models/transactions_rules_list_response.rb +++ /dev/null @@ -1,243 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRulesListResponse defines the response schema for `/beta/transactions/rules/v1/list` - class TransactionsRulesListResponse - # A list of the Item's transaction rules - attr_accessor :rules - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'rules' => :'rules', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'rules' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRulesListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRulesListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'rules') - if (value = attributes[:'rules']).is_a?(Array) - self.rules = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @rules.nil? - invalid_properties.push('invalid value for "rules", rules cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @rules.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - rules == o.rules && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [rules, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_rules_remove_request.rb b/lib/plaid/models/transactions_rules_remove_request.rb deleted file mode 100644 index c15ad6cc9..000000000 --- a/lib/plaid/models/transactions_rules_remove_request.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRulesRemoveRequest defines the request schema for `/beta/transactions/rules/v1/remove` - class TransactionsRulesRemoveRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A rule's unique identifier - attr_accessor :rule_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'access_token' => :'access_token', - :'secret' => :'secret', - :'rule_id' => :'rule_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'access_token' => :'String', - :'secret' => :'String', - :'rule_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRulesRemoveRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRulesRemoveRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'rule_id') - self.rule_id = attributes[:'rule_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @rule_id.nil? - invalid_properties.push('invalid value for "rule_id", rule_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @rule_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - access_token == o.access_token && - secret == o.secret && - rule_id == o.rule_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, access_token, secret, rule_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_rules_remove_response.rb b/lib/plaid/models/transactions_rules_remove_response.rb deleted file mode 100644 index 37029995e..000000000 --- a/lib/plaid/models/transactions_rules_remove_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsRulesRemoveResponse defines the response schema for `/beta/transactions/rules/v1/remove` - class TransactionsRulesRemoveResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsRulesRemoveResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsRulesRemoveResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_sync_request.rb b/lib/plaid/models/transactions_sync_request.rb deleted file mode 100644 index 944b1d3cc..000000000 --- a/lib/plaid/models/transactions_sync_request.rb +++ /dev/null @@ -1,303 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsSyncRequest defines the request schema for `/transactions/sync` - class TransactionsSyncRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The cursor value represents the last update requested. Providing it will cause the response to only return changes after this update. If omitted, the entire history of updates will be returned, starting with the first-added transactions on the Item. The cursor also accepts the special value of `\"now\"`, which can be used to fast-forward the cursor as part of migrating an existing Item from `/transactions/get` to `/transactions/sync`. For more information, see the [Transactions sync migration guide](https://plaid.com/docs/transactions/sync-migration/). Note that using the `\"now\"` value is not supported for any use case other than migrating existing Items from `/transactions/get`. The upper-bound length of this cursor is 256 characters of base64. - attr_accessor :cursor - - # The number of transaction updates to fetch. - attr_accessor :count - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'access_token' => :'access_token', - :'secret' => :'secret', - :'cursor' => :'cursor', - :'count' => :'count', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'access_token' => :'String', - :'secret' => :'String', - :'cursor' => :'String', - :'count' => :'Integer', - :'options' => :'TransactionsSyncRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsSyncRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsSyncRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 100 - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if !@count.nil? && @count > 500 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 500.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if !@count.nil? && @count > 500 - return false if !@count.nil? && @count < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 500 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 500.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - access_token == o.access_token && - secret == o.secret && - cursor == o.cursor && - count == o.count && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, access_token, secret, cursor, count, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_sync_request_options.rb b/lib/plaid/models/transactions_sync_request_options.rb deleted file mode 100644 index 2d890a18f..000000000 --- a/lib/plaid/models/transactions_sync_request_options.rb +++ /dev/null @@ -1,286 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An optional object to be used with the request. If specified, `options` must not be `null`. - class TransactionsSyncRequestOptions - # 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). - attr_accessor :include_original_description - - # Personal finance categories are now returned by default. - attr_accessor :include_personal_finance_category - - # Counterparties and extra merchant fields are now returned by default. - attr_accessor :include_logo_and_counterparty_beta - - # 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. If Transactions has already been added to the Item prior to this call, this field will have no effect. 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. - attr_accessor :days_requested - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'include_original_description' => :'include_original_description', - :'include_personal_finance_category' => :'include_personal_finance_category', - :'include_logo_and_counterparty_beta' => :'include_logo_and_counterparty_beta', - :'days_requested' => :'days_requested' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'include_original_description' => :'Boolean', - :'include_personal_finance_category' => :'Boolean', - :'include_logo_and_counterparty_beta' => :'Boolean', - :'days_requested' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'include_original_description', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsSyncRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsSyncRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'include_original_description') - self.include_original_description = attributes[:'include_original_description'] - else - self.include_original_description = false - end - - if attributes.key?(:'include_personal_finance_category') - self.include_personal_finance_category = attributes[:'include_personal_finance_category'] - else - self.include_personal_finance_category = false - end - - if attributes.key?(:'include_logo_and_counterparty_beta') - self.include_logo_and_counterparty_beta = attributes[:'include_logo_and_counterparty_beta'] - else - self.include_logo_and_counterparty_beta = false - end - - if attributes.key?(:'days_requested') - self.days_requested = attributes[:'days_requested'] - else - self.days_requested = 90 - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@days_requested.nil? && @days_requested > 730 - invalid_properties.push('invalid value for "days_requested", must be smaller than or equal to 730.') - end - - if !@days_requested.nil? && @days_requested < 1 - invalid_properties.push('invalid value for "days_requested", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@days_requested.nil? && @days_requested > 730 - return false if !@days_requested.nil? && @days_requested < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] days_requested Value to be assigned - def days_requested=(days_requested) - if !days_requested.nil? && days_requested > 730 - fail ArgumentError, 'invalid value for "days_requested", must be smaller than or equal to 730.' - end - - if !days_requested.nil? && days_requested < 1 - fail ArgumentError, 'invalid value for "days_requested", must be greater than or equal to 1.' - end - - - @days_requested = days_requested - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - include_original_description == o.include_original_description && - include_personal_finance_category == o.include_personal_finance_category && - include_logo_and_counterparty_beta == o.include_logo_and_counterparty_beta && - days_requested == o.days_requested - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [include_original_description, include_personal_finance_category, include_logo_and_counterparty_beta, days_requested].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_sync_response.rb b/lib/plaid/models/transactions_sync_response.rb deleted file mode 100644 index bad2905eb..000000000 --- a/lib/plaid/models/transactions_sync_response.rb +++ /dev/null @@ -1,307 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsSyncResponse defines the response schema for `/transactions/sync` - class TransactionsSyncResponse - # Transactions that have been added to the Item since `cursor` ordered by ascending last modified time. - attr_accessor :added - - # Transactions that have been modified on the Item since `cursor` ordered by ascending last modified time. - attr_accessor :modified - - # Transactions that have been removed from the Item since `cursor` ordered by ascending last modified time. - attr_accessor :removed - - # Cursor used for fetching any future updates after the latest update provided in this response. The cursor obtained after all pages have been pulled (indicated by `has_more` being `false`) will be valid for at least 1 year. This cursor should be persisted for later calls. If transactions are not yet available, this will be an empty string. - attr_accessor :next_cursor - - # Represents if more than requested count of transaction updates exist. If true, the additional updates can be fetched by making an additional request with `cursor` set to `next_cursor`. If `has_more` is true, it’s important to pull all available pages, to make it less likely for underlying data changes to conflict with pagination. - attr_accessor :has_more - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'added' => :'added', - :'modified' => :'modified', - :'removed' => :'removed', - :'next_cursor' => :'next_cursor', - :'has_more' => :'has_more', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'added' => :'Array', - :'modified' => :'Array', - :'removed' => :'Array', - :'next_cursor' => :'String', - :'has_more' => :'Boolean', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsSyncResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsSyncResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'added') - if (value = attributes[:'added']).is_a?(Array) - self.added = value - end - end - - if attributes.key?(:'modified') - if (value = attributes[:'modified']).is_a?(Array) - self.modified = value - end - end - - if attributes.key?(:'removed') - if (value = attributes[:'removed']).is_a?(Array) - self.removed = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'has_more') - self.has_more = attributes[:'has_more'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @added.nil? - invalid_properties.push('invalid value for "added", added cannot be nil.') - end - - if @modified.nil? - invalid_properties.push('invalid value for "modified", modified cannot be nil.') - end - - if @removed.nil? - invalid_properties.push('invalid value for "removed", removed cannot be nil.') - end - - if @next_cursor.nil? - invalid_properties.push('invalid value for "next_cursor", next_cursor cannot be nil.') - end - - if @has_more.nil? - invalid_properties.push('invalid value for "has_more", has_more cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @added.nil? - return false if @modified.nil? - return false if @removed.nil? - return false if @next_cursor.nil? - return false if @has_more.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - added == o.added && - modified == o.modified && - removed == o.removed && - next_cursor == o.next_cursor && - has_more == o.has_more && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [added, modified, removed, next_cursor, has_more, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_user_insights_get_request.rb b/lib/plaid/models/transactions_user_insights_get_request.rb deleted file mode 100644 index efb0c7334..000000000 --- a/lib/plaid/models/transactions_user_insights_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsUserInsightsGetRequest defines the request schema for `/beta/transactions/user_insights/v1/get`. - class TransactionsUserInsightsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A unique client-provided user_id to retrieve insights for. - attr_accessor :client_user_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'client_user_id' => :'client_user_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'client_user_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsUserInsightsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsUserInsightsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @client_user_id.nil? - invalid_properties.push('invalid value for "client_user_id", client_user_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @client_user_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - client_user_id == o.client_user_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, client_user_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transactions_user_insights_get_response.rb b/lib/plaid/models/transactions_user_insights_get_response.rb deleted file mode 100644 index 2684cea73..000000000 --- a/lib/plaid/models/transactions_user_insights_get_response.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # TransactionsUserInsightsGetResponse defines the response schema for `/beta/transactions/user_insights/v1/get`. - class TransactionsUserInsightsGetResponse - attr_accessor :user_data_overview - - attr_accessor :counterparty_insights - - attr_accessor :category_insights - - attr_accessor :recurring_transactions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_data_overview' => :'user_data_overview', - :'counterparty_insights' => :'counterparty_insights', - :'category_insights' => :'category_insights', - :'recurring_transactions' => :'recurring_transactions' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_data_overview' => :'UserDataOverview', - :'counterparty_insights' => :'CounterpartyInsights', - :'category_insights' => :'CategoryInsights', - :'recurring_transactions' => :'RecurringTransactions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransactionsUserInsightsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransactionsUserInsightsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_data_overview') - self.user_data_overview = attributes[:'user_data_overview'] - end - - if attributes.key?(:'counterparty_insights') - self.counterparty_insights = attributes[:'counterparty_insights'] - end - - if attributes.key?(:'category_insights') - self.category_insights = attributes[:'category_insights'] - end - - if attributes.key?(:'recurring_transactions') - self.recurring_transactions = attributes[:'recurring_transactions'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_data_overview.nil? - invalid_properties.push('invalid value for "user_data_overview", user_data_overview cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_data_overview.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_data_overview == o.user_data_overview && - counterparty_insights == o.counterparty_insights && - category_insights == o.category_insights && - recurring_transactions == o.recurring_transactions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_data_overview, counterparty_insights, category_insights, recurring_transactions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer.rb b/lib/plaid/models/transfer.rb deleted file mode 100644 index 8004df9f4..000000000 --- a/lib/plaid/models/transfer.rb +++ /dev/null @@ -1,630 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Represents a transfer within the Transfers API. - class Transfer - # Plaid’s unique identifier for a transfer. - attr_accessor :id - - # Plaid’s unique identifier for a transfer authorization. - attr_accessor :authorization_id - - attr_accessor :ach_class - - # The Plaid `account_id` corresponding to the end-user account that will be debited or credited. - attr_accessor :account_id - - # 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. - attr_accessor :funding_account_id - - attr_accessor :type - - attr_accessor :user - - # 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. - attr_accessor :amount - - # The description of the transfer. - attr_accessor :description - - # The datetime when this transfer was created. This will be of the form `2006-01-02T15:04:05Z` - attr_accessor :created - - attr_accessor :status - - attr_accessor :sweep_status - - attr_accessor :network - - attr_accessor :wire_details - - # When `true`, you can still cancel this transfer. - attr_accessor :cancellable - - attr_accessor :failure_reason - - # 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 - attr_accessor :metadata - - # Plaid’s unique identifier for the origination account that was used for this transfer. - attr_accessor :origination_account_id - - attr_accessor :guarantee_decision - - attr_accessor :guarantee_decision_rationale - - # The currency of the transfer amount, e.g. \"USD\" - attr_accessor :iso_currency_code - - # The date 3 business days from settlement date indicating the following ACH returns can no longer happen: R01, R02, R03, R29. This will be of the form YYYY-MM-DD. - attr_accessor :standard_return_window - - # 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. - attr_accessor :unauthorized_return_window - - # 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. - attr_accessor :expected_settlement_date - - # The Plaid client ID that is the originator of this transfer. Only present if created on behalf of another client as a [Platform customer](https://plaid.com/docs/transfer/application/#originators-vs-platforms). - attr_accessor :originator_client_id - - # A list of refunds associated with this transfer. - attr_accessor :refunds - - # The id of the recurring transfer if this transfer belongs to a recurring transfer. - attr_accessor :recurring_transfer_id - - # The expected sweep settlement schedule of this transfer, assuming this transfer is not `returned`. Only applies to ACH debit transfers. - attr_accessor :expected_sweep_settlement_schedule - - attr_accessor :credit_funds_source - - # The amount to deduct from `transfer.amount` and distribute to the platform’s Ledger balance as a facilitator fee (decimal string with two digits of precision e.g. \"10.00\"). The remainder will go to the end-customer’s Ledger balance. This must be less than or equal to the `transfer.amount`. - attr_accessor :facilitator_fee - - # 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. For `wire` transfers, this will be in the format of `/`. The field will remain null for transfers on other rails. - attr_accessor :network_trace_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'authorization_id' => :'authorization_id', - :'ach_class' => :'ach_class', - :'account_id' => :'account_id', - :'funding_account_id' => :'funding_account_id', - :'type' => :'type', - :'user' => :'user', - :'amount' => :'amount', - :'description' => :'description', - :'created' => :'created', - :'status' => :'status', - :'sweep_status' => :'sweep_status', - :'network' => :'network', - :'wire_details' => :'wire_details', - :'cancellable' => :'cancellable', - :'failure_reason' => :'failure_reason', - :'metadata' => :'metadata', - :'origination_account_id' => :'origination_account_id', - :'guarantee_decision' => :'guarantee_decision', - :'guarantee_decision_rationale' => :'guarantee_decision_rationale', - :'iso_currency_code' => :'iso_currency_code', - :'standard_return_window' => :'standard_return_window', - :'unauthorized_return_window' => :'unauthorized_return_window', - :'expected_settlement_date' => :'expected_settlement_date', - :'originator_client_id' => :'originator_client_id', - :'refunds' => :'refunds', - :'recurring_transfer_id' => :'recurring_transfer_id', - :'expected_sweep_settlement_schedule' => :'expected_sweep_settlement_schedule', - :'credit_funds_source' => :'credit_funds_source', - :'facilitator_fee' => :'facilitator_fee', - :'network_trace_id' => :'network_trace_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'authorization_id' => :'String', - :'ach_class' => :'ACHClass', - :'account_id' => :'String', - :'funding_account_id' => :'String', - :'type' => :'TransferType', - :'user' => :'TransferUserInResponse', - :'amount' => :'String', - :'description' => :'String', - :'created' => :'Time', - :'status' => :'TransferStatus', - :'sweep_status' => :'TransferSweepStatus', - :'network' => :'TransferNetwork', - :'wire_details' => :'TransferWireDetails', - :'cancellable' => :'Boolean', - :'failure_reason' => :'TransferFailure', - :'metadata' => :'Hash', - :'origination_account_id' => :'String', - :'guarantee_decision' => :'TransferAuthorizationGuaranteeDecision', - :'guarantee_decision_rationale' => :'TransferAuthorizationGuaranteeDecisionRationale', - :'iso_currency_code' => :'String', - :'standard_return_window' => :'Date', - :'unauthorized_return_window' => :'Date', - :'expected_settlement_date' => :'Date', - :'originator_client_id' => :'String', - :'refunds' => :'Array', - :'recurring_transfer_id' => :'String', - :'expected_sweep_settlement_schedule' => :'Array', - :'credit_funds_source' => :'TransferCreditFundsSource', - :'facilitator_fee' => :'String', - :'network_trace_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'funding_account_id', - :'sweep_status', - :'wire_details', - :'failure_reason', - :'metadata', - :'guarantee_decision', - :'guarantee_decision_rationale', - :'standard_return_window', - :'unauthorized_return_window', - :'expected_settlement_date', - :'originator_client_id', - :'recurring_transfer_id', - :'network_trace_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Transfer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Transfer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'authorization_id') - self.authorization_id = attributes[:'authorization_id'] - end - - if attributes.key?(:'ach_class') - self.ach_class = attributes[:'ach_class'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'created') - self.created = attributes[:'created'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'sweep_status') - self.sweep_status = attributes[:'sweep_status'] - end - - if attributes.key?(:'network') - self.network = attributes[:'network'] - end - - if attributes.key?(:'wire_details') - self.wire_details = attributes[:'wire_details'] - end - - if attributes.key?(:'cancellable') - self.cancellable = attributes[:'cancellable'] - end - - if attributes.key?(:'failure_reason') - self.failure_reason = attributes[:'failure_reason'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Hash) - self.metadata = value - end - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'guarantee_decision') - self.guarantee_decision = attributes[:'guarantee_decision'] - end - - if attributes.key?(:'guarantee_decision_rationale') - self.guarantee_decision_rationale = attributes[:'guarantee_decision_rationale'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'standard_return_window') - self.standard_return_window = attributes[:'standard_return_window'] - end - - if attributes.key?(:'unauthorized_return_window') - self.unauthorized_return_window = attributes[:'unauthorized_return_window'] - end - - if attributes.key?(:'expected_settlement_date') - self.expected_settlement_date = attributes[:'expected_settlement_date'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - - if attributes.key?(:'refunds') - if (value = attributes[:'refunds']).is_a?(Array) - self.refunds = value - end - end - - if attributes.key?(:'recurring_transfer_id') - self.recurring_transfer_id = attributes[:'recurring_transfer_id'] - end - - if attributes.key?(:'expected_sweep_settlement_schedule') - if (value = attributes[:'expected_sweep_settlement_schedule']).is_a?(Array) - self.expected_sweep_settlement_schedule = value - end - end - - if attributes.key?(:'credit_funds_source') - self.credit_funds_source = attributes[:'credit_funds_source'] - end - - if attributes.key?(:'facilitator_fee') - self.facilitator_fee = attributes[:'facilitator_fee'] - end - - if attributes.key?(:'network_trace_id') - self.network_trace_id = attributes[:'network_trace_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @authorization_id.nil? - invalid_properties.push('invalid value for "authorization_id", authorization_id cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @created.nil? - invalid_properties.push('invalid value for "created", created cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @network.nil? - invalid_properties.push('invalid value for "network", network cannot be nil.') - end - - if @cancellable.nil? - invalid_properties.push('invalid value for "cancellable", cancellable cannot be nil.') - end - - - if @origination_account_id.nil? - invalid_properties.push('invalid value for "origination_account_id", origination_account_id cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - if @refunds.nil? - invalid_properties.push('invalid value for "refunds", refunds cannot be nil.') - end - - if @credit_funds_source.nil? - invalid_properties.push('invalid value for "credit_funds_source", credit_funds_source cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @authorization_id.nil? - return false if @type.nil? - return false if @user.nil? - return false if @amount.nil? - return false if @description.nil? - return false if @created.nil? - return false if @status.nil? - return false if @network.nil? - return false if @cancellable.nil? - return false if @metadata.length > 50 - return false if @origination_account_id.nil? - return false if @iso_currency_code.nil? - return false if @refunds.nil? - return false if @credit_funds_source.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] metadata Value to be assigned - def metadata=(metadata) - - @metadata = metadata - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - authorization_id == o.authorization_id && - ach_class == o.ach_class && - account_id == o.account_id && - funding_account_id == o.funding_account_id && - type == o.type && - user == o.user && - amount == o.amount && - description == o.description && - created == o.created && - status == o.status && - sweep_status == o.sweep_status && - network == o.network && - wire_details == o.wire_details && - cancellable == o.cancellable && - failure_reason == o.failure_reason && - metadata == o.metadata && - origination_account_id == o.origination_account_id && - guarantee_decision == o.guarantee_decision && - guarantee_decision_rationale == o.guarantee_decision_rationale && - iso_currency_code == o.iso_currency_code && - standard_return_window == o.standard_return_window && - unauthorized_return_window == o.unauthorized_return_window && - expected_settlement_date == o.expected_settlement_date && - originator_client_id == o.originator_client_id && - refunds == o.refunds && - recurring_transfer_id == o.recurring_transfer_id && - expected_sweep_settlement_schedule == o.expected_sweep_settlement_schedule && - credit_funds_source == o.credit_funds_source && - facilitator_fee == o.facilitator_fee && - network_trace_id == o.network_trace_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, authorization_id, ach_class, account_id, funding_account_id, type, user, amount, description, created, status, sweep_status, network, wire_details, cancellable, failure_reason, metadata, origination_account_id, guarantee_decision, guarantee_decision_rationale, iso_currency_code, standard_return_window, unauthorized_return_window, expected_settlement_date, originator_client_id, refunds, recurring_transfer_id, expected_sweep_settlement_schedule, credit_funds_source, facilitator_fee, network_trace_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_ach_network.rb b/lib/plaid/models/transfer_ach_network.rb deleted file mode 100644 index 1e1b9d492..000000000 --- a/lib/plaid/models/transfer_ach_network.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferACHNetwork - ACH = "ach".freeze - SAME_DAY_ACH = "same-day-ach".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_authorization.rb b/lib/plaid/models/transfer_authorization.rb deleted file mode 100644 index 634a5bda7..000000000 --- a/lib/plaid/models/transfer_authorization.rb +++ /dev/null @@ -1,331 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Contains the authorization decision for a proposed transfer. - class TransferAuthorization - # Plaid’s unique identifier for a transfer authorization. - attr_accessor :id - - # The datetime representing when the authorization was created, in the format `2006-01-02T15:04:05Z`. - attr_accessor :created - - attr_accessor :decision - - attr_accessor :decision_rationale - - attr_accessor :guarantee_decision - - attr_accessor :guarantee_decision_rationale - - attr_accessor :payment_risk - - attr_accessor :proposed_transfer - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'created' => :'created', - :'decision' => :'decision', - :'decision_rationale' => :'decision_rationale', - :'guarantee_decision' => :'guarantee_decision', - :'guarantee_decision_rationale' => :'guarantee_decision_rationale', - :'payment_risk' => :'payment_risk', - :'proposed_transfer' => :'proposed_transfer' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'created' => :'Time', - :'decision' => :'TransferAuthorizationDecision', - :'decision_rationale' => :'TransferAuthorizationDecisionRationale', - :'guarantee_decision' => :'TransferAuthorizationGuaranteeDecision', - :'guarantee_decision_rationale' => :'TransferAuthorizationGuaranteeDecisionRationale', - :'payment_risk' => :'TransferAuthorizationPaymentRisk', - :'proposed_transfer' => :'TransferAuthorizationProposedTransfer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'decision_rationale', - :'guarantee_decision', - :'guarantee_decision_rationale', - :'payment_risk', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferAuthorization` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferAuthorization`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'created') - self.created = attributes[:'created'] - end - - if attributes.key?(:'decision') - self.decision = attributes[:'decision'] - end - - if attributes.key?(:'decision_rationale') - self.decision_rationale = attributes[:'decision_rationale'] - end - - if attributes.key?(:'guarantee_decision') - self.guarantee_decision = attributes[:'guarantee_decision'] - end - - if attributes.key?(:'guarantee_decision_rationale') - self.guarantee_decision_rationale = attributes[:'guarantee_decision_rationale'] - end - - if attributes.key?(:'payment_risk') - self.payment_risk = attributes[:'payment_risk'] - end - - if attributes.key?(:'proposed_transfer') - self.proposed_transfer = attributes[:'proposed_transfer'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @created.nil? - invalid_properties.push('invalid value for "created", created cannot be nil.') - end - - if @decision.nil? - invalid_properties.push('invalid value for "decision", decision cannot be nil.') - end - - if @proposed_transfer.nil? - invalid_properties.push('invalid value for "proposed_transfer", proposed_transfer cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @created.nil? - return false if @decision.nil? - return false if @proposed_transfer.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - created == o.created && - decision == o.decision && - decision_rationale == o.decision_rationale && - guarantee_decision == o.guarantee_decision && - guarantee_decision_rationale == o.guarantee_decision_rationale && - payment_risk == o.payment_risk && - proposed_transfer == o.proposed_transfer - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, created, decision, decision_rationale, guarantee_decision, guarantee_decision_rationale, payment_risk, proposed_transfer].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_authorization_create_request.rb b/lib/plaid/models/transfer_authorization_create_request.rb deleted file mode 100644 index 40e175534..000000000 --- a/lib/plaid/models/transfer_authorization_create_request.rb +++ /dev/null @@ -1,503 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/authorization/create` - class TransferAuthorizationCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The Plaid `access_token` for the account that will be debited or credited. - attr_accessor :access_token - - # The Plaid `account_id` corresponding to the end-user account that will be debited or credited. - attr_accessor :account_id - - # Specify the account used to fund the transfer. Should be specified if using legacy funding methods only. If using Plaid Ledger, leave this field blank. Customers can find a list of `funding_account_id`s in the Accounts page of your Plaid Dashboard, under the \"Account ID\" column. If this field is left blank and you are using legacy funding methods, this will default to the default `funding_account_id` specified during onboarding. Otherwise, Plaid Ledger will be used. - attr_accessor :funding_account_id - - # The payment profile token associated with the Payment Profile that will be debited or credited. Required if not using `access_token`. - attr_accessor :payment_profile_token - - attr_accessor :type - - attr_accessor :network - - # 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. - attr_accessor :amount - - attr_accessor :ach_class - - attr_accessor :wire_details - - attr_accessor :user - - attr_accessor :device - - # Plaid's unique identifier for the origination account for this authorization. If not specified, the default account will be used. - attr_accessor :origination_account_id - - # The currency of the transfer amount. The default value is \"USD\". - attr_accessor :iso_currency_code - - # A random key provided by the client, per unique authorization, which expires after 48 hours. Maximum of 50 characters. The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. For example, if a request to create an authorization fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single authorization is created. This idempotency key expires after 48 hours, after which the same key can be reused. Failure to provide this key may result in duplicate charges. - attr_accessor :idempotency_key - - # If the end user is initiating the specific transfer themselves via an interactive UI, this should be `true`; for automatic recurring payments where the end user is not actually initiating each individual transfer, it should be `false`. This field is not currently used and is present to support planned future functionality. - attr_accessor :user_present - - # If set to `false`, Plaid will not offer a `guarantee_decision` for this request (Guarantee customers only). - attr_accessor :with_guarantee - - # The unique identifier returned by Plaid's [beacon](https://plaid.com/docs/transfer/guarantee/#using-a-beacon) when it is run on your webpage. - attr_accessor :beacon_session_id - - # The Plaid client ID that is the originator of this transfer. Only needed if creating transfers on behalf of another client as a [Platform customer](https://plaid.com/docs/transfer/application/#originators-vs-platforms). - attr_accessor :originator_client_id - - attr_accessor :credit_funds_source - - # Plaid’s unique identifier for a test clock. This field may only be used when using `sandbox` environment. If provided, the `authorization` is created at the `virtual_time` on the provided test clock. - attr_accessor :test_clock_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'account_id' => :'account_id', - :'funding_account_id' => :'funding_account_id', - :'payment_profile_token' => :'payment_profile_token', - :'type' => :'type', - :'network' => :'network', - :'amount' => :'amount', - :'ach_class' => :'ach_class', - :'wire_details' => :'wire_details', - :'user' => :'user', - :'device' => :'device', - :'origination_account_id' => :'origination_account_id', - :'iso_currency_code' => :'iso_currency_code', - :'idempotency_key' => :'idempotency_key', - :'user_present' => :'user_present', - :'with_guarantee' => :'with_guarantee', - :'beacon_session_id' => :'beacon_session_id', - :'originator_client_id' => :'originator_client_id', - :'credit_funds_source' => :'credit_funds_source', - :'test_clock_id' => :'test_clock_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'account_id' => :'String', - :'funding_account_id' => :'String', - :'payment_profile_token' => :'String', - :'type' => :'TransferType', - :'network' => :'TransferNetwork', - :'amount' => :'String', - :'ach_class' => :'ACHClass', - :'wire_details' => :'TransferWireDetails', - :'user' => :'TransferAuthorizationUserInRequest', - :'device' => :'TransferAuthorizationDevice', - :'origination_account_id' => :'String', - :'iso_currency_code' => :'String', - :'idempotency_key' => :'String', - :'user_present' => :'Boolean', - :'with_guarantee' => :'Boolean', - :'beacon_session_id' => :'String', - :'originator_client_id' => :'String', - :'credit_funds_source' => :'TransferCreditFundsSource', - :'test_clock_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'funding_account_id', - :'wire_details', - :'idempotency_key', - :'user_present', - :'with_guarantee', - :'beacon_session_id', - :'originator_client_id', - :'test_clock_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferAuthorizationCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferAuthorizationCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - - if attributes.key?(:'payment_profile_token') - self.payment_profile_token = attributes[:'payment_profile_token'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'network') - self.network = attributes[:'network'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'ach_class') - self.ach_class = attributes[:'ach_class'] - end - - if attributes.key?(:'wire_details') - self.wire_details = attributes[:'wire_details'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'device') - self.device = attributes[:'device'] - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'idempotency_key') - self.idempotency_key = attributes[:'idempotency_key'] - end - - if attributes.key?(:'user_present') - self.user_present = attributes[:'user_present'] - end - - if attributes.key?(:'with_guarantee') - self.with_guarantee = attributes[:'with_guarantee'] - else - self.with_guarantee = true - end - - if attributes.key?(:'beacon_session_id') - self.beacon_session_id = attributes[:'beacon_session_id'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - - if attributes.key?(:'credit_funds_source') - self.credit_funds_source = attributes[:'credit_funds_source'] - end - - if attributes.key?(:'test_clock_id') - self.test_clock_id = attributes[:'test_clock_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @network.nil? - invalid_properties.push('invalid value for "network", network cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if !@idempotency_key.nil? && @idempotency_key.to_s.length > 50 - invalid_properties.push('invalid value for "idempotency_key", the character length must be smaller than or equal to 50.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @account_id.nil? - return false if @type.nil? - return false if @network.nil? - return false if @amount.nil? - return false if @user.nil? - return false if !@idempotency_key.nil? && @idempotency_key.to_s.length > 50 - true - end - - # Custom attribute writer method with validation - # @param [Object] idempotency_key Value to be assigned - def idempotency_key=(idempotency_key) - if !idempotency_key.nil? && idempotency_key.to_s.length > 50 - fail ArgumentError, 'invalid value for "idempotency_key", the character length must be smaller than or equal to 50.' - end - - - @idempotency_key = idempotency_key - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - account_id == o.account_id && - funding_account_id == o.funding_account_id && - payment_profile_token == o.payment_profile_token && - type == o.type && - network == o.network && - amount == o.amount && - ach_class == o.ach_class && - wire_details == o.wire_details && - user == o.user && - device == o.device && - origination_account_id == o.origination_account_id && - iso_currency_code == o.iso_currency_code && - idempotency_key == o.idempotency_key && - user_present == o.user_present && - with_guarantee == o.with_guarantee && - beacon_session_id == o.beacon_session_id && - originator_client_id == o.originator_client_id && - credit_funds_source == o.credit_funds_source && - test_clock_id == o.test_clock_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, account_id, funding_account_id, payment_profile_token, type, network, amount, ach_class, wire_details, user, device, origination_account_id, iso_currency_code, idempotency_key, user_present, with_guarantee, beacon_session_id, originator_client_id, credit_funds_source, test_clock_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_authorization_create_response.rb b/lib/plaid/models/transfer_authorization_create_response.rb deleted file mode 100644 index dd2278aa0..000000000 --- a/lib/plaid/models/transfer_authorization_create_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/authorization/create` - class TransferAuthorizationCreateResponse - attr_accessor :authorization - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'authorization' => :'authorization', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'authorization' => :'TransferAuthorization', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferAuthorizationCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferAuthorizationCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'authorization') - self.authorization = attributes[:'authorization'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @authorization.nil? - invalid_properties.push('invalid value for "authorization", authorization cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @authorization.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - authorization == o.authorization && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [authorization, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_authorization_decision.rb b/lib/plaid/models/transfer_authorization_decision.rb deleted file mode 100644 index b15076a6d..000000000 --- a/lib/plaid/models/transfer_authorization_decision.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferAuthorizationDecision - APPROVED = "approved".freeze - DECLINED = "declined".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_authorization_decision_rationale.rb b/lib/plaid/models/transfer_authorization_decision_rationale.rb deleted file mode 100644 index f4b718e56..000000000 --- a/lib/plaid/models/transfer_authorization_decision_rationale.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class TransferAuthorizationDecisionRationale - attr_accessor :code - - # A human-readable description of the code associated with a transfer approval or transfer decline. - attr_accessor :description - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'description' => :'description' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'TransferAuthorizationDecisionRationaleCode', - :'description' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferAuthorizationDecisionRationale` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferAuthorizationDecisionRationale`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @description.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - description == o.description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_authorization_decision_rationale_code.rb b/lib/plaid/models/transfer_authorization_decision_rationale_code.rb deleted file mode 100644 index 5458fe0af..000000000 --- a/lib/plaid/models/transfer_authorization_decision_rationale_code.rb +++ /dev/null @@ -1,46 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferAuthorizationDecisionRationaleCode - NSF = "NSF".freeze - RISK = "RISK".freeze - TRANSFER_LIMIT_REACHED = "TRANSFER_LIMIT_REACHED".freeze - MANUALLY_VERIFIED_ITEM = "MANUALLY_VERIFIED_ITEM".freeze - ITEM_LOGIN_REQUIRED = "ITEM_LOGIN_REQUIRED".freeze - PAYMENT_PROFILE_LOGIN_REQUIRED = "PAYMENT_PROFILE_LOGIN_REQUIRED".freeze - ERROR = "ERROR".freeze - MIGRATED_ACCOUNT_ITEM = "MIGRATED_ACCOUNT_ITEM".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_authorization_device.rb b/lib/plaid/models/transfer_authorization_device.rb deleted file mode 100644 index 6953c075a..000000000 --- a/lib/plaid/models/transfer_authorization_device.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the device being used to initiate the authorization. These fields are not currently incorporated into the risk check. - class TransferAuthorizationDevice - # The IP address of the device being used to initiate the authorization. - attr_accessor :ip_address - - # The user agent of the device being used to initiate the authorization. - attr_accessor :user_agent - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ip_address' => :'ip_address', - :'user_agent' => :'user_agent' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ip_address' => :'String', - :'user_agent' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferAuthorizationDevice` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferAuthorizationDevice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ip_address') - self.ip_address = attributes[:'ip_address'] - end - - if attributes.key?(:'user_agent') - self.user_agent = attributes[:'user_agent'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ip_address == o.ip_address && - user_agent == o.user_agent - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ip_address, user_agent].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_authorization_guarantee_decision.rb b/lib/plaid/models/transfer_authorization_guarantee_decision.rb deleted file mode 100644 index 85320a000..000000000 --- a/lib/plaid/models/transfer_authorization_guarantee_decision.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferAuthorizationGuaranteeDecision - GUARANTEED = "GUARANTEED".freeze - NOT_GUARANTEED = "NOT_GUARANTEED".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_authorization_guarantee_decision_rationale.rb b/lib/plaid/models/transfer_authorization_guarantee_decision_rationale.rb deleted file mode 100644 index d14647cdd..000000000 --- a/lib/plaid/models/transfer_authorization_guarantee_decision_rationale.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The rationale for Plaid's decision to not guarantee a transfer. Will be `null` unless `guarantee_decision` is `NOT_GUARANTEED`. - class TransferAuthorizationGuaranteeDecisionRationale - attr_accessor :code - - # A human-readable description of why the transfer cannot be guaranteed. - attr_accessor :description - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'description' => :'description' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'TransferAuthorizationGuaranteeDecisionRationaleCode', - :'description' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferAuthorizationGuaranteeDecisionRationale` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferAuthorizationGuaranteeDecisionRationale`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @description.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - description == o.description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_authorization_guarantee_decision_rationale_code.rb b/lib/plaid/models/transfer_authorization_guarantee_decision_rationale_code.rb deleted file mode 100644 index 749549818..000000000 --- a/lib/plaid/models/transfer_authorization_guarantee_decision_rationale_code.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferAuthorizationGuaranteeDecisionRationaleCode - RETURN_BANK = "RETURN_BANK".freeze - RETURN_CUSTOMER = "RETURN_CUSTOMER".freeze - GUARANTEE_LIMIT_REACHED = "GUARANTEE_LIMIT_REACHED".freeze - RISK_ESTIMATE_UNAVAILABLE = "RISK_ESTIMATE_UNAVAILABLE".freeze - REQUIRED_PARAM_MISSING = "REQUIRED_PARAM_MISSING".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_authorization_payment_risk.rb b/lib/plaid/models/transfer_authorization_payment_risk.rb deleted file mode 100644 index 4c44d686a..000000000 --- a/lib/plaid/models/transfer_authorization_payment_risk.rb +++ /dev/null @@ -1,334 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class TransferAuthorizationPaymentRisk - # A score from 1-99 that indicates the transaction return risk: a higher risk score suggests a higher return likelihood. The score evaluates the transaction return risk because an account is overdrawn or because an ineligible account is used and covers return codes: \"R01\", \"R02\", \"R03\", \"R04\", \"R06\", \"R08\", \"R09\", \"R13\", \"R16\", \"R17\", \"R20\", \"R23\". These returns have a turnaround time of 2 banking days. - attr_accessor :bank_initiated_return_score - - # A score from 1-99 that indicates the transaction return risk: a higher risk score suggests a higher return likelihood. The score evaluates the transaction return risk of an unauthorized debit and covers return codes: \"R05\", \"R07\", \"R10\", \"R11\", \"R29\". These returns typically have a return time frame of up to 60 calendar days. During this period, the customer of financial institutions can dispute a transaction as unauthorized. - attr_accessor :customer_initiated_return_score - - attr_accessor :risk_level - - # 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. - attr_accessor :warnings - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_initiated_return_score' => :'bank_initiated_return_score', - :'customer_initiated_return_score' => :'customer_initiated_return_score', - :'risk_level' => :'risk_level', - :'warnings' => :'warnings' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_initiated_return_score' => :'Integer', - :'customer_initiated_return_score' => :'Integer', - :'risk_level' => :'TransferAuthorizationRiskLevel', - :'warnings' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'bank_initiated_return_score', - :'customer_initiated_return_score', - :'risk_level', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferAuthorizationPaymentRisk` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferAuthorizationPaymentRisk`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_initiated_return_score') - self.bank_initiated_return_score = attributes[:'bank_initiated_return_score'] - end - - if attributes.key?(:'customer_initiated_return_score') - self.customer_initiated_return_score = attributes[:'customer_initiated_return_score'] - end - - if attributes.key?(:'risk_level') - self.risk_level = attributes[:'risk_level'] - end - - if attributes.key?(:'warnings') - if (value = attributes[:'warnings']).is_a?(Array) - self.warnings = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @bank_initiated_return_score > 99 - invalid_properties.push('invalid value for "bank_initiated_return_score", must be smaller than or equal to 99.') - end - - if @bank_initiated_return_score < 1 - invalid_properties.push('invalid value for "bank_initiated_return_score", must be greater than or equal to 1.') - end - - - if @customer_initiated_return_score > 99 - invalid_properties.push('invalid value for "customer_initiated_return_score", must be smaller than or equal to 99.') - end - - if @customer_initiated_return_score < 1 - invalid_properties.push('invalid value for "customer_initiated_return_score", must be greater than or equal to 1.') - end - - - if @warnings.nil? - invalid_properties.push('invalid value for "warnings", warnings cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @bank_initiated_return_score > 99 - return false if @bank_initiated_return_score < 1 - return false if @customer_initiated_return_score > 99 - return false if @customer_initiated_return_score < 1 - return false if @warnings.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] bank_initiated_return_score Value to be assigned - def bank_initiated_return_score=(bank_initiated_return_score) - if bank_initiated_return_score > 99 - fail ArgumentError, 'invalid value for "bank_initiated_return_score", must be smaller than or equal to 99.' - end - - if bank_initiated_return_score < 1 - fail ArgumentError, 'invalid value for "bank_initiated_return_score", must be greater than or equal to 1.' - end - - - @bank_initiated_return_score = bank_initiated_return_score - end - - # Custom attribute writer method with validation - # @param [Object] customer_initiated_return_score Value to be assigned - def customer_initiated_return_score=(customer_initiated_return_score) - if customer_initiated_return_score > 99 - fail ArgumentError, 'invalid value for "customer_initiated_return_score", must be smaller than or equal to 99.' - end - - if customer_initiated_return_score < 1 - fail ArgumentError, 'invalid value for "customer_initiated_return_score", must be greater than or equal to 1.' - end - - - @customer_initiated_return_score = customer_initiated_return_score - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_initiated_return_score == o.bank_initiated_return_score && - customer_initiated_return_score == o.customer_initiated_return_score && - risk_level == o.risk_level && - warnings == o.warnings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_initiated_return_score, customer_initiated_return_score, risk_level, warnings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_authorization_proposed_transfer.rb b/lib/plaid/models/transfer_authorization_proposed_transfer.rb deleted file mode 100644 index 74d51fca9..000000000 --- a/lib/plaid/models/transfer_authorization_proposed_transfer.rb +++ /dev/null @@ -1,386 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Details regarding the proposed transfer. - class TransferAuthorizationProposedTransfer - attr_accessor :ach_class - - # The Plaid `account_id` for the account that will be debited or credited. - attr_accessor :account_id - - # 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. - attr_accessor :funding_account_id - - attr_accessor :type - - attr_accessor :user - - # 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. - attr_accessor :amount - - # The network or rails used for the transfer. - attr_accessor :network - - attr_accessor :wire_details - - # Plaid's unique identifier for the origination account that was used for this transfer. - attr_accessor :origination_account_id - - # The currency of the transfer amount. The default value is \"USD\". - attr_accessor :iso_currency_code - - # The Plaid client ID that is the originator of this transfer. Only present if created on behalf of another client as a [Platform customer](https://plaid.com/docs/transfer/application/#originators-vs-platforms). - attr_accessor :originator_client_id - - attr_accessor :credit_funds_source - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ach_class' => :'ach_class', - :'account_id' => :'account_id', - :'funding_account_id' => :'funding_account_id', - :'type' => :'type', - :'user' => :'user', - :'amount' => :'amount', - :'network' => :'network', - :'wire_details' => :'wire_details', - :'origination_account_id' => :'origination_account_id', - :'iso_currency_code' => :'iso_currency_code', - :'originator_client_id' => :'originator_client_id', - :'credit_funds_source' => :'credit_funds_source' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ach_class' => :'ACHClass', - :'account_id' => :'String', - :'funding_account_id' => :'String', - :'type' => :'TransferType', - :'user' => :'TransferUserInResponse', - :'amount' => :'String', - :'network' => :'String', - :'wire_details' => :'TransferWireDetails', - :'origination_account_id' => :'String', - :'iso_currency_code' => :'String', - :'originator_client_id' => :'String', - :'credit_funds_source' => :'TransferCreditFundsSource' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'funding_account_id', - :'wire_details', - :'originator_client_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferAuthorizationProposedTransfer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferAuthorizationProposedTransfer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ach_class') - self.ach_class = attributes[:'ach_class'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'network') - self.network = attributes[:'network'] - end - - if attributes.key?(:'wire_details') - self.wire_details = attributes[:'wire_details'] - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - - if attributes.key?(:'credit_funds_source') - self.credit_funds_source = attributes[:'credit_funds_source'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @network.nil? - invalid_properties.push('invalid value for "network", network cannot be nil.') - end - - if @origination_account_id.nil? - invalid_properties.push('invalid value for "origination_account_id", origination_account_id cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - if @credit_funds_source.nil? - invalid_properties.push('invalid value for "credit_funds_source", credit_funds_source cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - return false if @user.nil? - return false if @amount.nil? - return false if @network.nil? - return false if @origination_account_id.nil? - return false if @iso_currency_code.nil? - return false if @credit_funds_source.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ach_class == o.ach_class && - account_id == o.account_id && - funding_account_id == o.funding_account_id && - type == o.type && - user == o.user && - amount == o.amount && - network == o.network && - wire_details == o.wire_details && - origination_account_id == o.origination_account_id && - iso_currency_code == o.iso_currency_code && - originator_client_id == o.originator_client_id && - credit_funds_source == o.credit_funds_source - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ach_class, account_id, funding_account_id, type, user, amount, network, wire_details, origination_account_id, iso_currency_code, originator_client_id, credit_funds_source].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_authorization_risk_level.rb b/lib/plaid/models/transfer_authorization_risk_level.rb deleted file mode 100644 index e0027fa62..000000000 --- a/lib/plaid/models/transfer_authorization_risk_level.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferAuthorizationRiskLevel - HIGH_RISK = "HIGH_RISK".freeze - MEDIUM_HIGH_RISK = "MEDIUM_HIGH_RISK".freeze - MEDIUM_RISK = "MEDIUM_RISK".freeze - MEDIUM_LOW_RISK = "MEDIUM_LOW_RISK".freeze - LOW_RISK = "LOW_RISK".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_authorization_user_in_request.rb b/lib/plaid/models/transfer_authorization_user_in_request.rb deleted file mode 100644 index c4dd9eeb2..000000000 --- a/lib/plaid/models/transfer_authorization_user_in_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The legal name and other information for the account holder. The `user.legal_name` field is required. Other fields are not currently used and are present to support planned future functionality. - class TransferAuthorizationUserInRequest - # The user's legal name. If the user is a business, provide the business name. - attr_accessor :legal_name - - # The user's phone number. - attr_accessor :phone_number - - # The user's email address. - attr_accessor :email_address - - attr_accessor :address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'legal_name' => :'legal_name', - :'phone_number' => :'phone_number', - :'email_address' => :'email_address', - :'address' => :'address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'legal_name' => :'String', - :'phone_number' => :'String', - :'email_address' => :'String', - :'address' => :'TransferUserAddressInRequest' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferAuthorizationUserInRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferAuthorizationUserInRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @legal_name.nil? - invalid_properties.push('invalid value for "legal_name", legal_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @legal_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - legal_name == o.legal_name && - phone_number == o.phone_number && - email_address == o.email_address && - address == o.address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [legal_name, phone_number, email_address, address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_balance.rb b/lib/plaid/models/transfer_balance.rb deleted file mode 100644 index 38d928b35..000000000 --- a/lib/plaid/models/transfer_balance.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the balance held with Plaid. - class TransferBalance - # The amount of this balance available for use (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :available - - # The available balance, plus amount of pending funds that in processing (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :current - - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'available' => :'available', - :'current' => :'current', - :'type' => :'type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'available' => :'String', - :'current' => :'String', - :'type' => :'TransferBalanceType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferBalance` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'available') - self.available = attributes[:'available'] - end - - if attributes.key?(:'current') - self.current = attributes[:'current'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @available.nil? - invalid_properties.push('invalid value for "available", available cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @available.nil? - return false if @type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - available == o.available && - current == o.current && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [available, current, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_balance_get_request.rb b/lib/plaid/models/transfer_balance_get_request.rb deleted file mode 100644 index 247c107f9..000000000 --- a/lib/plaid/models/transfer_balance_get_request.rb +++ /dev/null @@ -1,273 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/balance/get` - class TransferBalanceGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Client ID of the end customer. - attr_accessor :originator_client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'originator_client_id' => :'originator_client_id', - :'secret' => :'secret', - :'type' => :'type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'originator_client_id' => :'String', - :'secret' => :'String', - :'type' => :'TransferBalanceType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'originator_client_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferBalanceGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferBalanceGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - originator_client_id == o.originator_client_id && - secret == o.secret && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, originator_client_id, secret, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_balance_get_response.rb b/lib/plaid/models/transfer_balance_get_response.rb deleted file mode 100644 index b87c90861..000000000 --- a/lib/plaid/models/transfer_balance_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/balance/get` - class TransferBalanceGetResponse - attr_accessor :balance - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'balance' => :'balance', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'balance' => :'TransferBalance', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferBalanceGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferBalanceGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'balance') - self.balance = attributes[:'balance'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @balance.nil? - invalid_properties.push('invalid value for "balance", balance cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @balance.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - balance == o.balance && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [balance, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_balance_type.rb b/lib/plaid/models/transfer_balance_type.rb deleted file mode 100644 index 93cffda70..000000000 --- a/lib/plaid/models/transfer_balance_type.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferBalanceType - RTP_CREDITS = "prefunded_rtp_credits".freeze - ACH_CREDITS = "prefunded_ach_credits".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_cancel_request.rb b/lib/plaid/models/transfer_cancel_request.rb deleted file mode 100644 index d7fcef3c3..000000000 --- a/lib/plaid/models/transfer_cancel_request.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/cancel` - class TransferCancelRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a transfer. - attr_accessor :transfer_id - - # The Plaid client ID of the transfer originator. Should only be present if `client_id` is a third-party sender (TPS). - attr_accessor :originator_client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'transfer_id' => :'transfer_id', - :'originator_client_id' => :'originator_client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'transfer_id' => :'String', - :'originator_client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'originator_client_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferCancelRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferCancelRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'transfer_id') - self.transfer_id = attributes[:'transfer_id'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transfer_id.nil? - invalid_properties.push('invalid value for "transfer_id", transfer_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transfer_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - transfer_id == o.transfer_id && - originator_client_id == o.originator_client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, transfer_id, originator_client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_cancel_response.rb b/lib/plaid/models/transfer_cancel_response.rb deleted file mode 100644 index e072ab525..000000000 --- a/lib/plaid/models/transfer_cancel_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/cancel` - class TransferCancelResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferCancelResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferCancelResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_capabilities_get_request.rb b/lib/plaid/models/transfer_capabilities_get_request.rb deleted file mode 100644 index 930f818ed..000000000 --- a/lib/plaid/models/transfer_capabilities_get_request.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/capabilities/get` - class TransferCapabilitiesGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The Plaid `access_token` for the account that will be debited or credited. - attr_accessor :access_token - - # The Plaid `account_id` corresponding to the end-user account that will be debited or credited. - attr_accessor :account_id - - # A payment profile token associated with the Payment Profile data that is being requested. - attr_accessor :payment_profile_token - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'account_id' => :'account_id', - :'payment_profile_token' => :'payment_profile_token' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'account_id' => :'String', - :'payment_profile_token' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferCapabilitiesGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferCapabilitiesGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'payment_profile_token') - self.payment_profile_token = attributes[:'payment_profile_token'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @account_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - account_id == o.account_id && - payment_profile_token == o.payment_profile_token - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, account_id, payment_profile_token].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_capabilities_get_response.rb b/lib/plaid/models/transfer_capabilities_get_response.rb deleted file mode 100644 index f350efc94..000000000 --- a/lib/plaid/models/transfer_capabilities_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/capabilities/get` - class TransferCapabilitiesGetResponse - attr_accessor :institution_supported_networks - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'institution_supported_networks' => :'institution_supported_networks', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'institution_supported_networks' => :'InstitutionSupportedNetworks', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferCapabilitiesGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferCapabilitiesGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'institution_supported_networks') - self.institution_supported_networks = attributes[:'institution_supported_networks'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @institution_supported_networks.nil? - invalid_properties.push('invalid value for "institution_supported_networks", institution_supported_networks cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @institution_supported_networks.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - institution_supported_networks == o.institution_supported_networks && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [institution_supported_networks, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_capabilities_get_rtp.rb b/lib/plaid/models/transfer_capabilities_get_rtp.rb deleted file mode 100644 index cefc44f3e..000000000 --- a/lib/plaid/models/transfer_capabilities_get_rtp.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Contains the supported service types in RTP - class TransferCapabilitiesGetRTP - # When `true`, the linked Item's institution supports RTP credit transfer. - attr_accessor :credit - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'credit' => :'credit' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'credit' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferCapabilitiesGetRTP` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferCapabilitiesGetRTP`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'credit') - self.credit = attributes[:'credit'] - else - self.credit = false - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - credit == o.credit - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [credit].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_configuration_get_request.rb b/lib/plaid/models/transfer_configuration_get_request.rb deleted file mode 100644 index 7a9a696ad..000000000 --- a/lib/plaid/models/transfer_configuration_get_request.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/configuration/get` - class TransferConfigurationGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The Plaid client ID of the transfer originator. Should only be present if `client_id` is a [Platform customer](https://plaid.com/docs/transfer/application/#originators-vs-platforms). - attr_accessor :originator_client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'originator_client_id' => :'originator_client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'originator_client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'originator_client_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferConfigurationGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferConfigurationGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - originator_client_id == o.originator_client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, originator_client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_configuration_get_response.rb b/lib/plaid/models/transfer_configuration_get_response.rb deleted file mode 100644 index 0095d2adc..000000000 --- a/lib/plaid/models/transfer_configuration_get_response.rb +++ /dev/null @@ -1,361 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/configuration/get` - class TransferConfigurationGetResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # The max limit of dollar amount of a single transfer (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :max_single_transfer_amount - - # The max limit of dollar amount of a single credit transfer (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :max_single_transfer_credit_amount - - # The max limit of dollar amount of a single debit transfer (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :max_single_transfer_debit_amount - - # The max limit of sum of dollar amount of credit transfers in last 24 hours (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :max_daily_credit_amount - - # The max limit of sum of dollar amount of debit transfers in last 24 hours (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :max_daily_debit_amount - - # The max limit of sum of dollar amount of credit and debit transfers in one calendar month (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :max_monthly_amount - - # The max limit of sum of dollar amount of credit transfers in one calendar month (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :max_monthly_credit_amount - - # The max limit of sum of dollar amount of debit transfers in one calendar month (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :max_monthly_debit_amount - - # The currency of the dollar amount, e.g. \"USD\". - attr_accessor :iso_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id', - :'max_single_transfer_amount' => :'max_single_transfer_amount', - :'max_single_transfer_credit_amount' => :'max_single_transfer_credit_amount', - :'max_single_transfer_debit_amount' => :'max_single_transfer_debit_amount', - :'max_daily_credit_amount' => :'max_daily_credit_amount', - :'max_daily_debit_amount' => :'max_daily_debit_amount', - :'max_monthly_amount' => :'max_monthly_amount', - :'max_monthly_credit_amount' => :'max_monthly_credit_amount', - :'max_monthly_debit_amount' => :'max_monthly_debit_amount', - :'iso_currency_code' => :'iso_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String', - :'max_single_transfer_amount' => :'String', - :'max_single_transfer_credit_amount' => :'String', - :'max_single_transfer_debit_amount' => :'String', - :'max_daily_credit_amount' => :'String', - :'max_daily_debit_amount' => :'String', - :'max_monthly_amount' => :'String', - :'max_monthly_credit_amount' => :'String', - :'max_monthly_debit_amount' => :'String', - :'iso_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferConfigurationGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferConfigurationGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'max_single_transfer_amount') - self.max_single_transfer_amount = attributes[:'max_single_transfer_amount'] - end - - if attributes.key?(:'max_single_transfer_credit_amount') - self.max_single_transfer_credit_amount = attributes[:'max_single_transfer_credit_amount'] - end - - if attributes.key?(:'max_single_transfer_debit_amount') - self.max_single_transfer_debit_amount = attributes[:'max_single_transfer_debit_amount'] - end - - if attributes.key?(:'max_daily_credit_amount') - self.max_daily_credit_amount = attributes[:'max_daily_credit_amount'] - end - - if attributes.key?(:'max_daily_debit_amount') - self.max_daily_debit_amount = attributes[:'max_daily_debit_amount'] - end - - if attributes.key?(:'max_monthly_amount') - self.max_monthly_amount = attributes[:'max_monthly_amount'] - end - - if attributes.key?(:'max_monthly_credit_amount') - self.max_monthly_credit_amount = attributes[:'max_monthly_credit_amount'] - end - - if attributes.key?(:'max_monthly_debit_amount') - self.max_monthly_debit_amount = attributes[:'max_monthly_debit_amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - if @max_single_transfer_amount.nil? - invalid_properties.push('invalid value for "max_single_transfer_amount", max_single_transfer_amount cannot be nil.') - end - - if @max_single_transfer_credit_amount.nil? - invalid_properties.push('invalid value for "max_single_transfer_credit_amount", max_single_transfer_credit_amount cannot be nil.') - end - - if @max_single_transfer_debit_amount.nil? - invalid_properties.push('invalid value for "max_single_transfer_debit_amount", max_single_transfer_debit_amount cannot be nil.') - end - - if @max_daily_credit_amount.nil? - invalid_properties.push('invalid value for "max_daily_credit_amount", max_daily_credit_amount cannot be nil.') - end - - if @max_daily_debit_amount.nil? - invalid_properties.push('invalid value for "max_daily_debit_amount", max_daily_debit_amount cannot be nil.') - end - - if @max_monthly_amount.nil? - invalid_properties.push('invalid value for "max_monthly_amount", max_monthly_amount cannot be nil.') - end - - if @max_monthly_credit_amount.nil? - invalid_properties.push('invalid value for "max_monthly_credit_amount", max_monthly_credit_amount cannot be nil.') - end - - if @max_monthly_debit_amount.nil? - invalid_properties.push('invalid value for "max_monthly_debit_amount", max_monthly_debit_amount cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - return false if @max_single_transfer_amount.nil? - return false if @max_single_transfer_credit_amount.nil? - return false if @max_single_transfer_debit_amount.nil? - return false if @max_daily_credit_amount.nil? - return false if @max_daily_debit_amount.nil? - return false if @max_monthly_amount.nil? - return false if @max_monthly_credit_amount.nil? - return false if @max_monthly_debit_amount.nil? - return false if @iso_currency_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id && - max_single_transfer_amount == o.max_single_transfer_amount && - max_single_transfer_credit_amount == o.max_single_transfer_credit_amount && - max_single_transfer_debit_amount == o.max_single_transfer_debit_amount && - max_daily_credit_amount == o.max_daily_credit_amount && - max_daily_debit_amount == o.max_daily_debit_amount && - max_monthly_amount == o.max_monthly_amount && - max_monthly_credit_amount == o.max_monthly_credit_amount && - max_monthly_debit_amount == o.max_monthly_debit_amount && - iso_currency_code == o.iso_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id, max_single_transfer_amount, max_single_transfer_credit_amount, max_single_transfer_debit_amount, max_daily_credit_amount, max_daily_debit_amount, max_monthly_amount, max_monthly_credit_amount, max_monthly_debit_amount, iso_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_create_request.rb b/lib/plaid/models/transfer_create_request.rb deleted file mode 100644 index b0afabafa..000000000 --- a/lib/plaid/models/transfer_create_request.rb +++ /dev/null @@ -1,450 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/create` - class TransferCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Deprecated. `authorization_id` is now used as idempotency instead. A random key provided by the client, per unique transfer. Maximum of 50 characters. The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. For example, if a request to create a transfer fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single transfer is created. - attr_accessor :idempotency_key - - # The Plaid `access_token` for the account that will be debited or credited. - attr_accessor :access_token - - # The Plaid `account_id` corresponding to the end-user account that will be debited or credited. - attr_accessor :account_id - - # Plaid’s unique identifier for a transfer authorization. This parameter also serves the purpose of acting as an idempotency identifier. - attr_accessor :authorization_id - - attr_accessor :type - - attr_accessor :network - - # 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. - attr_accessor :amount - - # The transfer description. Maximum of 15 characters. If reprocessing a returned transfer, please note that the `description` field must be `\"Retry 1\"` or `\"Retry 2\"` to indicate that it's a retry of a previously returned transfer. You may retry a transfer up to 2 times, within 180 days of creating the original transfer. Only transfers that were returned with code `R01` or `R09` may be retried. For a full listing of ACH return codes, see [Transfer errors](https://plaid.com/docs/errors/transfer/#ach-return-codes). - attr_accessor :description - - attr_accessor :ach_class - - attr_accessor :user - - # 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 - attr_accessor :metadata - - # Plaid’s unique identifier for the origination account for this transfer. If you have more than one origination account, this value must be specified. Otherwise, this field should be left blank. - attr_accessor :origination_account_id - - # The currency of the transfer amount. The default value is \"USD\". - attr_accessor :iso_currency_code - - # Plaid’s unique identifier for a test clock. This field may only be used when using `sandbox` environment. If provided, the `transfer` is created at the `virtual_time` on the provided `test_clock`. - attr_accessor :test_clock_id - - # The amount to deduct from `transfer.amount` and distribute to the platform’s Ledger balance as a facilitator fee (decimal string with two digits of precision e.g. \"10.00\"). The remainder will go to the end-customer’s Ledger balance. This must be less than or equal to the `transfer.amount`. - attr_accessor :facilitator_fee - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'idempotency_key' => :'idempotency_key', - :'access_token' => :'access_token', - :'account_id' => :'account_id', - :'authorization_id' => :'authorization_id', - :'type' => :'type', - :'network' => :'network', - :'amount' => :'amount', - :'description' => :'description', - :'ach_class' => :'ach_class', - :'user' => :'user', - :'metadata' => :'metadata', - :'origination_account_id' => :'origination_account_id', - :'iso_currency_code' => :'iso_currency_code', - :'test_clock_id' => :'test_clock_id', - :'facilitator_fee' => :'facilitator_fee' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'idempotency_key' => :'String', - :'access_token' => :'String', - :'account_id' => :'String', - :'authorization_id' => :'String', - :'type' => :'TransferType', - :'network' => :'TransferNetwork', - :'amount' => :'String', - :'description' => :'String', - :'ach_class' => :'ACHClass', - :'user' => :'TransferUserInRequestDeprecated', - :'metadata' => :'Hash', - :'origination_account_id' => :'String', - :'iso_currency_code' => :'String', - :'test_clock_id' => :'String', - :'facilitator_fee' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'user', - :'metadata', - :'origination_account_id', - :'test_clock_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'idempotency_key') - self.idempotency_key = attributes[:'idempotency_key'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'authorization_id') - self.authorization_id = attributes[:'authorization_id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'network') - self.network = attributes[:'network'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'ach_class') - self.ach_class = attributes[:'ach_class'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Hash) - self.metadata = value - end - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'test_clock_id') - self.test_clock_id = attributes[:'test_clock_id'] - end - - if attributes.key?(:'facilitator_fee') - self.facilitator_fee = attributes[:'facilitator_fee'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@idempotency_key.nil? && @idempotency_key.to_s.length > 50 - invalid_properties.push('invalid value for "idempotency_key", the character length must be smaller than or equal to 50.') - end - - - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @authorization_id.nil? - invalid_properties.push('invalid value for "authorization_id", authorization_id cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @description.to_s.length > 15 - invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 15.') - end - - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@idempotency_key.nil? && @idempotency_key.to_s.length > 50 - return false if @access_token.nil? - return false if @account_id.nil? - return false if @authorization_id.nil? - return false if @description.nil? - return false if @description.to_s.length > 15 - return false if !@metadata.nil? && @metadata.length > 50 - true - end - - # Custom attribute writer method with validation - # @param [Object] idempotency_key Value to be assigned - def idempotency_key=(idempotency_key) - if !idempotency_key.nil? && idempotency_key.to_s.length > 50 - fail ArgumentError, 'invalid value for "idempotency_key", the character length must be smaller than or equal to 50.' - end - - - @idempotency_key = idempotency_key - end - - # Custom attribute writer method with validation - # @param [Object] description Value to be assigned - def description=(description) - if description.nil? - fail ArgumentError, 'description cannot be nil' - end - - if description.to_s.length > 15 - fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 15.' - end - - - @description = description - end - - # Custom attribute writer method with validation - # @param [Object] metadata Value to be assigned - def metadata=(metadata) - - @metadata = metadata - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - idempotency_key == o.idempotency_key && - access_token == o.access_token && - account_id == o.account_id && - authorization_id == o.authorization_id && - type == o.type && - network == o.network && - amount == o.amount && - description == o.description && - ach_class == o.ach_class && - user == o.user && - metadata == o.metadata && - origination_account_id == o.origination_account_id && - iso_currency_code == o.iso_currency_code && - test_clock_id == o.test_clock_id && - facilitator_fee == o.facilitator_fee - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, idempotency_key, access_token, account_id, authorization_id, type, network, amount, description, ach_class, user, metadata, origination_account_id, iso_currency_code, test_clock_id, facilitator_fee].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_create_response.rb b/lib/plaid/models/transfer_create_response.rb deleted file mode 100644 index 0a982ec52..000000000 --- a/lib/plaid/models/transfer_create_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/create` - class TransferCreateResponse - attr_accessor :transfer - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transfer' => :'transfer', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transfer' => :'Transfer', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transfer') - self.transfer = attributes[:'transfer'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transfer.nil? - invalid_properties.push('invalid value for "transfer", transfer cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transfer.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transfer == o.transfer && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transfer, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_credit_funds_source.rb b/lib/plaid/models/transfer_credit_funds_source.rb deleted file mode 100644 index cfaa2b888..000000000 --- a/lib/plaid/models/transfer_credit_funds_source.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferCreditFundsSource - SWEEP = "sweep".freeze - PREFUNDED_RTP_CREDITS = "prefunded_rtp_credits".freeze - PREFUNDED_ACH_CREDITS = "prefunded_ach_credits".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_credit_usage_configuration.rb b/lib/plaid/models/transfer_credit_usage_configuration.rb deleted file mode 100644 index da5c9a4a5..000000000 --- a/lib/plaid/models/transfer_credit_usage_configuration.rb +++ /dev/null @@ -1,309 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class TransferCreditUsageConfiguration - attr_accessor :expected_frequency - - # The originator’s expected highest amount for a single credit transfer. - attr_accessor :expected_highest_amount - - # The originator’s expected average amount per credit. - attr_accessor :expected_average_amount - - # The originator’s monthly expected ACH credit processing amount for the next 6-12 months. - attr_accessor :expected_monthly_amount - - # Specifies the expected use cases for the originator’s credit transfers. This should be a list that contains one or more of the following codes: `\"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 `\"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 - attr_accessor :sec_codes - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'expected_frequency' => :'expected_frequency', - :'expected_highest_amount' => :'expected_highest_amount', - :'expected_average_amount' => :'expected_average_amount', - :'expected_monthly_amount' => :'expected_monthly_amount', - :'sec_codes' => :'sec_codes' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'expected_frequency' => :'OriginatorExpectedTransferFrequency', - :'expected_highest_amount' => :'String', - :'expected_average_amount' => :'String', - :'expected_monthly_amount' => :'String', - :'sec_codes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferCreditUsageConfiguration` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferCreditUsageConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'expected_frequency') - self.expected_frequency = attributes[:'expected_frequency'] - end - - if attributes.key?(:'expected_highest_amount') - self.expected_highest_amount = attributes[:'expected_highest_amount'] - end - - if attributes.key?(:'expected_average_amount') - self.expected_average_amount = attributes[:'expected_average_amount'] - end - - if attributes.key?(:'expected_monthly_amount') - self.expected_monthly_amount = attributes[:'expected_monthly_amount'] - end - - if attributes.key?(:'sec_codes') - if (value = attributes[:'sec_codes']).is_a?(Array) - self.sec_codes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @expected_frequency.nil? - invalid_properties.push('invalid value for "expected_frequency", expected_frequency cannot be nil.') - end - - if @expected_highest_amount.nil? - invalid_properties.push('invalid value for "expected_highest_amount", expected_highest_amount cannot be nil.') - end - - if @expected_average_amount.nil? - invalid_properties.push('invalid value for "expected_average_amount", expected_average_amount cannot be nil.') - end - - if @expected_monthly_amount.nil? - invalid_properties.push('invalid value for "expected_monthly_amount", expected_monthly_amount cannot be nil.') - end - - if @sec_codes.nil? - invalid_properties.push('invalid value for "sec_codes", sec_codes cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @expected_frequency.nil? - return false if @expected_highest_amount.nil? - return false if @expected_average_amount.nil? - return false if @expected_monthly_amount.nil? - return false if @sec_codes.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - expected_frequency == o.expected_frequency && - expected_highest_amount == o.expected_highest_amount && - expected_average_amount == o.expected_average_amount && - expected_monthly_amount == o.expected_monthly_amount && - sec_codes == o.sec_codes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [expected_frequency, expected_highest_amount, expected_average_amount, expected_monthly_amount, sec_codes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_debit_usage_configuration.rb b/lib/plaid/models/transfer_debit_usage_configuration.rb deleted file mode 100644 index ed10cfa1f..000000000 --- a/lib/plaid/models/transfer_debit_usage_configuration.rb +++ /dev/null @@ -1,309 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class TransferDebitUsageConfiguration - attr_accessor :expected_frequency - - # The originator’s expected highest amount for a single debit transfer. - attr_accessor :expected_highest_amount - - # The originator’s expected average amount per debit. - attr_accessor :expected_average_amount - - # The originator’s monthly expected ACH debit processing amount for the next 6-12 months. - attr_accessor :expected_monthly_amount - - # Specifies the expected use cases for the originator’s debit transfers. This should be a list that contains one or more of the following codes: `\"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 `\"tel\"` - Telephone-Initiated Entry `\"web\"` - Internet-Initiated Entry - debits from a consumer’s account where their authorization is obtained over the Internet - attr_accessor :sec_codes - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'expected_frequency' => :'expected_frequency', - :'expected_highest_amount' => :'expected_highest_amount', - :'expected_average_amount' => :'expected_average_amount', - :'expected_monthly_amount' => :'expected_monthly_amount', - :'sec_codes' => :'sec_codes' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'expected_frequency' => :'OriginatorExpectedTransferFrequency', - :'expected_highest_amount' => :'String', - :'expected_average_amount' => :'String', - :'expected_monthly_amount' => :'String', - :'sec_codes' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferDebitUsageConfiguration` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferDebitUsageConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'expected_frequency') - self.expected_frequency = attributes[:'expected_frequency'] - end - - if attributes.key?(:'expected_highest_amount') - self.expected_highest_amount = attributes[:'expected_highest_amount'] - end - - if attributes.key?(:'expected_average_amount') - self.expected_average_amount = attributes[:'expected_average_amount'] - end - - if attributes.key?(:'expected_monthly_amount') - self.expected_monthly_amount = attributes[:'expected_monthly_amount'] - end - - if attributes.key?(:'sec_codes') - if (value = attributes[:'sec_codes']).is_a?(Array) - self.sec_codes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @expected_frequency.nil? - invalid_properties.push('invalid value for "expected_frequency", expected_frequency cannot be nil.') - end - - if @expected_highest_amount.nil? - invalid_properties.push('invalid value for "expected_highest_amount", expected_highest_amount cannot be nil.') - end - - if @expected_average_amount.nil? - invalid_properties.push('invalid value for "expected_average_amount", expected_average_amount cannot be nil.') - end - - if @expected_monthly_amount.nil? - invalid_properties.push('invalid value for "expected_monthly_amount", expected_monthly_amount cannot be nil.') - end - - if @sec_codes.nil? - invalid_properties.push('invalid value for "sec_codes", sec_codes cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @expected_frequency.nil? - return false if @expected_highest_amount.nil? - return false if @expected_average_amount.nil? - return false if @expected_monthly_amount.nil? - return false if @sec_codes.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - expected_frequency == o.expected_frequency && - expected_highest_amount == o.expected_highest_amount && - expected_average_amount == o.expected_average_amount && - expected_monthly_amount == o.expected_monthly_amount && - sec_codes == o.sec_codes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [expected_frequency, expected_highest_amount, expected_average_amount, expected_monthly_amount, sec_codes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_device.rb b/lib/plaid/models/transfer_device.rb deleted file mode 100644 index e67d96f61..000000000 --- a/lib/plaid/models/transfer_device.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the device being used to initiate the authorization. - class TransferDevice - # The IP address of the device being used to initiate the authorization. - attr_accessor :ip_address - - # The user agent of the device being used to initiate the authorization. - attr_accessor :user_agent - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ip_address' => :'ip_address', - :'user_agent' => :'user_agent' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ip_address' => :'String', - :'user_agent' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferDevice` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferDevice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ip_address') - self.ip_address = attributes[:'ip_address'] - end - - if attributes.key?(:'user_agent') - self.user_agent = attributes[:'user_agent'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @ip_address.nil? - invalid_properties.push('invalid value for "ip_address", ip_address cannot be nil.') - end - - if @user_agent.nil? - invalid_properties.push('invalid value for "user_agent", user_agent cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @ip_address.nil? - return false if @user_agent.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ip_address == o.ip_address && - user_agent == o.user_agent - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ip_address, user_agent].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_diligence_document_upload_request.rb b/lib/plaid/models/transfer_diligence_document_upload_request.rb deleted file mode 100644 index 579144a74..000000000 --- a/lib/plaid/models/transfer_diligence_document_upload_request.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/diligence/document/upload` - class TransferDiligenceDocumentUploadRequest - # The Client ID of the originator whose document that you want to upload. - attr_accessor :originator_client_id - - # A file to upload. The file size must be less than 20MB. Supported file extensions: .pdf. - attr_accessor :file - - attr_accessor :purpose - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'originator_client_id' => :'originator_client_id', - :'file' => :'file', - :'purpose' => :'purpose' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'originator_client_id' => :'String', - :'file' => :'File', - :'purpose' => :'TransferDocumentPurpose' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferDiligenceDocumentUploadRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferDiligenceDocumentUploadRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - - if attributes.key?(:'file') - self.file = attributes[:'file'] - end - - if attributes.key?(:'purpose') - self.purpose = attributes[:'purpose'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @originator_client_id.nil? - invalid_properties.push('invalid value for "originator_client_id", originator_client_id cannot be nil.') - end - - if @file.nil? - invalid_properties.push('invalid value for "file", file cannot be nil.') - end - - if @purpose.nil? - invalid_properties.push('invalid value for "purpose", purpose cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @originator_client_id.nil? - return false if @file.nil? - return false if @purpose.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - originator_client_id == o.originator_client_id && - file == o.file && - purpose == o.purpose - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [originator_client_id, file, purpose].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_diligence_document_upload_response.rb b/lib/plaid/models/transfer_diligence_document_upload_response.rb deleted file mode 100644 index 0667261b9..000000000 --- a/lib/plaid/models/transfer_diligence_document_upload_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/diligence/document/upload` - class TransferDiligenceDocumentUploadResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferDiligenceDocumentUploadResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferDiligenceDocumentUploadResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_diligence_status.rb b/lib/plaid/models/transfer_diligence_status.rb deleted file mode 100644 index 9b1157da9..000000000 --- a/lib/plaid/models/transfer_diligence_status.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferDiligenceStatus - NOT_SUBMITTED = "not_submitted".freeze - SUBMITTED = "submitted".freeze - UNDER_REVIEW = "under_review".freeze - APPROVED = "approved".freeze - DENIED = "denied".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_diligence_submit_request.rb b/lib/plaid/models/transfer_diligence_submit_request.rb deleted file mode 100644 index f394e85a6..000000000 --- a/lib/plaid/models/transfer_diligence_submit_request.rb +++ /dev/null @@ -1,260 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/diligence/submit` - class TransferDiligenceSubmitRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Client ID of the the originator whose diligence that you want to submit. - attr_accessor :originator_client_id - - attr_accessor :originator_diligence - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'originator_client_id' => :'originator_client_id', - :'originator_diligence' => :'originator_diligence' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'originator_client_id' => :'String', - :'originator_diligence' => :'TransferOriginatorDiligence' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferDiligenceSubmitRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferDiligenceSubmitRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - - if attributes.key?(:'originator_diligence') - self.originator_diligence = attributes[:'originator_diligence'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @originator_client_id.nil? - invalid_properties.push('invalid value for "originator_client_id", originator_client_id cannot be nil.') - end - - if @originator_diligence.nil? - invalid_properties.push('invalid value for "originator_diligence", originator_diligence cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @originator_client_id.nil? - return false if @originator_diligence.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - originator_client_id == o.originator_client_id && - originator_diligence == o.originator_diligence - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, originator_client_id, originator_diligence].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_diligence_submit_response.rb b/lib/plaid/models/transfer_diligence_submit_response.rb deleted file mode 100644 index 4330aae56..000000000 --- a/lib/plaid/models/transfer_diligence_submit_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/diligence/submit` - class TransferDiligenceSubmitResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferDiligenceSubmitResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferDiligenceSubmitResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_document_purpose.rb b/lib/plaid/models/transfer_document_purpose.rb deleted file mode 100644 index e18fcd56f..000000000 --- a/lib/plaid/models/transfer_document_purpose.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferDocumentPurpose - DUE_DILIGENCE = "DUE_DILIGENCE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_event.rb b/lib/plaid/models/transfer_event.rb deleted file mode 100644 index 730692c79..000000000 --- a/lib/plaid/models/transfer_event.rb +++ /dev/null @@ -1,418 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Represents an event in the Transfers API. - class TransferEvent - # Plaid’s unique identifier for this event. IDs are sequential unsigned 64-bit integers. - attr_accessor :event_id - - # The datetime when this event occurred. This will be of the form `2006-01-02T15:04:05Z`. - attr_accessor :timestamp - - attr_accessor :event_type - - # The account ID associated with the transfer. This field is omitted for Plaid Ledger Sweep events. - attr_accessor :account_id - - # 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. - attr_accessor :funding_account_id - - # Plaid’s unique identifier for a transfer. This field is `null` for Plaid Ledger Sweep events. - attr_accessor :transfer_id - - # The ID of the origination account that this balance belongs to. - attr_accessor :origination_account_id - - attr_accessor :transfer_type - - # The amount of the transfer (decimal string with two digits of precision e.g. \"10.00\"). This field is omitted for Plaid Ledger Sweep events. - attr_accessor :transfer_amount - - attr_accessor :failure_reason - - # Plaid’s unique identifier for a sweep. - attr_accessor :sweep_id - - # A signed amount of how much was `swept` or `return_swept` for this transfer (decimal string with two digits of precision e.g. \"-5.50\"). - attr_accessor :sweep_amount - - # Plaid’s unique identifier for a refund. A non-null value indicates the event is for the associated refund of the transfer. - attr_accessor :refund_id - - # The Plaid client ID that is the originator of the transfer that this event applies to. Only present if the transfer was created on behalf of another client as a third-party sender (TPS). - attr_accessor :originator_client_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'event_id' => :'event_id', - :'timestamp' => :'timestamp', - :'event_type' => :'event_type', - :'account_id' => :'account_id', - :'funding_account_id' => :'funding_account_id', - :'transfer_id' => :'transfer_id', - :'origination_account_id' => :'origination_account_id', - :'transfer_type' => :'transfer_type', - :'transfer_amount' => :'transfer_amount', - :'failure_reason' => :'failure_reason', - :'sweep_id' => :'sweep_id', - :'sweep_amount' => :'sweep_amount', - :'refund_id' => :'refund_id', - :'originator_client_id' => :'originator_client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'event_id' => :'Integer', - :'timestamp' => :'Time', - :'event_type' => :'TransferEventType', - :'account_id' => :'String', - :'funding_account_id' => :'String', - :'transfer_id' => :'String', - :'origination_account_id' => :'String', - :'transfer_type' => :'OmittableTransferType', - :'transfer_amount' => :'String', - :'failure_reason' => :'TransferFailure', - :'sweep_id' => :'String', - :'sweep_amount' => :'String', - :'refund_id' => :'String', - :'originator_client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'funding_account_id', - :'origination_account_id', - :'failure_reason', - :'sweep_id', - :'sweep_amount', - :'refund_id', - :'originator_client_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferEvent` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'event_id') - self.event_id = attributes[:'event_id'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - - if attributes.key?(:'event_type') - self.event_type = attributes[:'event_type'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - - if attributes.key?(:'transfer_id') - self.transfer_id = attributes[:'transfer_id'] - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'transfer_type') - self.transfer_type = attributes[:'transfer_type'] - end - - if attributes.key?(:'transfer_amount') - self.transfer_amount = attributes[:'transfer_amount'] - end - - if attributes.key?(:'failure_reason') - self.failure_reason = attributes[:'failure_reason'] - end - - if attributes.key?(:'sweep_id') - self.sweep_id = attributes[:'sweep_id'] - end - - if attributes.key?(:'sweep_amount') - self.sweep_amount = attributes[:'sweep_amount'] - end - - if attributes.key?(:'refund_id') - self.refund_id = attributes[:'refund_id'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @event_id.nil? - invalid_properties.push('invalid value for "event_id", event_id cannot be nil.') - end - - if @event_id < 0 - invalid_properties.push('invalid value for "event_id", must be greater than or equal to 0.') - end - - - if @timestamp.nil? - invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.') - end - - if @event_type.nil? - invalid_properties.push('invalid value for "event_type", event_type cannot be nil.') - end - - if @transfer_id.nil? - invalid_properties.push('invalid value for "transfer_id", transfer_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @event_id.nil? - return false if @event_id < 0 - return false if @timestamp.nil? - return false if @event_type.nil? - return false if @transfer_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] event_id Value to be assigned - def event_id=(event_id) - if event_id.nil? - fail ArgumentError, 'event_id cannot be nil' - end - - if event_id < 0 - fail ArgumentError, 'invalid value for "event_id", must be greater than or equal to 0.' - end - - - @event_id = event_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - event_id == o.event_id && - timestamp == o.timestamp && - event_type == o.event_type && - account_id == o.account_id && - funding_account_id == o.funding_account_id && - transfer_id == o.transfer_id && - origination_account_id == o.origination_account_id && - transfer_type == o.transfer_type && - transfer_amount == o.transfer_amount && - failure_reason == o.failure_reason && - sweep_id == o.sweep_id && - sweep_amount == o.sweep_amount && - refund_id == o.refund_id && - originator_client_id == o.originator_client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [event_id, timestamp, event_type, account_id, funding_account_id, transfer_id, origination_account_id, transfer_type, transfer_amount, failure_reason, sweep_id, sweep_amount, refund_id, originator_client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_event_list_request.rb b/lib/plaid/models/transfer_event_list_request.rb deleted file mode 100644 index f80754b59..000000000 --- a/lib/plaid/models/transfer_event_list_request.rb +++ /dev/null @@ -1,431 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/event/list` - class TransferEventListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The start datetime of transfers to list. This should be in RFC 3339 format (i.e. `2019-12-06T22:35:49Z`) - attr_accessor :start_date - - # The end datetime of transfers to list. This should be in RFC 3339 format (i.e. `2019-12-06T22:35:49Z`) - attr_accessor :end_date - - # Plaid’s unique identifier for a transfer. - attr_accessor :transfer_id - - # The account ID to get events for all transactions to/from an account. - attr_accessor :account_id - - attr_accessor :transfer_type - - # Filter events by event type. - attr_accessor :event_types - - # Plaid’s unique identifier for a sweep. - attr_accessor :sweep_id - - # The maximum number of transfer events to return. If the number of events matching the above parameters is greater than `count`, the most recent events will be returned. - attr_accessor :count - - # The offset into the list of transfer events. When `count`=25 and `offset`=0, the first 25 events will be returned. When `count`=25 and `offset`=25, the next 25 events will be returned. - attr_accessor :offset - - # The origination account ID to get events for transfers from a specific origination account. - attr_accessor :origination_account_id - - # Filter transfer events to only those with the specified originator client. - attr_accessor :originator_client_id - - # Filter transfer events to only those with the specified `funding_account_id`. - attr_accessor :funding_account_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'transfer_id' => :'transfer_id', - :'account_id' => :'account_id', - :'transfer_type' => :'transfer_type', - :'event_types' => :'event_types', - :'sweep_id' => :'sweep_id', - :'count' => :'count', - :'offset' => :'offset', - :'origination_account_id' => :'origination_account_id', - :'originator_client_id' => :'originator_client_id', - :'funding_account_id' => :'funding_account_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'start_date' => :'Time', - :'end_date' => :'Time', - :'transfer_id' => :'String', - :'account_id' => :'String', - :'transfer_type' => :'TransferEventListTransferType', - :'event_types' => :'Array', - :'sweep_id' => :'String', - :'count' => :'Integer', - :'offset' => :'Integer', - :'origination_account_id' => :'String', - :'originator_client_id' => :'String', - :'funding_account_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'start_date', - :'end_date', - :'transfer_id', - :'account_id', - :'transfer_type', - :'count', - :'offset', - :'origination_account_id', - :'originator_client_id', - :'funding_account_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferEventListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferEventListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'transfer_id') - self.transfer_id = attributes[:'transfer_id'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'transfer_type') - self.transfer_type = attributes[:'transfer_type'] - end - - if attributes.key?(:'event_types') - if (value = attributes[:'event_types']).is_a?(Array) - self.event_types = value - end - end - - if attributes.key?(:'sweep_id') - self.sweep_id = attributes[:'sweep_id'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 25 - end - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - else - self.offset = 0 - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@count.nil? && @count > 25 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 25.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - if !@offset.nil? && @offset < 0 - invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@count.nil? && @count > 25 - return false if !@count.nil? && @count < 1 - return false if !@offset.nil? && @offset < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 25 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 25.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Custom attribute writer method with validation - # @param [Object] offset Value to be assigned - def offset=(offset) - if !offset.nil? && offset < 0 - fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.' - end - - - @offset = offset - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - start_date == o.start_date && - end_date == o.end_date && - transfer_id == o.transfer_id && - account_id == o.account_id && - transfer_type == o.transfer_type && - event_types == o.event_types && - sweep_id == o.sweep_id && - count == o.count && - offset == o.offset && - origination_account_id == o.origination_account_id && - originator_client_id == o.originator_client_id && - funding_account_id == o.funding_account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, start_date, end_date, transfer_id, account_id, transfer_type, event_types, sweep_id, count, offset, origination_account_id, originator_client_id, funding_account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_event_list_response.rb b/lib/plaid/models/transfer_event_list_response.rb deleted file mode 100644 index 2d41ce896..000000000 --- a/lib/plaid/models/transfer_event_list_response.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/event/list` - class TransferEventListResponse - attr_accessor :transfer_events - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transfer_events' => :'transfer_events', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transfer_events' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferEventListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferEventListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transfer_events') - if (value = attributes[:'transfer_events']).is_a?(Array) - self.transfer_events = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transfer_events.nil? - invalid_properties.push('invalid value for "transfer_events", transfer_events cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transfer_events.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transfer_events == o.transfer_events && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transfer_events, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_event_list_transfer_type.rb b/lib/plaid/models/transfer_event_list_transfer_type.rb deleted file mode 100644 index 6ad3f39f4..000000000 --- a/lib/plaid/models/transfer_event_list_transfer_type.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferEventListTransferType - DEBIT = "debit".freeze - CREDIT = "credit".freeze - NULL = "null".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_event_sync_request.rb b/lib/plaid/models/transfer_event_sync_request.rb deleted file mode 100644 index a95ad322f..000000000 --- a/lib/plaid/models/transfer_event_sync_request.rb +++ /dev/null @@ -1,306 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/event/sync` - class TransferEventSyncRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The latest (largest) `event_id` fetched via the sync endpoint, or 0 initially. - attr_accessor :after_id - - # The maximum number of transfer events to return. - attr_accessor :count - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'after_id' => :'after_id', - :'count' => :'count' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'after_id' => :'Integer', - :'count' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'count' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferEventSyncRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferEventSyncRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'after_id') - self.after_id = attributes[:'after_id'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 25 - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @after_id.nil? - invalid_properties.push('invalid value for "after_id", after_id cannot be nil.') - end - - if @after_id < 0 - invalid_properties.push('invalid value for "after_id", must be greater than or equal to 0.') - end - - - if !@count.nil? && @count > 25 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 25.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @after_id.nil? - return false if @after_id < 0 - return false if !@count.nil? && @count > 25 - return false if !@count.nil? && @count < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] after_id Value to be assigned - def after_id=(after_id) - if after_id.nil? - fail ArgumentError, 'after_id cannot be nil' - end - - if after_id < 0 - fail ArgumentError, 'invalid value for "after_id", must be greater than or equal to 0.' - end - - - @after_id = after_id - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 25 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 25.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - after_id == o.after_id && - count == o.count - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, after_id, count].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_event_sync_response.rb b/lib/plaid/models/transfer_event_sync_response.rb deleted file mode 100644 index f2fc5c561..000000000 --- a/lib/plaid/models/transfer_event_sync_response.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/event/sync` - class TransferEventSyncResponse - attr_accessor :transfer_events - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transfer_events' => :'transfer_events', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transfer_events' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferEventSyncResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferEventSyncResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transfer_events') - if (value = attributes[:'transfer_events']).is_a?(Array) - self.transfer_events = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transfer_events.nil? - invalid_properties.push('invalid value for "transfer_events", transfer_events cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transfer_events.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transfer_events == o.transfer_events && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transfer_events, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_event_type.rb b/lib/plaid/models/transfer_event_type.rb deleted file mode 100644 index c6d3d33dd..000000000 --- a/lib/plaid/models/transfer_event_type.rb +++ /dev/null @@ -1,51 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferEventType - PENDING = "pending".freeze - CANCELLED = "cancelled".freeze - FAILED = "failed".freeze - POSTED = "posted".freeze - SETTLED = "settled".freeze - RETURNED = "returned".freeze - SWEPT = "swept".freeze - SWEPT_SETTLED = "swept_settled".freeze - RETURN_SWEPT = "return_swept".freeze - SWEEP_PENDING = "sweep.pending".freeze - SWEEP_POSTED = "sweep.posted".freeze - SWEEP_SETTLED = "sweep.settled".freeze - SWEEP_RETURNED = "sweep.returned".freeze - SWEEP_FAILED = "sweep.failed".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_events_update_webhook.rb b/lib/plaid/models/transfer_events_update_webhook.rb deleted file mode 100644 index a5fe79b5c..000000000 --- a/lib/plaid/models/transfer_events_update_webhook.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when new transfer events are available. Receiving this webhook indicates you should fetch the new events from `/transfer/event/sync`. - class TransferEventsUpdateWebhook - # `TRANSFER` - attr_accessor :webhook_type - - # `TRANSFER_EVENTS_UPDATE` - attr_accessor :webhook_code - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferEventsUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferEventsUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_expected_sweep_settlement_schedule_item.rb b/lib/plaid/models/transfer_expected_sweep_settlement_schedule_item.rb deleted file mode 100644 index ee8b33e18..000000000 --- a/lib/plaid/models/transfer_expected_sweep_settlement_schedule_item.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines an expected sweep date and amount. - class TransferExpectedSweepSettlementScheduleItem - # The settlement date of a sweep for this transfer. - attr_accessor :sweep_settlement_date - - # The accumulated amount that has been swept by `sweep_settlement_date`. - attr_accessor :swept_settled_amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sweep_settlement_date' => :'sweep_settlement_date', - :'swept_settled_amount' => :'swept_settled_amount' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sweep_settlement_date' => :'Date', - :'swept_settled_amount' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferExpectedSweepSettlementScheduleItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferExpectedSweepSettlementScheduleItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sweep_settlement_date') - self.sweep_settlement_date = attributes[:'sweep_settlement_date'] - end - - if attributes.key?(:'swept_settled_amount') - self.swept_settled_amount = attributes[:'swept_settled_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @sweep_settlement_date.nil? - invalid_properties.push('invalid value for "sweep_settlement_date", sweep_settlement_date cannot be nil.') - end - - if @swept_settled_amount.nil? - invalid_properties.push('invalid value for "swept_settled_amount", swept_settled_amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @sweep_settlement_date.nil? - return false if @swept_settled_amount.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sweep_settlement_date == o.sweep_settlement_date && - swept_settled_amount == o.swept_settled_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sweep_settlement_date, swept_settled_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_failure.rb b/lib/plaid/models/transfer_failure.rb deleted file mode 100644 index 444625bb8..000000000 --- a/lib/plaid/models/transfer_failure.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The failure reason if the event type for a transfer is `\"failed\"` or `\"returned\"`. Null value otherwise. - class TransferFailure - # The ACH return code, e.g. `R01`. A return code will be provided if and only if the transfer status is `returned`. For a full listing of ACH return codes, see [Transfer errors](https://plaid.com/docs/errors/transfer/#ach-return-codes). - attr_accessor :ach_return_code - - # A human-readable description of the reason for the failure or reversal. - attr_accessor :description - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ach_return_code' => :'ach_return_code', - :'description' => :'description' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ach_return_code' => :'String', - :'description' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'ach_return_code', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferFailure` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferFailure`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ach_return_code') - self.ach_return_code = attributes[:'ach_return_code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ach_return_code == o.ach_return_code && - description == o.description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ach_return_code, description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_funding_account.rb b/lib/plaid/models/transfer_funding_account.rb deleted file mode 100644 index 5753c3ef7..000000000 --- a/lib/plaid/models/transfer_funding_account.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The originator's funding account, linked with Plaid Link or `/transfer/migrate_account`. - class TransferFundingAccount - # The access token associated with the Item data is being requested for. - attr_accessor :access_token - - # The Plaid `account_id` for the newly created Item. - attr_accessor :account_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'access_token' => :'access_token', - :'account_id' => :'account_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'access_token' => :'String', - :'account_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferFundingAccount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferFundingAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @account_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - access_token == o.access_token && - account_id == o.account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [access_token, account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_get_request.rb b/lib/plaid/models/transfer_get_request.rb deleted file mode 100644 index 6a0ff7be3..000000000 --- a/lib/plaid/models/transfer_get_request.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/get` - class TransferGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a transfer. - attr_accessor :transfer_id - - # The Plaid client ID of the transfer originator. Should only be present if `client_id` is a third-party sender (TPS). - attr_accessor :originator_client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'transfer_id' => :'transfer_id', - :'originator_client_id' => :'originator_client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'transfer_id' => :'String', - :'originator_client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'originator_client_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'transfer_id') - self.transfer_id = attributes[:'transfer_id'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transfer_id.nil? - invalid_properties.push('invalid value for "transfer_id", transfer_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transfer_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - transfer_id == o.transfer_id && - originator_client_id == o.originator_client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, transfer_id, originator_client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_get_response.rb b/lib/plaid/models/transfer_get_response.rb deleted file mode 100644 index 237d3fc76..000000000 --- a/lib/plaid/models/transfer_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/get` - class TransferGetResponse - attr_accessor :transfer - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transfer' => :'transfer', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transfer' => :'Transfer', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transfer') - self.transfer = attributes[:'transfer'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transfer.nil? - invalid_properties.push('invalid value for "transfer", transfer cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transfer.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transfer == o.transfer && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transfer, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_intent_authorization_decision.rb b/lib/plaid/models/transfer_intent_authorization_decision.rb deleted file mode 100644 index 64a49854d..000000000 --- a/lib/plaid/models/transfer_intent_authorization_decision.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferIntentAuthorizationDecision - APPROVED = "APPROVED".freeze - DECLINED = "DECLINED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_intent_create.rb b/lib/plaid/models/transfer_intent_create.rb deleted file mode 100644 index ac6511996..000000000 --- a/lib/plaid/models/transfer_intent_create.rb +++ /dev/null @@ -1,444 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Represents a transfer intent within Transfer UI. - class TransferIntentCreate - # Plaid's unique identifier for the transfer intent object. - attr_accessor :id - - # The datetime the transfer was created. This will be of the form `2006-01-02T15:04:05Z`. - attr_accessor :created - - attr_accessor :status - - # 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. - attr_accessor :account_id - - # Plaid’s unique identifier for the origination account for the intent. If not provided, the default account will be used. - attr_accessor :origination_account_id - - # The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited. - attr_accessor :funding_account_id - - # 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. - attr_accessor :amount - - attr_accessor :mode - - attr_accessor :network - - attr_accessor :ach_class - - attr_accessor :user - - # A description for the underlying transfer. Maximum of 8 characters. - attr_accessor :description - - # 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 - attr_accessor :metadata - - # The currency of the transfer amount, e.g. \"USD\" - attr_accessor :iso_currency_code - - # When `true`, the transfer requires a `GUARANTEED` decision by Plaid to proceed (Guarantee customers only). - attr_accessor :require_guarantee - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'created' => :'created', - :'status' => :'status', - :'account_id' => :'account_id', - :'origination_account_id' => :'origination_account_id', - :'funding_account_id' => :'funding_account_id', - :'amount' => :'amount', - :'mode' => :'mode', - :'network' => :'network', - :'ach_class' => :'ach_class', - :'user' => :'user', - :'description' => :'description', - :'metadata' => :'metadata', - :'iso_currency_code' => :'iso_currency_code', - :'require_guarantee' => :'require_guarantee' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'created' => :'Time', - :'status' => :'TransferIntentStatus', - :'account_id' => :'String', - :'origination_account_id' => :'String', - :'funding_account_id' => :'String', - :'amount' => :'String', - :'mode' => :'TransferIntentCreateMode', - :'network' => :'TransferIntentCreateNetwork', - :'ach_class' => :'ACHClass', - :'user' => :'TransferUserInResponse', - :'description' => :'String', - :'metadata' => :'Hash', - :'iso_currency_code' => :'String', - :'require_guarantee' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_id', - :'metadata', - :'require_guarantee' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferIntentCreate` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferIntentCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'created') - self.created = attributes[:'created'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'mode') - self.mode = attributes[:'mode'] - end - - if attributes.key?(:'network') - self.network = attributes[:'network'] - else - self.network = 'same-day-ach' - end - - if attributes.key?(:'ach_class') - self.ach_class = attributes[:'ach_class'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Hash) - self.metadata = value - end - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'require_guarantee') - self.require_guarantee = attributes[:'require_guarantee'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @created.nil? - invalid_properties.push('invalid value for "created", created cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @origination_account_id.nil? - invalid_properties.push('invalid value for "origination_account_id", origination_account_id cannot be nil.') - end - - if @funding_account_id.nil? - invalid_properties.push('invalid value for "funding_account_id", funding_account_id cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @mode.nil? - invalid_properties.push('invalid value for "mode", mode cannot be nil.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @created.nil? - return false if @status.nil? - return false if @origination_account_id.nil? - return false if @funding_account_id.nil? - return false if @amount.nil? - return false if @mode.nil? - return false if @user.nil? - return false if @description.nil? - return false if !@metadata.nil? && @metadata.length > 50 - return false if @iso_currency_code.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] metadata Value to be assigned - def metadata=(metadata) - - @metadata = metadata - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - created == o.created && - status == o.status && - account_id == o.account_id && - origination_account_id == o.origination_account_id && - funding_account_id == o.funding_account_id && - amount == o.amount && - mode == o.mode && - network == o.network && - ach_class == o.ach_class && - user == o.user && - description == o.description && - metadata == o.metadata && - iso_currency_code == o.iso_currency_code && - require_guarantee == o.require_guarantee - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, created, status, account_id, origination_account_id, funding_account_id, amount, mode, network, ach_class, user, description, metadata, iso_currency_code, require_guarantee].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_intent_create_mode.rb b/lib/plaid/models/transfer_intent_create_mode.rb deleted file mode 100644 index 633f6262d..000000000 --- a/lib/plaid/models/transfer_intent_create_mode.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferIntentCreateMode - PAYMENT = "PAYMENT".freeze - DISBURSEMENT = "DISBURSEMENT".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_intent_create_network.rb b/lib/plaid/models/transfer_intent_create_network.rb deleted file mode 100644 index 0dff4ffb7..000000000 --- a/lib/plaid/models/transfer_intent_create_network.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferIntentCreateNetwork - ACH = "ach".freeze - SAME_DAY_ACH = "same-day-ach".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_intent_create_request.rb b/lib/plaid/models/transfer_intent_create_request.rb deleted file mode 100644 index dc9e6abe7..000000000 --- a/lib/plaid/models/transfer_intent_create_request.rb +++ /dev/null @@ -1,439 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/intent/create` - class TransferIntentCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The Plaid `account_id` corresponding to the end-user account that will be debited or credited. - attr_accessor :account_id - - # Specify the account used to fund the transfer. Should be specified if using legacy funding methods only. If using Plaid Ledger, leave this field blank. Customers can find a list of `funding_account_id`s in the Accounts page of your Plaid Dashboard, under the \"Account ID\" column. If this field is left blank and you are using legacy funding methods, this will default to the default `funding_account_id` specified during onboarding. Otherwise, Plaid Ledger will be used. - attr_accessor :funding_account_id - - attr_accessor :mode - - attr_accessor :network - - # 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. - attr_accessor :amount - - # A description for the underlying transfer. Maximum of 15 characters. - attr_accessor :description - - attr_accessor :ach_class - - # Plaid’s unique identifier for the origination account for the intent. If not provided, the default account will be used. - attr_accessor :origination_account_id - - attr_accessor :user - - # 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 - attr_accessor :metadata - - # The currency of the transfer amount, e.g. \"USD\" - attr_accessor :iso_currency_code - - # When `true`, the transfer requires a `GUARANTEED` decision by Plaid to proceed (Guarantee customers only). - attr_accessor :require_guarantee - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'account_id' => :'account_id', - :'funding_account_id' => :'funding_account_id', - :'mode' => :'mode', - :'network' => :'network', - :'amount' => :'amount', - :'description' => :'description', - :'ach_class' => :'ach_class', - :'origination_account_id' => :'origination_account_id', - :'user' => :'user', - :'metadata' => :'metadata', - :'iso_currency_code' => :'iso_currency_code', - :'require_guarantee' => :'require_guarantee' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'account_id' => :'String', - :'funding_account_id' => :'String', - :'mode' => :'TransferIntentCreateMode', - :'network' => :'TransferIntentCreateNetwork', - :'amount' => :'String', - :'description' => :'String', - :'ach_class' => :'ACHClass', - :'origination_account_id' => :'String', - :'user' => :'TransferUserInRequest', - :'metadata' => :'Hash', - :'iso_currency_code' => :'String', - :'require_guarantee' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_id', - :'funding_account_id', - :'origination_account_id', - :'metadata', - :'require_guarantee' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferIntentCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferIntentCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - - if attributes.key?(:'mode') - self.mode = attributes[:'mode'] - end - - if attributes.key?(:'network') - self.network = attributes[:'network'] - else - self.network = 'same-day-ach' - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'ach_class') - self.ach_class = attributes[:'ach_class'] - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Hash) - self.metadata = value - end - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'require_guarantee') - self.require_guarantee = attributes[:'require_guarantee'] - else - self.require_guarantee = false - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @mode.nil? - invalid_properties.push('invalid value for "mode", mode cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @description.to_s.length > 15 - invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 15.') - end - - if @description.to_s.length < 1 - invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.') - end - - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @mode.nil? - return false if @amount.nil? - return false if @description.nil? - return false if @description.to_s.length > 15 - return false if @description.to_s.length < 1 - return false if @user.nil? - return false if !@metadata.nil? && @metadata.length > 50 - true - end - - # Custom attribute writer method with validation - # @param [Object] description Value to be assigned - def description=(description) - if description.nil? - fail ArgumentError, 'description cannot be nil' - end - - if description.to_s.length > 15 - fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 15.' - end - - if description.to_s.length < 1 - fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.' - end - - - @description = description - end - - # Custom attribute writer method with validation - # @param [Object] metadata Value to be assigned - def metadata=(metadata) - - @metadata = metadata - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - account_id == o.account_id && - funding_account_id == o.funding_account_id && - mode == o.mode && - network == o.network && - amount == o.amount && - description == o.description && - ach_class == o.ach_class && - origination_account_id == o.origination_account_id && - user == o.user && - metadata == o.metadata && - iso_currency_code == o.iso_currency_code && - require_guarantee == o.require_guarantee - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, account_id, funding_account_id, mode, network, amount, description, ach_class, origination_account_id, user, metadata, iso_currency_code, require_guarantee].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_intent_create_response.rb b/lib/plaid/models/transfer_intent_create_response.rb deleted file mode 100644 index 4f2bd9761..000000000 --- a/lib/plaid/models/transfer_intent_create_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/intent/create` - class TransferIntentCreateResponse - attr_accessor :transfer_intent - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transfer_intent' => :'transfer_intent', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transfer_intent' => :'TransferIntentCreate', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferIntentCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferIntentCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transfer_intent') - self.transfer_intent = attributes[:'transfer_intent'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transfer_intent.nil? - invalid_properties.push('invalid value for "transfer_intent", transfer_intent cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transfer_intent.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transfer_intent == o.transfer_intent && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transfer_intent, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_intent_get.rb b/lib/plaid/models/transfer_intent_get.rb deleted file mode 100644 index 1ef427604..000000000 --- a/lib/plaid/models/transfer_intent_get.rb +++ /dev/null @@ -1,505 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Represents a transfer intent within Transfer UI. - class TransferIntentGet - # Plaid's unique identifier for a transfer intent object. - attr_accessor :id - - # The datetime the transfer was created. This will be of the form `2006-01-02T15:04:05Z`. - attr_accessor :created - - attr_accessor :status - - # Plaid's unique identifier for the transfer created through the UI. Returned only if the transfer was successfully created. Null value otherwise. - attr_accessor :transfer_id - - attr_accessor :failure_reason - - attr_accessor :authorization_decision - - attr_accessor :authorization_decision_rationale - - # The Plaid `account_id` for the account that will be debited or credited. Returned only if `account_id` was set on intent creation. - attr_accessor :account_id - - # Plaid’s unique identifier for the origination account used for the transfer. - attr_accessor :origination_account_id - - # The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited. - attr_accessor :funding_account_id - - # 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. - attr_accessor :amount - - attr_accessor :mode - - attr_accessor :network - - attr_accessor :ach_class - - attr_accessor :user - - # A description for the underlying transfer. Maximum of 8 characters. - attr_accessor :description - - # 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 - attr_accessor :metadata - - # The currency of the transfer amount, e.g. \"USD\" - attr_accessor :iso_currency_code - - # When `true`, the transfer requires a `GUARANTEED` decision by Plaid to proceed (Guarantee customers only). - attr_accessor :require_guarantee - - attr_accessor :guarantee_decision - - attr_accessor :guarantee_decision_rationale - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'created' => :'created', - :'status' => :'status', - :'transfer_id' => :'transfer_id', - :'failure_reason' => :'failure_reason', - :'authorization_decision' => :'authorization_decision', - :'authorization_decision_rationale' => :'authorization_decision_rationale', - :'account_id' => :'account_id', - :'origination_account_id' => :'origination_account_id', - :'funding_account_id' => :'funding_account_id', - :'amount' => :'amount', - :'mode' => :'mode', - :'network' => :'network', - :'ach_class' => :'ach_class', - :'user' => :'user', - :'description' => :'description', - :'metadata' => :'metadata', - :'iso_currency_code' => :'iso_currency_code', - :'require_guarantee' => :'require_guarantee', - :'guarantee_decision' => :'guarantee_decision', - :'guarantee_decision_rationale' => :'guarantee_decision_rationale' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'created' => :'Time', - :'status' => :'TransferIntentStatus', - :'transfer_id' => :'String', - :'failure_reason' => :'TransferIntentGetFailureReason', - :'authorization_decision' => :'TransferIntentAuthorizationDecision', - :'authorization_decision_rationale' => :'TransferAuthorizationDecisionRationale', - :'account_id' => :'String', - :'origination_account_id' => :'String', - :'funding_account_id' => :'String', - :'amount' => :'String', - :'mode' => :'TransferIntentCreateMode', - :'network' => :'TransferIntentCreateNetwork', - :'ach_class' => :'ACHClass', - :'user' => :'TransferUserInResponse', - :'description' => :'String', - :'metadata' => :'Hash', - :'iso_currency_code' => :'String', - :'require_guarantee' => :'Boolean', - :'guarantee_decision' => :'TransferAuthorizationGuaranteeDecision', - :'guarantee_decision_rationale' => :'TransferAuthorizationGuaranteeDecisionRationale' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'transfer_id', - :'failure_reason', - :'authorization_decision', - :'authorization_decision_rationale', - :'account_id', - :'metadata', - :'require_guarantee', - :'guarantee_decision', - :'guarantee_decision_rationale' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferIntentGet` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferIntentGet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'created') - self.created = attributes[:'created'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'transfer_id') - self.transfer_id = attributes[:'transfer_id'] - end - - if attributes.key?(:'failure_reason') - self.failure_reason = attributes[:'failure_reason'] - end - - if attributes.key?(:'authorization_decision') - self.authorization_decision = attributes[:'authorization_decision'] - end - - if attributes.key?(:'authorization_decision_rationale') - self.authorization_decision_rationale = attributes[:'authorization_decision_rationale'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'mode') - self.mode = attributes[:'mode'] - end - - if attributes.key?(:'network') - self.network = attributes[:'network'] - else - self.network = 'same-day-ach' - end - - if attributes.key?(:'ach_class') - self.ach_class = attributes[:'ach_class'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'metadata') - if (value = attributes[:'metadata']).is_a?(Hash) - self.metadata = value - end - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'require_guarantee') - self.require_guarantee = attributes[:'require_guarantee'] - end - - if attributes.key?(:'guarantee_decision') - self.guarantee_decision = attributes[:'guarantee_decision'] - end - - if attributes.key?(:'guarantee_decision_rationale') - self.guarantee_decision_rationale = attributes[:'guarantee_decision_rationale'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @created.nil? - invalid_properties.push('invalid value for "created", created cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @origination_account_id.nil? - invalid_properties.push('invalid value for "origination_account_id", origination_account_id cannot be nil.') - end - - if @funding_account_id.nil? - invalid_properties.push('invalid value for "funding_account_id", funding_account_id cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @mode.nil? - invalid_properties.push('invalid value for "mode", mode cannot be nil.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @created.nil? - return false if @status.nil? - return false if @origination_account_id.nil? - return false if @funding_account_id.nil? - return false if @amount.nil? - return false if @mode.nil? - return false if @user.nil? - return false if @description.nil? - return false if !@metadata.nil? && @metadata.length > 50 - return false if @iso_currency_code.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] metadata Value to be assigned - def metadata=(metadata) - - @metadata = metadata - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - created == o.created && - status == o.status && - transfer_id == o.transfer_id && - failure_reason == o.failure_reason && - authorization_decision == o.authorization_decision && - authorization_decision_rationale == o.authorization_decision_rationale && - account_id == o.account_id && - origination_account_id == o.origination_account_id && - funding_account_id == o.funding_account_id && - amount == o.amount && - mode == o.mode && - network == o.network && - ach_class == o.ach_class && - user == o.user && - description == o.description && - metadata == o.metadata && - iso_currency_code == o.iso_currency_code && - require_guarantee == o.require_guarantee && - guarantee_decision == o.guarantee_decision && - guarantee_decision_rationale == o.guarantee_decision_rationale - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, created, status, transfer_id, failure_reason, authorization_decision, authorization_decision_rationale, account_id, origination_account_id, funding_account_id, amount, mode, network, ach_class, user, description, metadata, iso_currency_code, require_guarantee, guarantee_decision, guarantee_decision_rationale].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_intent_get_failure_reason.rb b/lib/plaid/models/transfer_intent_get_failure_reason.rb deleted file mode 100644 index 80d56f780..000000000 --- a/lib/plaid/models/transfer_intent_get_failure_reason.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The reason for a failed transfer intent. Returned only if the transfer intent status is `failed`. Null otherwise. - class TransferIntentGetFailureReason - # A broad categorization of the error. - attr_accessor :error_type - - # A code representing the reason for a failed transfer intent (i.e., an API error or the authorization being declined). - attr_accessor :error_code - - # A human-readable description of the code associated with a failed transfer intent. - attr_accessor :error_message - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'error_type' => :'error_type', - :'error_code' => :'error_code', - :'error_message' => :'error_message' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'error_type' => :'String', - :'error_code' => :'String', - :'error_message' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferIntentGetFailureReason` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferIntentGetFailureReason`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'error_type') - self.error_type = attributes[:'error_type'] - end - - if attributes.key?(:'error_code') - self.error_code = attributes[:'error_code'] - end - - if attributes.key?(:'error_message') - self.error_message = attributes[:'error_message'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - error_type == o.error_type && - error_code == o.error_code && - error_message == o.error_message - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [error_type, error_code, error_message].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_intent_get_request.rb b/lib/plaid/models/transfer_intent_get_request.rb deleted file mode 100644 index 11a6582d4..000000000 --- a/lib/plaid/models/transfer_intent_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/intent/get` - class TransferIntentGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid's unique identifier for a transfer intent object. - attr_accessor :transfer_intent_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'transfer_intent_id' => :'transfer_intent_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'transfer_intent_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferIntentGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferIntentGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'transfer_intent_id') - self.transfer_intent_id = attributes[:'transfer_intent_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transfer_intent_id.nil? - invalid_properties.push('invalid value for "transfer_intent_id", transfer_intent_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transfer_intent_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - transfer_intent_id == o.transfer_intent_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, transfer_intent_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_intent_get_response.rb b/lib/plaid/models/transfer_intent_get_response.rb deleted file mode 100644 index d3ea34c9a..000000000 --- a/lib/plaid/models/transfer_intent_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/intent/get` - class TransferIntentGetResponse - attr_accessor :transfer_intent - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transfer_intent' => :'transfer_intent', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transfer_intent' => :'TransferIntentGet', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferIntentGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferIntentGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transfer_intent') - self.transfer_intent = attributes[:'transfer_intent'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transfer_intent.nil? - invalid_properties.push('invalid value for "transfer_intent", transfer_intent cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transfer_intent.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transfer_intent == o.transfer_intent && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transfer_intent, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_intent_status.rb b/lib/plaid/models/transfer_intent_status.rb deleted file mode 100644 index 0ad0098ff..000000000 --- a/lib/plaid/models/transfer_intent_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferIntentStatus - PENDING = "PENDING".freeze - SUCCEEDED = "SUCCEEDED".freeze - FAILED = "FAILED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_ledger_balance.rb b/lib/plaid/models/transfer_ledger_balance.rb deleted file mode 100644 index e7587ccf3..000000000 --- a/lib/plaid/models/transfer_ledger_balance.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the balance of the ledger held with Plaid. - class TransferLedgerBalance - # The amount of this balance available for use (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :available - - # The amount of pending funds that are in processing (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :pending - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'available' => :'available', - :'pending' => :'pending' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'available' => :'String', - :'pending' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferLedgerBalance` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferLedgerBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'available') - self.available = attributes[:'available'] - end - - if attributes.key?(:'pending') - self.pending = attributes[:'pending'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @available.nil? - invalid_properties.push('invalid value for "available", available cannot be nil.') - end - - if @pending.nil? - invalid_properties.push('invalid value for "pending", pending cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @available.nil? - return false if @pending.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - available == o.available && - pending == o.pending - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [available, pending].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_ledger_deposit_request.rb b/lib/plaid/models/transfer_ledger_deposit_request.rb deleted file mode 100644 index 6494a55d9..000000000 --- a/lib/plaid/models/transfer_ledger_deposit_request.rb +++ /dev/null @@ -1,368 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/ledger/deposit` - class TransferLedgerDepositRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Client ID of the customer that owns the Ledger balance. This is so Plaid knows which of your customers to payout or collect funds. Only applicable for [Platform customers](https://plaid.com/docs/transfer/application/#originators-vs-platforms). Do not include if you’re paying out to yourself. - attr_accessor :originator_client_id - - # Specify which funding account linked to this Plaid Ledger to use. Customers can find a list of `funding_account_id`s in the Accounts page of your Plaid Dashboard, under the \"Account ID\" column. If this field is left blank, this will default to the default `funding_account_id` specified during onboarding. If an `originator_client_id` is specified, the `funding_account_id` must belong to the specified originator, and if `funding_account_id` is left blank, the originator's default `funding_account_id` will be used. - attr_accessor :funding_account_id - - # A positive amount of how much will be deposited into ledger (decimal string with two digits of precision e.g. \"5.50\"). - attr_accessor :amount - - # The description of the deposit that will be passed to the receiving bank (up to 10 characters). Note that banks utilize this field differently, and may or may not show it on the bank statement. - attr_accessor :description - - # A unique key provided by the client, per unique ledger deposit. Maximum of 50 characters. The API supports idempotency for safely retrying the request without accidentally performing the same operation twice. For example, if a request to create a ledger deposit fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single deposit is created. - attr_accessor :idempotency_key - - attr_accessor :network - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'originator_client_id' => :'originator_client_id', - :'funding_account_id' => :'funding_account_id', - :'amount' => :'amount', - :'description' => :'description', - :'idempotency_key' => :'idempotency_key', - :'network' => :'network' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'originator_client_id' => :'String', - :'funding_account_id' => :'String', - :'amount' => :'String', - :'description' => :'String', - :'idempotency_key' => :'String', - :'network' => :'TransferACHNetwork' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'originator_client_id', - :'funding_account_id', - :'description', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferLedgerDepositRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferLedgerDepositRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'idempotency_key') - self.idempotency_key = attributes[:'idempotency_key'] - end - - if attributes.key?(:'network') - self.network = attributes[:'network'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if !@description.nil? && @description.to_s.length > 10 - invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 10.') - end - - - if @idempotency_key.nil? - invalid_properties.push('invalid value for "idempotency_key", idempotency_key cannot be nil.') - end - - if @idempotency_key.to_s.length > 50 - invalid_properties.push('invalid value for "idempotency_key", the character length must be smaller than or equal to 50.') - end - - - if @network.nil? - invalid_properties.push('invalid value for "network", network cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amount.nil? - return false if !@description.nil? && @description.to_s.length > 10 - return false if @idempotency_key.nil? - return false if @idempotency_key.to_s.length > 50 - return false if @network.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] description Value to be assigned - def description=(description) - if !description.nil? && description.to_s.length > 10 - fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 10.' - end - - - @description = description - end - - # Custom attribute writer method with validation - # @param [Object] idempotency_key Value to be assigned - def idempotency_key=(idempotency_key) - if idempotency_key.nil? - fail ArgumentError, 'idempotency_key cannot be nil' - end - - if idempotency_key.to_s.length > 50 - fail ArgumentError, 'invalid value for "idempotency_key", the character length must be smaller than or equal to 50.' - end - - - @idempotency_key = idempotency_key - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - originator_client_id == o.originator_client_id && - funding_account_id == o.funding_account_id && - amount == o.amount && - description == o.description && - idempotency_key == o.idempotency_key && - network == o.network - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, originator_client_id, funding_account_id, amount, description, idempotency_key, network].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_ledger_deposit_response.rb b/lib/plaid/models/transfer_ledger_deposit_response.rb deleted file mode 100644 index b2662283e..000000000 --- a/lib/plaid/models/transfer_ledger_deposit_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/ledger/deposit` - class TransferLedgerDepositResponse - attr_accessor :sweep - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sweep' => :'sweep', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sweep' => :'TransferSweep', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferLedgerDepositResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferLedgerDepositResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sweep') - self.sweep = attributes[:'sweep'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @sweep.nil? - invalid_properties.push('invalid value for "sweep", sweep cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @sweep.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sweep == o.sweep && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sweep, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_ledger_distribute_request.rb b/lib/plaid/models/transfer_ledger_distribute_request.rb deleted file mode 100644 index a9be2778f..000000000 --- a/lib/plaid/models/transfer_ledger_distribute_request.rb +++ /dev/null @@ -1,322 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/ledger/distribute` - class TransferLedgerDistributeRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The client to pull money from. Must be the platform itself or its originator. One of `from_client_id` and `to_client_id` must be the platform's `client_id`. - attr_accessor :from_client_id - - # The client to credit money to. Must be the platform itself or its originator. One of `from_client_id` and `to_client_id` must be the platform's `client_id`. - attr_accessor :to_client_id - - # The amount to move (decimal string with two digits of precision e.g. \"10.00\"). Amount must be positive. - attr_accessor :amount - - # A unique key provided by the client, per unique ledger distribute. Maximum of 50 characters. The API supports idempotency for safely retrying the request without accidentally performing the same operation twice. For example, if a request to create a ledger distribute fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single distribute is created. - attr_accessor :idempotency_key - - # An optional description for the ledger distribute operation. - attr_accessor :description - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'from_client_id' => :'from_client_id', - :'to_client_id' => :'to_client_id', - :'amount' => :'amount', - :'idempotency_key' => :'idempotency_key', - :'description' => :'description' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'from_client_id' => :'String', - :'to_client_id' => :'String', - :'amount' => :'String', - :'idempotency_key' => :'String', - :'description' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferLedgerDistributeRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferLedgerDistributeRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'from_client_id') - self.from_client_id = attributes[:'from_client_id'] - end - - if attributes.key?(:'to_client_id') - self.to_client_id = attributes[:'to_client_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'idempotency_key') - self.idempotency_key = attributes[:'idempotency_key'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @from_client_id.nil? - invalid_properties.push('invalid value for "from_client_id", from_client_id cannot be nil.') - end - - if @to_client_id.nil? - invalid_properties.push('invalid value for "to_client_id", to_client_id cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @idempotency_key.nil? - invalid_properties.push('invalid value for "idempotency_key", idempotency_key cannot be nil.') - end - - if @idempotency_key.to_s.length > 50 - invalid_properties.push('invalid value for "idempotency_key", the character length must be smaller than or equal to 50.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @from_client_id.nil? - return false if @to_client_id.nil? - return false if @amount.nil? - return false if @idempotency_key.nil? - return false if @idempotency_key.to_s.length > 50 - true - end - - # Custom attribute writer method with validation - # @param [Object] idempotency_key Value to be assigned - def idempotency_key=(idempotency_key) - if idempotency_key.nil? - fail ArgumentError, 'idempotency_key cannot be nil' - end - - if idempotency_key.to_s.length > 50 - fail ArgumentError, 'invalid value for "idempotency_key", the character length must be smaller than or equal to 50.' - end - - - @idempotency_key = idempotency_key - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - from_client_id == o.from_client_id && - to_client_id == o.to_client_id && - amount == o.amount && - idempotency_key == o.idempotency_key && - description == o.description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, from_client_id, to_client_id, amount, idempotency_key, description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_ledger_distribute_response.rb b/lib/plaid/models/transfer_ledger_distribute_response.rb deleted file mode 100644 index 06f889f61..000000000 --- a/lib/plaid/models/transfer_ledger_distribute_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/ledger/distribute` - class TransferLedgerDistributeResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferLedgerDistributeResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferLedgerDistributeResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_ledger_get_request.rb b/lib/plaid/models/transfer_ledger_get_request.rb deleted file mode 100644 index dd5208017..000000000 --- a/lib/plaid/models/transfer_ledger_get_request.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/ledger/get` - class TransferLedgerGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Client ID of the end customer. - attr_accessor :originator_client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'originator_client_id' => :'originator_client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'originator_client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'originator_client_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferLedgerGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferLedgerGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - originator_client_id == o.originator_client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, originator_client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_ledger_get_response.rb b/lib/plaid/models/transfer_ledger_get_response.rb deleted file mode 100644 index 9e9855e41..000000000 --- a/lib/plaid/models/transfer_ledger_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/ledger/get` - class TransferLedgerGetResponse - attr_accessor :balance - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'balance' => :'balance', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'balance' => :'TransferLedgerBalance', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferLedgerGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferLedgerGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'balance') - self.balance = attributes[:'balance'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @balance.nil? - invalid_properties.push('invalid value for "balance", balance cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @balance.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - balance == o.balance && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [balance, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_ledger_sweep_simulate_event_type.rb b/lib/plaid/models/transfer_ledger_sweep_simulate_event_type.rb deleted file mode 100644 index baf80c1ef..000000000 --- a/lib/plaid/models/transfer_ledger_sweep_simulate_event_type.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferLedgerSweepSimulateEventType - POSTED = "sweep.posted".freeze - SETTLED = "sweep.settled".freeze - RETURNED = "sweep.returned".freeze - FAILED = "sweep.failed".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_ledger_withdraw_request.rb b/lib/plaid/models/transfer_ledger_withdraw_request.rb deleted file mode 100644 index d290fb173..000000000 --- a/lib/plaid/models/transfer_ledger_withdraw_request.rb +++ /dev/null @@ -1,368 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/ledger/withdraw` - class TransferLedgerWithdrawRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Client ID of the customer that owns the Ledger balance. This is so Plaid knows which of your customers to payout or collect funds. Only applicable for [Platform customers](https://plaid.com/docs/transfer/application/#originators-vs-platforms). Do not include if you’re paying out to yourself. - attr_accessor :originator_client_id - - # Specify which funding account linked to this Plaid Ledger to use. Customers can find a list of `funding_account_id`s in the Accounts page of your Plaid Dashboard, under the \"Account ID\" column. If this field is left blank, this will default to the default `funding_account_id` specified during onboarding. If an `originator_client_id` is specified, the `funding_account_id` must belong to the specified originator, and if `funding_account_id` is left blank, the originator's default `funding_account_id` will be used. - attr_accessor :funding_account_id - - # A positive amount of how much will be withdrawn from the ledger balance (decimal string with two digits of precision e.g. \"5.50\"). - attr_accessor :amount - - # The description of the deposit that will be passed to the receiving bank (up to 10 characters). Note that banks utilize this field differently, and may or may not show it on the bank statement. - attr_accessor :description - - # A unique key provided by the client, per unique ledger withdraw. Maximum of 50 characters. The API supports idempotency for safely retrying the request without accidentally performing the same operation twice. For example, if a request to create a ledger withdraw fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single withdraw is created. - attr_accessor :idempotency_key - - attr_accessor :network - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'originator_client_id' => :'originator_client_id', - :'funding_account_id' => :'funding_account_id', - :'amount' => :'amount', - :'description' => :'description', - :'idempotency_key' => :'idempotency_key', - :'network' => :'network' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'originator_client_id' => :'String', - :'funding_account_id' => :'String', - :'amount' => :'String', - :'description' => :'String', - :'idempotency_key' => :'String', - :'network' => :'TransferNetwork' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'originator_client_id', - :'funding_account_id', - :'description', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferLedgerWithdrawRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferLedgerWithdrawRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'idempotency_key') - self.idempotency_key = attributes[:'idempotency_key'] - end - - if attributes.key?(:'network') - self.network = attributes[:'network'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if !@description.nil? && @description.to_s.length > 10 - invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 10.') - end - - - if @idempotency_key.nil? - invalid_properties.push('invalid value for "idempotency_key", idempotency_key cannot be nil.') - end - - if @idempotency_key.to_s.length > 50 - invalid_properties.push('invalid value for "idempotency_key", the character length must be smaller than or equal to 50.') - end - - - if @network.nil? - invalid_properties.push('invalid value for "network", network cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @amount.nil? - return false if !@description.nil? && @description.to_s.length > 10 - return false if @idempotency_key.nil? - return false if @idempotency_key.to_s.length > 50 - return false if @network.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] description Value to be assigned - def description=(description) - if !description.nil? && description.to_s.length > 10 - fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 10.' - end - - - @description = description - end - - # Custom attribute writer method with validation - # @param [Object] idempotency_key Value to be assigned - def idempotency_key=(idempotency_key) - if idempotency_key.nil? - fail ArgumentError, 'idempotency_key cannot be nil' - end - - if idempotency_key.to_s.length > 50 - fail ArgumentError, 'invalid value for "idempotency_key", the character length must be smaller than or equal to 50.' - end - - - @idempotency_key = idempotency_key - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - originator_client_id == o.originator_client_id && - funding_account_id == o.funding_account_id && - amount == o.amount && - description == o.description && - idempotency_key == o.idempotency_key && - network == o.network - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, originator_client_id, funding_account_id, amount, description, idempotency_key, network].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_ledger_withdraw_response.rb b/lib/plaid/models/transfer_ledger_withdraw_response.rb deleted file mode 100644 index 13eacee26..000000000 --- a/lib/plaid/models/transfer_ledger_withdraw_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/ledger/withdraw` - class TransferLedgerWithdrawResponse - attr_accessor :sweep - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sweep' => :'sweep', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sweep' => :'TransferSweep', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferLedgerWithdrawResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferLedgerWithdrawResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sweep') - self.sweep = attributes[:'sweep'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @sweep.nil? - invalid_properties.push('invalid value for "sweep", sweep cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @sweep.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sweep == o.sweep && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sweep, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_list_request.rb b/lib/plaid/models/transfer_list_request.rb deleted file mode 100644 index 0fa18d089..000000000 --- a/lib/plaid/models/transfer_list_request.rb +++ /dev/null @@ -1,353 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/list` - class TransferListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The start datetime of transfers to list. This should be in RFC 3339 format (i.e. `2019-12-06T22:35:49Z`) - attr_accessor :start_date - - # The end datetime of transfers to list. This should be in RFC 3339 format (i.e. `2019-12-06T22:35:49Z`) - attr_accessor :end_date - - # The maximum number of transfers to return. - attr_accessor :count - - # The number of transfers to skip before returning results. - attr_accessor :offset - - # Filter transfers to only those originated through the specified origination account. - attr_accessor :origination_account_id - - # Filter transfers to only those with the specified originator client. - attr_accessor :originator_client_id - - # Filter transfers to only those with the specified `funding_account_id`. - attr_accessor :funding_account_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'count' => :'count', - :'offset' => :'offset', - :'origination_account_id' => :'origination_account_id', - :'originator_client_id' => :'originator_client_id', - :'funding_account_id' => :'funding_account_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'start_date' => :'Time', - :'end_date' => :'Time', - :'count' => :'Integer', - :'offset' => :'Integer', - :'origination_account_id' => :'String', - :'originator_client_id' => :'String', - :'funding_account_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'start_date', - :'end_date', - :'origination_account_id', - :'originator_client_id', - :'funding_account_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 25 - end - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - else - self.offset = 0 - end - - if attributes.key?(:'origination_account_id') - self.origination_account_id = attributes[:'origination_account_id'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@count.nil? && @count > 25 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 25.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - if !@offset.nil? && @offset < 0 - invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@count.nil? && @count > 25 - return false if !@count.nil? && @count < 1 - return false if !@offset.nil? && @offset < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 25 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 25.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Custom attribute writer method with validation - # @param [Object] offset Value to be assigned - def offset=(offset) - if !offset.nil? && offset < 0 - fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.' - end - - - @offset = offset - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - start_date == o.start_date && - end_date == o.end_date && - count == o.count && - offset == o.offset && - origination_account_id == o.origination_account_id && - originator_client_id == o.originator_client_id && - funding_account_id == o.funding_account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, start_date, end_date, count, offset, origination_account_id, originator_client_id, funding_account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_list_response.rb b/lib/plaid/models/transfer_list_response.rb deleted file mode 100644 index f30a249c6..000000000 --- a/lib/plaid/models/transfer_list_response.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/list` - class TransferListResponse - attr_accessor :transfers - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transfers' => :'transfers', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transfers' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transfers') - if (value = attributes[:'transfers']).is_a?(Array) - self.transfers = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transfers.nil? - invalid_properties.push('invalid value for "transfers", transfers cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transfers.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transfers == o.transfers && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transfers, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_metrics_get_request.rb b/lib/plaid/models/transfer_metrics_get_request.rb deleted file mode 100644 index e07be1317..000000000 --- a/lib/plaid/models/transfer_metrics_get_request.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/metrics/get` - class TransferMetricsGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The Plaid client ID of the transfer originator. Should only be present if `client_id` is a [Platform customer](https://plaid.com/docs/transfer/application/#originators-vs-platforms). - attr_accessor :originator_client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'originator_client_id' => :'originator_client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'originator_client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'originator_client_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferMetricsGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferMetricsGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - originator_client_id == o.originator_client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, originator_client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_metrics_get_response.rb b/lib/plaid/models/transfer_metrics_get_response.rb deleted file mode 100644 index f9e25d9c1..000000000 --- a/lib/plaid/models/transfer_metrics_get_response.rb +++ /dev/null @@ -1,316 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/metrics/get` - class TransferMetricsGetResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Sum of dollar amount of debit transfers in last 24 hours (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :daily_debit_transfer_volume - - # Sum of dollar amount of credit transfers in last 24 hours (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :daily_credit_transfer_volume - - # Sum of dollar amount of credit and debit transfers in current calendar month (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :monthly_transfer_volume - - # Sum of dollar amount of debit transfers in current calendar month (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :monthly_debit_transfer_volume - - # Sum of dollar amount of credit transfers in current calendar month (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :monthly_credit_transfer_volume - - # The currency of the dollar amount, e.g. \"USD\". - attr_accessor :iso_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id', - :'daily_debit_transfer_volume' => :'daily_debit_transfer_volume', - :'daily_credit_transfer_volume' => :'daily_credit_transfer_volume', - :'monthly_transfer_volume' => :'monthly_transfer_volume', - :'monthly_debit_transfer_volume' => :'monthly_debit_transfer_volume', - :'monthly_credit_transfer_volume' => :'monthly_credit_transfer_volume', - :'iso_currency_code' => :'iso_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String', - :'daily_debit_transfer_volume' => :'String', - :'daily_credit_transfer_volume' => :'String', - :'monthly_transfer_volume' => :'String', - :'monthly_debit_transfer_volume' => :'String', - :'monthly_credit_transfer_volume' => :'String', - :'iso_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferMetricsGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferMetricsGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - - if attributes.key?(:'daily_debit_transfer_volume') - self.daily_debit_transfer_volume = attributes[:'daily_debit_transfer_volume'] - end - - if attributes.key?(:'daily_credit_transfer_volume') - self.daily_credit_transfer_volume = attributes[:'daily_credit_transfer_volume'] - end - - if attributes.key?(:'monthly_transfer_volume') - self.monthly_transfer_volume = attributes[:'monthly_transfer_volume'] - end - - if attributes.key?(:'monthly_debit_transfer_volume') - self.monthly_debit_transfer_volume = attributes[:'monthly_debit_transfer_volume'] - end - - if attributes.key?(:'monthly_credit_transfer_volume') - self.monthly_credit_transfer_volume = attributes[:'monthly_credit_transfer_volume'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - if @daily_debit_transfer_volume.nil? - invalid_properties.push('invalid value for "daily_debit_transfer_volume", daily_debit_transfer_volume cannot be nil.') - end - - if @daily_credit_transfer_volume.nil? - invalid_properties.push('invalid value for "daily_credit_transfer_volume", daily_credit_transfer_volume cannot be nil.') - end - - if @monthly_transfer_volume.nil? - invalid_properties.push('invalid value for "monthly_transfer_volume", monthly_transfer_volume cannot be nil.') - end - - if @monthly_debit_transfer_volume.nil? - invalid_properties.push('invalid value for "monthly_debit_transfer_volume", monthly_debit_transfer_volume cannot be nil.') - end - - if @monthly_credit_transfer_volume.nil? - invalid_properties.push('invalid value for "monthly_credit_transfer_volume", monthly_credit_transfer_volume cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - return false if @daily_debit_transfer_volume.nil? - return false if @daily_credit_transfer_volume.nil? - return false if @monthly_transfer_volume.nil? - return false if @monthly_debit_transfer_volume.nil? - return false if @monthly_credit_transfer_volume.nil? - return false if @iso_currency_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id && - daily_debit_transfer_volume == o.daily_debit_transfer_volume && - daily_credit_transfer_volume == o.daily_credit_transfer_volume && - monthly_transfer_volume == o.monthly_transfer_volume && - monthly_debit_transfer_volume == o.monthly_debit_transfer_volume && - monthly_credit_transfer_volume == o.monthly_credit_transfer_volume && - iso_currency_code == o.iso_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id, daily_debit_transfer_volume, daily_credit_transfer_volume, monthly_transfer_volume, monthly_debit_transfer_volume, monthly_credit_transfer_volume, iso_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_migrate_account_request.rb b/lib/plaid/models/transfer_migrate_account_request.rb deleted file mode 100644 index 46678a866..000000000 --- a/lib/plaid/models/transfer_migrate_account_request.rb +++ /dev/null @@ -1,286 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/migrate_account` - class TransferMigrateAccountRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user's account number. - attr_accessor :account_number - - # The user's routing number. - attr_accessor :routing_number - - # The user's wire transfer routing number. This is the ABA number; for some institutions, this may differ from the ACH number used in `routing_number`. This field must be set for the created item to be eligible for wire transfers. - attr_accessor :wire_routing_number - - # The type of the bank account (`checking` or `savings`). - attr_accessor :account_type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'account_number' => :'account_number', - :'routing_number' => :'routing_number', - :'wire_routing_number' => :'wire_routing_number', - :'account_type' => :'account_type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'account_number' => :'String', - :'routing_number' => :'String', - :'wire_routing_number' => :'String', - :'account_type' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferMigrateAccountRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferMigrateAccountRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'account_number') - self.account_number = attributes[:'account_number'] - end - - if attributes.key?(:'routing_number') - self.routing_number = attributes[:'routing_number'] - end - - if attributes.key?(:'wire_routing_number') - self.wire_routing_number = attributes[:'wire_routing_number'] - end - - if attributes.key?(:'account_type') - self.account_type = attributes[:'account_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @account_number.nil? - invalid_properties.push('invalid value for "account_number", account_number cannot be nil.') - end - - if @routing_number.nil? - invalid_properties.push('invalid value for "routing_number", routing_number cannot be nil.') - end - - if @account_type.nil? - invalid_properties.push('invalid value for "account_type", account_type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @account_number.nil? - return false if @routing_number.nil? - return false if @account_type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - account_number == o.account_number && - routing_number == o.routing_number && - wire_routing_number == o.wire_routing_number && - account_type == o.account_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, account_number, routing_number, wire_routing_number, account_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_migrate_account_response.rb b/lib/plaid/models/transfer_migrate_account_response.rb deleted file mode 100644 index 24a383062..000000000 --- a/lib/plaid/models/transfer_migrate_account_response.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/migrate_account` - class TransferMigrateAccountResponse - # The Plaid `access_token` for the newly created Item. - attr_accessor :access_token - - # The Plaid `account_id` for the newly created Item. - attr_accessor :account_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'access_token' => :'access_token', - :'account_id' => :'account_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'access_token' => :'String', - :'account_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferMigrateAccountResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferMigrateAccountResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @account_id.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - access_token == o.access_token && - account_id == o.account_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [access_token, account_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_network.rb b/lib/plaid/models/transfer_network.rb deleted file mode 100644 index 7a5a5b309..000000000 --- a/lib/plaid/models/transfer_network.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferNetwork - ACH = "ach".freeze - SAME_DAY_ACH = "same-day-ach".freeze - RTP = "rtp".freeze - WIRE = "wire".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_originator_address.rb b/lib/plaid/models/transfer_originator_address.rb deleted file mode 100644 index 7f4e24aa1..000000000 --- a/lib/plaid/models/transfer_originator_address.rb +++ /dev/null @@ -1,286 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The originator's address. - class TransferOriginatorAddress - # The full city name. - attr_accessor :city - - # The full street address. - attr_accessor :street - - # The two-letter code for the state or province (e.g., \"CA\"). - attr_accessor :region - - # The postal code (e.g., \"94103\"). - attr_accessor :postal_code - - # ISO-3166-1 alpha-2 country code standard. - attr_accessor :country_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'city' => :'city', - :'street' => :'street', - :'region' => :'region', - :'postal_code' => :'postal_code', - :'country_code' => :'country_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'city' => :'String', - :'street' => :'String', - :'region' => :'String', - :'postal_code' => :'String', - :'country_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferOriginatorAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferOriginatorAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @city.nil? - invalid_properties.push('invalid value for "city", city cannot be nil.') - end - - if @street.nil? - invalid_properties.push('invalid value for "street", street cannot be nil.') - end - - if @region.nil? - invalid_properties.push('invalid value for "region", region cannot be nil.') - end - - if @postal_code.nil? - invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.') - end - - if @country_code.nil? - invalid_properties.push('invalid value for "country_code", country_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @city.nil? - return false if @street.nil? - return false if @region.nil? - return false if @postal_code.nil? - return false if @country_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - city == o.city && - street == o.street && - region == o.region && - postal_code == o.postal_code && - country_code == o.country_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [city, street, region, postal_code, country_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_originator_create_request.rb b/lib/plaid/models/transfer_originator_create_request.rb deleted file mode 100644 index bd434e50f..000000000 --- a/lib/plaid/models/transfer_originator_create_request.rb +++ /dev/null @@ -1,267 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/originator/create` - class TransferOriginatorCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The company name of the end customer being created. This will be displayed in public-facing surfaces, e.g. Plaid Dashboard. - attr_accessor :company_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'company_name' => :'company_name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'company_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferOriginatorCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferOriginatorCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'company_name') - self.company_name = attributes[:'company_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @company_name.nil? - invalid_properties.push('invalid value for "company_name", company_name cannot be nil.') - end - - if @company_name.to_s.length < 1 - invalid_properties.push('invalid value for "company_name", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @company_name.nil? - return false if @company_name.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] company_name Value to be assigned - def company_name=(company_name) - if company_name.nil? - fail ArgumentError, 'company_name cannot be nil' - end - - if company_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "company_name", the character length must be great than or equal to 1.' - end - - - @company_name = company_name - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - company_name == o.company_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, company_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_originator_create_response.rb b/lib/plaid/models/transfer_originator_create_response.rb deleted file mode 100644 index 1a0660802..000000000 --- a/lib/plaid/models/transfer_originator_create_response.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/originator/create` - class TransferOriginatorCreateResponse - # Client ID of the originator. This identifier will be used when creating transfers and should be stored associated with end user information. - attr_accessor :originator_client_id - - # The company name of the end customer. - attr_accessor :company_name - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'originator_client_id' => :'originator_client_id', - :'company_name' => :'company_name', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'originator_client_id' => :'String', - :'company_name' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferOriginatorCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferOriginatorCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - - if attributes.key?(:'company_name') - self.company_name = attributes[:'company_name'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @originator_client_id.nil? - invalid_properties.push('invalid value for "originator_client_id", originator_client_id cannot be nil.') - end - - if @company_name.nil? - invalid_properties.push('invalid value for "company_name", company_name cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @originator_client_id.nil? - return false if @company_name.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - originator_client_id == o.originator_client_id && - company_name == o.company_name && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [originator_client_id, company_name, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_originator_diligence.rb b/lib/plaid/models/transfer_originator_diligence.rb deleted file mode 100644 index 30c362193..000000000 --- a/lib/plaid/models/transfer_originator_diligence.rb +++ /dev/null @@ -1,370 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The diligence information for the originator. - class TransferOriginatorDiligence - # The business name of the originator. - attr_accessor :dba - - # The tax ID of the originator. - attr_accessor :tax_id - - attr_accessor :credit_usage_configuration - - attr_accessor :debit_usage_configuration - - attr_accessor :address - - # The website of the originator. - attr_accessor :website - - # The NAICS code of the originator. - attr_accessor :naics_code - - attr_accessor :funding_account - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'dba' => :'dba', - :'tax_id' => :'tax_id', - :'credit_usage_configuration' => :'credit_usage_configuration', - :'debit_usage_configuration' => :'debit_usage_configuration', - :'address' => :'address', - :'website' => :'website', - :'naics_code' => :'naics_code', - :'funding_account' => :'funding_account' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'dba' => :'String', - :'tax_id' => :'String', - :'credit_usage_configuration' => :'TransferCreditUsageConfiguration', - :'debit_usage_configuration' => :'TransferDebitUsageConfiguration', - :'address' => :'TransferOriginatorAddress', - :'website' => :'String', - :'naics_code' => :'String', - :'funding_account' => :'TransferFundingAccount' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'credit_usage_configuration', - :'debit_usage_configuration', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferOriginatorDiligence` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferOriginatorDiligence`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'dba') - self.dba = attributes[:'dba'] - end - - if attributes.key?(:'tax_id') - self.tax_id = attributes[:'tax_id'] - end - - if attributes.key?(:'credit_usage_configuration') - self.credit_usage_configuration = attributes[:'credit_usage_configuration'] - end - - if attributes.key?(:'debit_usage_configuration') - self.debit_usage_configuration = attributes[:'debit_usage_configuration'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'website') - self.website = attributes[:'website'] - end - - if attributes.key?(:'naics_code') - self.naics_code = attributes[:'naics_code'] - end - - if attributes.key?(:'funding_account') - self.funding_account = attributes[:'funding_account'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @dba.nil? - invalid_properties.push('invalid value for "dba", dba cannot be nil.') - end - - if @tax_id.nil? - invalid_properties.push('invalid value for "tax_id", tax_id cannot be nil.') - end - - if @tax_id.to_s.length < 1 - invalid_properties.push('invalid value for "tax_id", the character length must be great than or equal to 1.') - end - - - if @address.nil? - invalid_properties.push('invalid value for "address", address cannot be nil.') - end - - if @website.nil? - invalid_properties.push('invalid value for "website", website cannot be nil.') - end - - if @naics_code.nil? - invalid_properties.push('invalid value for "naics_code", naics_code cannot be nil.') - end - - if @naics_code.to_s.length > 6 - invalid_properties.push('invalid value for "naics_code", the character length must be smaller than or equal to 6.') - end - - if @naics_code.to_s.length < 6 - invalid_properties.push('invalid value for "naics_code", the character length must be great than or equal to 6.') - end - - - if @funding_account.nil? - invalid_properties.push('invalid value for "funding_account", funding_account cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @dba.nil? - return false if @tax_id.nil? - return false if @tax_id.to_s.length < 1 - return false if @address.nil? - return false if @website.nil? - return false if @naics_code.nil? - return false if @naics_code.to_s.length > 6 - return false if @naics_code.to_s.length < 6 - return false if @funding_account.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] tax_id Value to be assigned - def tax_id=(tax_id) - if tax_id.nil? - fail ArgumentError, 'tax_id cannot be nil' - end - - if tax_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "tax_id", the character length must be great than or equal to 1.' - end - - - @tax_id = tax_id - end - - # Custom attribute writer method with validation - # @param [Object] naics_code Value to be assigned - def naics_code=(naics_code) - if naics_code.nil? - fail ArgumentError, 'naics_code cannot be nil' - end - - if naics_code.to_s.length > 6 - fail ArgumentError, 'invalid value for "naics_code", the character length must be smaller than or equal to 6.' - end - - if naics_code.to_s.length < 6 - fail ArgumentError, 'invalid value for "naics_code", the character length must be great than or equal to 6.' - end - - - @naics_code = naics_code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - dba == o.dba && - tax_id == o.tax_id && - credit_usage_configuration == o.credit_usage_configuration && - debit_usage_configuration == o.debit_usage_configuration && - address == o.address && - website == o.website && - naics_code == o.naics_code && - funding_account == o.funding_account - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [dba, tax_id, credit_usage_configuration, debit_usage_configuration, address, website, naics_code, funding_account].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_originator_funding_account_update_request.rb b/lib/plaid/models/transfer_originator_funding_account_update_request.rb deleted file mode 100644 index 43b5d64eb..000000000 --- a/lib/plaid/models/transfer_originator_funding_account_update_request.rb +++ /dev/null @@ -1,260 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/originator/funding_account/update` - class TransferOriginatorFundingAccountUpdateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The Plaid client ID of the transfer originator. - attr_accessor :originator_client_id - - attr_accessor :funding_account - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'originator_client_id' => :'originator_client_id', - :'funding_account' => :'funding_account' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'originator_client_id' => :'String', - :'funding_account' => :'TransferFundingAccount' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferOriginatorFundingAccountUpdateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferOriginatorFundingAccountUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - - if attributes.key?(:'funding_account') - self.funding_account = attributes[:'funding_account'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @originator_client_id.nil? - invalid_properties.push('invalid value for "originator_client_id", originator_client_id cannot be nil.') - end - - if @funding_account.nil? - invalid_properties.push('invalid value for "funding_account", funding_account cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @originator_client_id.nil? - return false if @funding_account.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - originator_client_id == o.originator_client_id && - funding_account == o.funding_account - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, originator_client_id, funding_account].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_originator_funding_account_update_response.rb b/lib/plaid/models/transfer_originator_funding_account_update_response.rb deleted file mode 100644 index 157798a64..000000000 --- a/lib/plaid/models/transfer_originator_funding_account_update_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/originator/funding_account/update` - class TransferOriginatorFundingAccountUpdateResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferOriginatorFundingAccountUpdateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferOriginatorFundingAccountUpdateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_originator_get_request.rb b/lib/plaid/models/transfer_originator_get_request.rb deleted file mode 100644 index f45bb35f5..000000000 --- a/lib/plaid/models/transfer_originator_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/originator/get` - class TransferOriginatorGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Client ID of the end customer (i.e. the originator). - attr_accessor :originator_client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'originator_client_id' => :'originator_client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'originator_client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferOriginatorGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferOriginatorGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @originator_client_id.nil? - invalid_properties.push('invalid value for "originator_client_id", originator_client_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @originator_client_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - originator_client_id == o.originator_client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, originator_client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_originator_get_response.rb b/lib/plaid/models/transfer_originator_get_response.rb deleted file mode 100644 index 94be4c684..000000000 --- a/lib/plaid/models/transfer_originator_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/originator/get` - class TransferOriginatorGetResponse - attr_accessor :originator - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'originator' => :'originator', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'originator' => :'DetailedOriginator', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferOriginatorGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferOriginatorGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'originator') - self.originator = attributes[:'originator'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @originator.nil? - invalid_properties.push('invalid value for "originator", originator cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @originator.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - originator == o.originator && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [originator, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_originator_list_request.rb b/lib/plaid/models/transfer_originator_list_request.rb deleted file mode 100644 index dd2e63840..000000000 --- a/lib/plaid/models/transfer_originator_list_request.rb +++ /dev/null @@ -1,300 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/originator/list` - class TransferOriginatorListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The maximum number of originators to return. - attr_accessor :count - - # The number of originators to skip before returning results. - attr_accessor :offset - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'count' => :'count', - :'offset' => :'offset' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'count' => :'Integer', - :'offset' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'count', - :'offset' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferOriginatorListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferOriginatorListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 25 - end - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - else - self.offset = 0 - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@count.nil? && @count > 25 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 25.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - if !@offset.nil? && @offset < 0 - invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@count.nil? && @count > 25 - return false if !@count.nil? && @count < 1 - return false if !@offset.nil? && @offset < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 25 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 25.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Custom attribute writer method with validation - # @param [Object] offset Value to be assigned - def offset=(offset) - if !offset.nil? && offset < 0 - fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.' - end - - - @offset = offset - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - count == o.count && - offset == o.offset - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, count, offset].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_originator_list_response.rb b/lib/plaid/models/transfer_originator_list_response.rb deleted file mode 100644 index 8973fed9d..000000000 --- a/lib/plaid/models/transfer_originator_list_response.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/originator/list` - class TransferOriginatorListResponse - attr_accessor :originators - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'originators' => :'originators', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'originators' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferOriginatorListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferOriginatorListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'originators') - if (value = attributes[:'originators']).is_a?(Array) - self.originators = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @originators.nil? - invalid_properties.push('invalid value for "originators", originators cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @originators.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - originators == o.originators && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [originators, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_questionnaire_create_request.rb b/lib/plaid/models/transfer_questionnaire_create_request.rb deleted file mode 100644 index d76a0afb6..000000000 --- a/lib/plaid/models/transfer_questionnaire_create_request.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/questionnaire/create` - class TransferQuestionnaireCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Client ID of the end customer. - attr_accessor :originator_client_id - - # URL the end customer will be redirected to after completing questions in Plaid-hosted onboarding flow. - attr_accessor :redirect_uri - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'originator_client_id' => :'originator_client_id', - :'redirect_uri' => :'redirect_uri' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'originator_client_id' => :'String', - :'redirect_uri' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferQuestionnaireCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferQuestionnaireCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - - if attributes.key?(:'redirect_uri') - self.redirect_uri = attributes[:'redirect_uri'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @originator_client_id.nil? - invalid_properties.push('invalid value for "originator_client_id", originator_client_id cannot be nil.') - end - - if @redirect_uri.nil? - invalid_properties.push('invalid value for "redirect_uri", redirect_uri cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @originator_client_id.nil? - return false if @redirect_uri.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - originator_client_id == o.originator_client_id && - redirect_uri == o.redirect_uri - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, originator_client_id, redirect_uri].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_questionnaire_create_response.rb b/lib/plaid/models/transfer_questionnaire_create_response.rb deleted file mode 100644 index 71ffc0a95..000000000 --- a/lib/plaid/models/transfer_questionnaire_create_response.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/questionnaire/create` - class TransferQuestionnaireCreateResponse - # Plaid-hosted onboarding URL that you will redirect the end customer to. - attr_accessor :onboarding_url - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'onboarding_url' => :'onboarding_url', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'onboarding_url' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferQuestionnaireCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferQuestionnaireCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'onboarding_url') - self.onboarding_url = attributes[:'onboarding_url'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @onboarding_url.nil? - invalid_properties.push('invalid value for "onboarding_url", onboarding_url cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @onboarding_url.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - onboarding_url == o.onboarding_url && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [onboarding_url, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_recurring_cancel_request.rb b/lib/plaid/models/transfer_recurring_cancel_request.rb deleted file mode 100644 index 9492bb400..000000000 --- a/lib/plaid/models/transfer_recurring_cancel_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/recurring/cancel` - class TransferRecurringCancelRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a recurring transfer. - attr_accessor :recurring_transfer_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'recurring_transfer_id' => :'recurring_transfer_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'recurring_transfer_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRecurringCancelRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRecurringCancelRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'recurring_transfer_id') - self.recurring_transfer_id = attributes[:'recurring_transfer_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @recurring_transfer_id.nil? - invalid_properties.push('invalid value for "recurring_transfer_id", recurring_transfer_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @recurring_transfer_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - recurring_transfer_id == o.recurring_transfer_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, recurring_transfer_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_recurring_cancel_response.rb b/lib/plaid/models/transfer_recurring_cancel_response.rb deleted file mode 100644 index 7175459bf..000000000 --- a/lib/plaid/models/transfer_recurring_cancel_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/recurring/cancel` - class TransferRecurringCancelResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRecurringCancelResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRecurringCancelResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_recurring_create_request.rb b/lib/plaid/models/transfer_recurring_create_request.rb deleted file mode 100644 index dca7665f7..000000000 --- a/lib/plaid/models/transfer_recurring_create_request.rb +++ /dev/null @@ -1,466 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/recurring/create` - class TransferRecurringCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The Plaid `access_token` for the account that will be debited or credited. - attr_accessor :access_token - - # A random key provided by the client, per unique recurring transfer. Maximum of 50 characters. The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. For example, if a request to create a recurring fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single recurring transfer is created. - attr_accessor :idempotency_key - - # The Plaid `account_id` corresponding to the end-user account that will be debited or credited. - attr_accessor :account_id - - # Specify the account used to fund the transfer. Customers can find a list of `funding_account_id`s in the Accounts page of your Plaid Dashboard, under the \"Account ID\" column. If this field is left blank, it will default to the default `funding_account_id` specified during onboarding. - attr_accessor :funding_account_id - - attr_accessor :type - - attr_accessor :network - - attr_accessor :ach_class - - # 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. - attr_accessor :amount - - # If the end user is initiating the specific transfer themselves via an interactive UI, this should be `true`; for automatic recurring payments where the end user is not actually initiating each individual transfer, it should be `false`. - attr_accessor :user_present - - # The currency of the transfer amount. The default value is \"USD\". - attr_accessor :iso_currency_code - - # The description of the recurring transfer. - attr_accessor :description - - # Plaid’s unique identifier for a test clock. This field may only be used when using `sandbox` environment. If provided, the created `recurring_transfer` is associated with the `test_clock`. New originations are automatically generated when the associated `test_clock` advances. - attr_accessor :test_clock_id - - attr_accessor :schedule - - attr_accessor :user - - attr_accessor :device - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'access_token' => :'access_token', - :'idempotency_key' => :'idempotency_key', - :'account_id' => :'account_id', - :'funding_account_id' => :'funding_account_id', - :'type' => :'type', - :'network' => :'network', - :'ach_class' => :'ach_class', - :'amount' => :'amount', - :'user_present' => :'user_present', - :'iso_currency_code' => :'iso_currency_code', - :'description' => :'description', - :'test_clock_id' => :'test_clock_id', - :'schedule' => :'schedule', - :'user' => :'user', - :'device' => :'device' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'access_token' => :'String', - :'idempotency_key' => :'String', - :'account_id' => :'String', - :'funding_account_id' => :'String', - :'type' => :'TransferType', - :'network' => :'TransferNetwork', - :'ach_class' => :'ACHClass', - :'amount' => :'String', - :'user_present' => :'Boolean', - :'iso_currency_code' => :'String', - :'description' => :'String', - :'test_clock_id' => :'String', - :'schedule' => :'TransferRecurringSchedule', - :'user' => :'TransferUserInRequest', - :'device' => :'TransferDevice' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'funding_account_id', - :'user_present', - :'test_clock_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRecurringCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRecurringCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'access_token') - self.access_token = attributes[:'access_token'] - end - - if attributes.key?(:'idempotency_key') - self.idempotency_key = attributes[:'idempotency_key'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'network') - self.network = attributes[:'network'] - end - - if attributes.key?(:'ach_class') - self.ach_class = attributes[:'ach_class'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'user_present') - self.user_present = attributes[:'user_present'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'test_clock_id') - self.test_clock_id = attributes[:'test_clock_id'] - end - - if attributes.key?(:'schedule') - self.schedule = attributes[:'schedule'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'device') - self.device = attributes[:'device'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @access_token.nil? - invalid_properties.push('invalid value for "access_token", access_token cannot be nil.') - end - - if @idempotency_key.nil? - invalid_properties.push('invalid value for "idempotency_key", idempotency_key cannot be nil.') - end - - if @idempotency_key.to_s.length > 50 - invalid_properties.push('invalid value for "idempotency_key", the character length must be smaller than or equal to 50.') - end - - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @network.nil? - invalid_properties.push('invalid value for "network", network cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @description.nil? - invalid_properties.push('invalid value for "description", description cannot be nil.') - end - - if @schedule.nil? - invalid_properties.push('invalid value for "schedule", schedule cannot be nil.') - end - - if @user.nil? - invalid_properties.push('invalid value for "user", user cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @access_token.nil? - return false if @idempotency_key.nil? - return false if @idempotency_key.to_s.length > 50 - return false if @account_id.nil? - return false if @type.nil? - return false if @network.nil? - return false if @amount.nil? - return false if @description.nil? - return false if @schedule.nil? - return false if @user.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] idempotency_key Value to be assigned - def idempotency_key=(idempotency_key) - if idempotency_key.nil? - fail ArgumentError, 'idempotency_key cannot be nil' - end - - if idempotency_key.to_s.length > 50 - fail ArgumentError, 'invalid value for "idempotency_key", the character length must be smaller than or equal to 50.' - end - - - @idempotency_key = idempotency_key - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - access_token == o.access_token && - idempotency_key == o.idempotency_key && - account_id == o.account_id && - funding_account_id == o.funding_account_id && - type == o.type && - network == o.network && - ach_class == o.ach_class && - amount == o.amount && - user_present == o.user_present && - iso_currency_code == o.iso_currency_code && - description == o.description && - test_clock_id == o.test_clock_id && - schedule == o.schedule && - user == o.user && - device == o.device - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, access_token, idempotency_key, account_id, funding_account_id, type, network, ach_class, amount, user_present, iso_currency_code, description, test_clock_id, schedule, user, device].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_recurring_create_response.rb b/lib/plaid/models/transfer_recurring_create_response.rb deleted file mode 100644 index f173e8e58..000000000 --- a/lib/plaid/models/transfer_recurring_create_response.rb +++ /dev/null @@ -1,281 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/recurring/create` - class TransferRecurringCreateResponse - attr_accessor :recurring_transfer - - attr_accessor :decision - - attr_accessor :decision_rationale - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'recurring_transfer' => :'recurring_transfer', - :'decision' => :'decision', - :'decision_rationale' => :'decision_rationale', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'recurring_transfer' => :'RecurringTransferNullable', - :'decision' => :'TransferAuthorizationDecision', - :'decision_rationale' => :'TransferAuthorizationDecisionRationale', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'decision_rationale', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRecurringCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRecurringCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'recurring_transfer') - self.recurring_transfer = attributes[:'recurring_transfer'] - end - - if attributes.key?(:'decision') - self.decision = attributes[:'decision'] - end - - if attributes.key?(:'decision_rationale') - self.decision_rationale = attributes[:'decision_rationale'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @decision.nil? - invalid_properties.push('invalid value for "decision", decision cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @decision.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - recurring_transfer == o.recurring_transfer && - decision == o.decision && - decision_rationale == o.decision_rationale && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [recurring_transfer, decision, decision_rationale, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_recurring_get_request.rb b/lib/plaid/models/transfer_recurring_get_request.rb deleted file mode 100644 index 8159abf14..000000000 --- a/lib/plaid/models/transfer_recurring_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/recurring/get` - class TransferRecurringGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a recurring transfer. - attr_accessor :recurring_transfer_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'recurring_transfer_id' => :'recurring_transfer_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'recurring_transfer_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRecurringGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRecurringGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'recurring_transfer_id') - self.recurring_transfer_id = attributes[:'recurring_transfer_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @recurring_transfer_id.nil? - invalid_properties.push('invalid value for "recurring_transfer_id", recurring_transfer_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @recurring_transfer_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - recurring_transfer_id == o.recurring_transfer_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, recurring_transfer_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_recurring_get_response.rb b/lib/plaid/models/transfer_recurring_get_response.rb deleted file mode 100644 index a77e42f01..000000000 --- a/lib/plaid/models/transfer_recurring_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/recurring/get` - class TransferRecurringGetResponse - attr_accessor :recurring_transfer - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'recurring_transfer' => :'recurring_transfer', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'recurring_transfer' => :'RecurringTransfer', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRecurringGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRecurringGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'recurring_transfer') - self.recurring_transfer = attributes[:'recurring_transfer'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @recurring_transfer.nil? - invalid_properties.push('invalid value for "recurring_transfer", recurring_transfer cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @recurring_transfer.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - recurring_transfer == o.recurring_transfer && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [recurring_transfer, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_recurring_list_request.rb b/lib/plaid/models/transfer_recurring_list_request.rb deleted file mode 100644 index 63875e0fa..000000000 --- a/lib/plaid/models/transfer_recurring_list_request.rb +++ /dev/null @@ -1,331 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/recurring/list` - class TransferRecurringListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The start datetime of recurring transfers to list. This should be in RFC 3339 format (i.e. `2019-12-06T22:35:49Z`) - attr_accessor :start_time - - # The end datetime of recurring transfers to list. This should be in RFC 3339 format (i.e. `2019-12-06T22:35:49Z`) - attr_accessor :end_time - - # The maximum number of recurring transfers to return. - attr_accessor :count - - # The number of recurring transfers to skip before returning results. - attr_accessor :offset - - # Filter recurring transfers to only those with the specified `funding_account_id`. - attr_accessor :funding_account_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'start_time' => :'start_time', - :'end_time' => :'end_time', - :'count' => :'count', - :'offset' => :'offset', - :'funding_account_id' => :'funding_account_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'start_time' => :'Time', - :'end_time' => :'Time', - :'count' => :'Integer', - :'offset' => :'Integer', - :'funding_account_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'start_time', - :'end_time', - :'funding_account_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRecurringListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRecurringListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'start_time') - self.start_time = attributes[:'start_time'] - end - - if attributes.key?(:'end_time') - self.end_time = attributes[:'end_time'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 25 - end - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - else - self.offset = 0 - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@count.nil? && @count > 25 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 25.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - if !@offset.nil? && @offset < 0 - invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@count.nil? && @count > 25 - return false if !@count.nil? && @count < 1 - return false if !@offset.nil? && @offset < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 25 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 25.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Custom attribute writer method with validation - # @param [Object] offset Value to be assigned - def offset=(offset) - if !offset.nil? && offset < 0 - fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.' - end - - - @offset = offset - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - start_time == o.start_time && - end_time == o.end_time && - count == o.count && - offset == o.offset && - funding_account_id == o.funding_account_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, start_time, end_time, count, offset, funding_account_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_recurring_list_response.rb b/lib/plaid/models/transfer_recurring_list_response.rb deleted file mode 100644 index 7e6e0540f..000000000 --- a/lib/plaid/models/transfer_recurring_list_response.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/recurring/list` - class TransferRecurringListResponse - attr_accessor :recurring_transfers - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'recurring_transfers' => :'recurring_transfers', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'recurring_transfers' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRecurringListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRecurringListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'recurring_transfers') - if (value = attributes[:'recurring_transfers']).is_a?(Array) - self.recurring_transfers = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @recurring_transfers.nil? - invalid_properties.push('invalid value for "recurring_transfers", recurring_transfers cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @recurring_transfers.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - recurring_transfers == o.recurring_transfers && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [recurring_transfers, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_recurring_schedule.rb b/lib/plaid/models/transfer_recurring_schedule.rb deleted file mode 100644 index 61587bfad..000000000 --- a/lib/plaid/models/transfer_recurring_schedule.rb +++ /dev/null @@ -1,303 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The schedule that the recurring transfer will be executed on. - class TransferRecurringSchedule - attr_accessor :interval_unit - - # The number of recurring `interval_units` between originations. The recurring interval (before holiday adjustment) is calculated by multiplying `interval_unit` and `interval_count`. For example, to schedule a recurring transfer which originates once every two weeks, set `interval_unit` = `week` and `interval_count` = 2. - attr_accessor :interval_count - - # The day of the interval on which to schedule the transfer. If the `interval_unit` is `week`, `interval_execution_day` should be an integer from 1 (Monday) to 5 (Friday). If the `interval_unit` is `month`, `interval_execution_day` should be an integer indicating which day of the month to make the transfer on. Integers from 1 to 28 can be used to make a transfer on that day of the month. Negative integers from -1 to -5 can be used to make a transfer relative to the end of the month. To make a transfer on the last day of the month, use -1; to make the transfer on the second-to-last day, use -2, and so on. The transfer will be originated on the next available banking day if the designated day is a non banking day. - attr_accessor :interval_execution_day - - # 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. - attr_accessor :start_date - - # 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. - attr_accessor :end_date - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'interval_unit' => :'interval_unit', - :'interval_count' => :'interval_count', - :'interval_execution_day' => :'interval_execution_day', - :'start_date' => :'start_date', - :'end_date' => :'end_date' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'interval_unit' => :'TransferScheduleIntervalUnit', - :'interval_count' => :'Integer', - :'interval_execution_day' => :'Integer', - :'start_date' => :'Date', - :'end_date' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'end_date' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRecurringSchedule` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRecurringSchedule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'interval_unit') - self.interval_unit = attributes[:'interval_unit'] - end - - if attributes.key?(:'interval_count') - self.interval_count = attributes[:'interval_count'] - end - - if attributes.key?(:'interval_execution_day') - self.interval_execution_day = attributes[:'interval_execution_day'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @interval_unit.nil? - invalid_properties.push('invalid value for "interval_unit", interval_unit cannot be nil.') - end - - if @interval_count.nil? - invalid_properties.push('invalid value for "interval_count", interval_count cannot be nil.') - end - - if @interval_execution_day.nil? - invalid_properties.push('invalid value for "interval_execution_day", interval_execution_day cannot be nil.') - end - - if @start_date.nil? - invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @interval_unit.nil? - return false if @interval_count.nil? - return false if @interval_execution_day.nil? - return false if @start_date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - interval_unit == o.interval_unit && - interval_count == o.interval_count && - interval_execution_day == o.interval_execution_day && - start_date == o.start_date && - end_date == o.end_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [interval_unit, interval_count, interval_execution_day, start_date, end_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_recurring_status.rb b/lib/plaid/models/transfer_recurring_status.rb deleted file mode 100644 index 872768992..000000000 --- a/lib/plaid/models/transfer_recurring_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferRecurringStatus - ACTIVE = "active".freeze - CANCELLED = "cancelled".freeze - EXPIRED = "expired".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_refund.rb b/lib/plaid/models/transfer_refund.rb deleted file mode 100644 index f1795ea00..000000000 --- a/lib/plaid/models/transfer_refund.rb +++ /dev/null @@ -1,328 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Represents a refund within the Transfers API. - class TransferRefund - # Plaid’s unique identifier for a refund. - attr_accessor :id - - # The ID of the transfer to refund. - attr_accessor :transfer_id - - # The amount of the refund (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :amount - - attr_accessor :status - - attr_accessor :failure_reason - - # The datetime when this refund was created. This will be of the form `2006-01-02T15:04:05Z` - attr_accessor :created - - # 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. For `wire` transfers, this will be in the format of `/`. The field will remain null for transfers on other rails. - attr_accessor :network_trace_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'transfer_id' => :'transfer_id', - :'amount' => :'amount', - :'status' => :'status', - :'failure_reason' => :'failure_reason', - :'created' => :'created', - :'network_trace_id' => :'network_trace_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'transfer_id' => :'String', - :'amount' => :'String', - :'status' => :'TransferRefundStatus', - :'failure_reason' => :'TransferRefundFailure', - :'created' => :'Time', - :'network_trace_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'failure_reason', - :'network_trace_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRefund` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRefund`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'transfer_id') - self.transfer_id = attributes[:'transfer_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'failure_reason') - self.failure_reason = attributes[:'failure_reason'] - end - - if attributes.key?(:'created') - self.created = attributes[:'created'] - end - - if attributes.key?(:'network_trace_id') - self.network_trace_id = attributes[:'network_trace_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @transfer_id.nil? - invalid_properties.push('invalid value for "transfer_id", transfer_id cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @created.nil? - invalid_properties.push('invalid value for "created", created cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @transfer_id.nil? - return false if @amount.nil? - return false if @status.nil? - return false if @created.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - transfer_id == o.transfer_id && - amount == o.amount && - status == o.status && - failure_reason == o.failure_reason && - created == o.created && - network_trace_id == o.network_trace_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, transfer_id, amount, status, failure_reason, created, network_trace_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_refund_cancel_request.rb b/lib/plaid/models/transfer_refund_cancel_request.rb deleted file mode 100644 index ab439cf71..000000000 --- a/lib/plaid/models/transfer_refund_cancel_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/refund/cancel` - class TransferRefundCancelRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a refund. - attr_accessor :refund_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'refund_id' => :'refund_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'refund_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRefundCancelRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRefundCancelRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'refund_id') - self.refund_id = attributes[:'refund_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @refund_id.nil? - invalid_properties.push('invalid value for "refund_id", refund_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @refund_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - refund_id == o.refund_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, refund_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_refund_cancel_response.rb b/lib/plaid/models/transfer_refund_cancel_response.rb deleted file mode 100644 index ae20675e3..000000000 --- a/lib/plaid/models/transfer_refund_cancel_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/refund/cancel` - class TransferRefundCancelResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRefundCancelResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRefundCancelResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_refund_create_request.rb b/lib/plaid/models/transfer_refund_create_request.rb deleted file mode 100644 index ff1a71c81..000000000 --- a/lib/plaid/models/transfer_refund_create_request.rb +++ /dev/null @@ -1,297 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/refund/create` - class TransferRefundCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the transfer to refund. - attr_accessor :transfer_id - - # The amount of the refund (decimal string with two digits of precision e.g. \"10.00\"). - attr_accessor :amount - - # A random key provided by the client, per unique refund. Maximum of 50 characters. The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. For example, if a request to create a refund fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single refund is created. - attr_accessor :idempotency_key - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'transfer_id' => :'transfer_id', - :'amount' => :'amount', - :'idempotency_key' => :'idempotency_key' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'transfer_id' => :'String', - :'amount' => :'String', - :'idempotency_key' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRefundCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRefundCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'transfer_id') - self.transfer_id = attributes[:'transfer_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'idempotency_key') - self.idempotency_key = attributes[:'idempotency_key'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transfer_id.nil? - invalid_properties.push('invalid value for "transfer_id", transfer_id cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @idempotency_key.nil? - invalid_properties.push('invalid value for "idempotency_key", idempotency_key cannot be nil.') - end - - if @idempotency_key.to_s.length > 50 - invalid_properties.push('invalid value for "idempotency_key", the character length must be smaller than or equal to 50.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transfer_id.nil? - return false if @amount.nil? - return false if @idempotency_key.nil? - return false if @idempotency_key.to_s.length > 50 - true - end - - # Custom attribute writer method with validation - # @param [Object] idempotency_key Value to be assigned - def idempotency_key=(idempotency_key) - if idempotency_key.nil? - fail ArgumentError, 'idempotency_key cannot be nil' - end - - if idempotency_key.to_s.length > 50 - fail ArgumentError, 'invalid value for "idempotency_key", the character length must be smaller than or equal to 50.' - end - - - @idempotency_key = idempotency_key - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - transfer_id == o.transfer_id && - amount == o.amount && - idempotency_key == o.idempotency_key - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, transfer_id, amount, idempotency_key].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_refund_create_response.rb b/lib/plaid/models/transfer_refund_create_response.rb deleted file mode 100644 index 8a7e7dd94..000000000 --- a/lib/plaid/models/transfer_refund_create_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/refund/create` - class TransferRefundCreateResponse - attr_accessor :refund - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'refund' => :'refund', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'refund' => :'TransferRefund', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRefundCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRefundCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'refund') - self.refund = attributes[:'refund'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @refund.nil? - invalid_properties.push('invalid value for "refund", refund cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @refund.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - refund == o.refund && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [refund, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_refund_failure.rb b/lib/plaid/models/transfer_refund_failure.rb deleted file mode 100644 index 23e58da4a..000000000 --- a/lib/plaid/models/transfer_refund_failure.rb +++ /dev/null @@ -1,232 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The failure reason if the event type for a refund is `\"failed\"` or `\"returned\"`. Null value otherwise. - class TransferRefundFailure - # The ACH return code, e.g. `R01`. A return code will be provided if and only if the refund status is `returned`. For a full listing of ACH return codes, see [Transfer errors](https://plaid.com/docs/errors/transfer/#ach-return-codes). - attr_accessor :ach_return_code - - # A human-readable description of the reason for the failure or reversal. - attr_accessor :description - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'ach_return_code' => :'ach_return_code', - :'description' => :'description' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'ach_return_code' => :'String', - :'description' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'ach_return_code', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRefundFailure` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRefundFailure`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'ach_return_code') - self.ach_return_code = attributes[:'ach_return_code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - ach_return_code == o.ach_return_code && - description == o.description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [ach_return_code, description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_refund_get_request.rb b/lib/plaid/models/transfer_refund_get_request.rb deleted file mode 100644 index a34a33a05..000000000 --- a/lib/plaid/models/transfer_refund_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/refund/get` - class TransferRefundGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid’s unique identifier for a refund. - attr_accessor :refund_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'refund_id' => :'refund_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'refund_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRefundGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRefundGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'refund_id') - self.refund_id = attributes[:'refund_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @refund_id.nil? - invalid_properties.push('invalid value for "refund_id", refund_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @refund_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - refund_id == o.refund_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, refund_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_refund_get_response.rb b/lib/plaid/models/transfer_refund_get_response.rb deleted file mode 100644 index 3fc89ba59..000000000 --- a/lib/plaid/models/transfer_refund_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/refund/get` - class TransferRefundGetResponse - attr_accessor :refund - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'refund' => :'refund', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'refund' => :'TransferRefund', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRefundGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRefundGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'refund') - self.refund = attributes[:'refund'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @refund.nil? - invalid_properties.push('invalid value for "refund", refund cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @refund.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - refund == o.refund && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [refund, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_refund_status.rb b/lib/plaid/models/transfer_refund_status.rb deleted file mode 100644 index 07d7dc5aa..000000000 --- a/lib/plaid/models/transfer_refund_status.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferRefundStatus - PENDING = "pending".freeze - POSTED = "posted".freeze - CANCELLED = "cancelled".freeze - FAILED = "failed".freeze - SETTLED = "settled".freeze - RETURNED = "returned".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_repayment.rb b/lib/plaid/models/transfer_repayment.rb deleted file mode 100644 index 3fa52afe9..000000000 --- a/lib/plaid/models/transfer_repayment.rb +++ /dev/null @@ -1,271 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A repayment is created automatically after one or more guaranteed transactions receive a return. If there are multiple eligible returns in a day, they are batched together into a single repayment. Repayments are sent over ACH, with funds typically available on the next banking day. - class TransferRepayment - # Identifier of the repayment. - attr_accessor :repayment_id - - # The datetime when the repayment occurred, in RFC 3339 format. - attr_accessor :created - - # Decimal amount of the repayment as it appears on your account ledger. - attr_accessor :amount - - # The currency of the repayment, e.g. \"USD\". - attr_accessor :iso_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'repayment_id' => :'repayment_id', - :'created' => :'created', - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'repayment_id' => :'String', - :'created' => :'Time', - :'amount' => :'String', - :'iso_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRepayment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRepayment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'repayment_id') - self.repayment_id = attributes[:'repayment_id'] - end - - if attributes.key?(:'created') - self.created = attributes[:'created'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @repayment_id.nil? - invalid_properties.push('invalid value for "repayment_id", repayment_id cannot be nil.') - end - - if @created.nil? - invalid_properties.push('invalid value for "created", created cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @repayment_id.nil? - return false if @created.nil? - return false if @amount.nil? - return false if @iso_currency_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - repayment_id == o.repayment_id && - created == o.created && - amount == o.amount && - iso_currency_code == o.iso_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [repayment_id, created, amount, iso_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_repayment_list_request.rb b/lib/plaid/models/transfer_repayment_list_request.rb deleted file mode 100644 index ce594a20f..000000000 --- a/lib/plaid/models/transfer_repayment_list_request.rb +++ /dev/null @@ -1,321 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/repayment/list` - class TransferRepaymentListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The start datetime of repayments to return (RFC 3339 format). - attr_accessor :start_date - - # The end datetime of repayments to return (RFC 3339 format). - attr_accessor :end_date - - # The maximum number of repayments to return. - attr_accessor :count - - # The number of repayments to skip before returning results. - attr_accessor :offset - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'count' => :'count', - :'offset' => :'offset' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'start_date' => :'Time', - :'end_date' => :'Time', - :'count' => :'Integer', - :'offset' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'start_date', - :'end_date', - :'count', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRepaymentListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRepaymentListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 25 - end - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - else - self.offset = 0 - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@count.nil? && @count > 25 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 25.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - if !@offset.nil? && @offset < 0 - invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@count.nil? && @count > 25 - return false if !@count.nil? && @count < 1 - return false if !@offset.nil? && @offset < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 25 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 25.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Custom attribute writer method with validation - # @param [Object] offset Value to be assigned - def offset=(offset) - if !offset.nil? && offset < 0 - fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.' - end - - - @offset = offset - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - start_date == o.start_date && - end_date == o.end_date && - count == o.count && - offset == o.offset - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, start_date, end_date, count, offset].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_repayment_list_response.rb b/lib/plaid/models/transfer_repayment_list_response.rb deleted file mode 100644 index 0256def2c..000000000 --- a/lib/plaid/models/transfer_repayment_list_response.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/repayments/list` - class TransferRepaymentListResponse - attr_accessor :repayments - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'repayments' => :'repayments', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'repayments' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRepaymentListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRepaymentListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'repayments') - if (value = attributes[:'repayments']).is_a?(Array) - self.repayments = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @repayments.nil? - invalid_properties.push('invalid value for "repayments", repayments cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @repayments.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - repayments == o.repayments && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [repayments, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_repayment_return.rb b/lib/plaid/models/transfer_repayment_return.rb deleted file mode 100644 index 8a9f4708c..000000000 --- a/lib/plaid/models/transfer_repayment_return.rb +++ /dev/null @@ -1,292 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Represents a return on a Guaranteed ACH transfer that is included in the specified repayment. - class TransferRepaymentReturn - # The unique identifier of the guaranteed transfer that was returned. - attr_accessor :transfer_id - - # The unique identifier of the corresponding `returned` transfer event. - attr_accessor :event_id - - # The value of the returned transfer. - attr_accessor :amount - - # The currency of the repayment, e.g. \"USD\". - attr_accessor :iso_currency_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transfer_id' => :'transfer_id', - :'event_id' => :'event_id', - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transfer_id' => :'String', - :'event_id' => :'Integer', - :'amount' => :'String', - :'iso_currency_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRepaymentReturn` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRepaymentReturn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transfer_id') - self.transfer_id = attributes[:'transfer_id'] - end - - if attributes.key?(:'event_id') - self.event_id = attributes[:'event_id'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transfer_id.nil? - invalid_properties.push('invalid value for "transfer_id", transfer_id cannot be nil.') - end - - if @event_id.nil? - invalid_properties.push('invalid value for "event_id", event_id cannot be nil.') - end - - if @event_id < 0 - invalid_properties.push('invalid value for "event_id", must be greater than or equal to 0.') - end - - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transfer_id.nil? - return false if @event_id.nil? - return false if @event_id < 0 - return false if @amount.nil? - return false if @iso_currency_code.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] event_id Value to be assigned - def event_id=(event_id) - if event_id.nil? - fail ArgumentError, 'event_id cannot be nil' - end - - if event_id < 0 - fail ArgumentError, 'invalid value for "event_id", must be greater than or equal to 0.' - end - - - @event_id = event_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transfer_id == o.transfer_id && - event_id == o.event_id && - amount == o.amount && - iso_currency_code == o.iso_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transfer_id, event_id, amount, iso_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_repayment_return_list_request.rb b/lib/plaid/models/transfer_repayment_return_list_request.rb deleted file mode 100644 index 95d2e74c5..000000000 --- a/lib/plaid/models/transfer_repayment_return_list_request.rb +++ /dev/null @@ -1,314 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/repayment/return/list` - class TransferRepaymentReturnListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Identifier of the repayment to query. - attr_accessor :repayment_id - - # The maximum number of repayments to return. - attr_accessor :count - - # The number of repayments to skip before returning results. - attr_accessor :offset - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'repayment_id' => :'repayment_id', - :'count' => :'count', - :'offset' => :'offset' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'repayment_id' => :'String', - :'count' => :'Integer', - :'offset' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'count', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRepaymentReturnListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRepaymentReturnListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'repayment_id') - self.repayment_id = attributes[:'repayment_id'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 25 - end - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - else - self.offset = 0 - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @repayment_id.nil? - invalid_properties.push('invalid value for "repayment_id", repayment_id cannot be nil.') - end - - if !@count.nil? && @count > 25 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 25.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - if !@offset.nil? && @offset < 0 - invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @repayment_id.nil? - return false if !@count.nil? && @count > 25 - return false if !@count.nil? && @count < 1 - return false if !@offset.nil? && @offset < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 25 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 25.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Custom attribute writer method with validation - # @param [Object] offset Value to be assigned - def offset=(offset) - if !offset.nil? && offset < 0 - fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.' - end - - - @offset = offset - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - repayment_id == o.repayment_id && - count == o.count && - offset == o.offset - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, repayment_id, count, offset].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_repayment_return_list_response.rb b/lib/plaid/models/transfer_repayment_return_list_response.rb deleted file mode 100644 index b2212f3b8..000000000 --- a/lib/plaid/models/transfer_repayment_return_list_response.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/repayments/return/list` - class TransferRepaymentReturnListResponse - attr_accessor :repayment_returns - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'repayment_returns' => :'repayment_returns', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'repayment_returns' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferRepaymentReturnListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferRepaymentReturnListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'repayment_returns') - if (value = attributes[:'repayment_returns']).is_a?(Array) - self.repayment_returns = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @repayment_returns.nil? - invalid_properties.push('invalid value for "repayment_returns", repayment_returns cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @repayment_returns.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - repayment_returns == o.repayment_returns && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [repayment_returns, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_schedule_interval_unit.rb b/lib/plaid/models/transfer_schedule_interval_unit.rb deleted file mode 100644 index 8e1944d63..000000000 --- a/lib/plaid/models/transfer_schedule_interval_unit.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferScheduleIntervalUnit - WEEK = "week".freeze - MONTH = "month".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_status.rb b/lib/plaid/models/transfer_status.rb deleted file mode 100644 index 83185bd43..000000000 --- a/lib/plaid/models/transfer_status.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferStatus - PENDING = "pending".freeze - POSTED = "posted".freeze - SETTLED = "settled".freeze - CANCELLED = "cancelled".freeze - FAILED = "failed".freeze - RETURNED = "returned".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_sweep.rb b/lib/plaid/models/transfer_sweep.rb deleted file mode 100644 index 4bd262989..000000000 --- a/lib/plaid/models/transfer_sweep.rb +++ /dev/null @@ -1,360 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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`. `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. - class TransferSweep - # Identifier of the sweep. - attr_accessor :id - - # The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited. - attr_accessor :funding_account_id - - # The datetime when the sweep occurred, in RFC 3339 format. - attr_accessor :created - - # Signed decimal amount of the sweep as it appears on your sweep account ledger (e.g. \"-10.00\") If amount is not present, the sweep was net-settled to zero and outstanding debits and credits between the sweep account and Plaid are balanced. - attr_accessor :amount - - # The currency of the sweep, e.g. \"USD\". - attr_accessor :iso_currency_code - - # The date when the sweep settled, in the YYYY-MM-DD format. - attr_accessor :settled - - attr_accessor :status - - attr_accessor :trigger - - # The description of the deposit that will be passed to the receiving bank (up to 10 characters). Note that banks utilize this field differently, and may or may not show it on the bank statement. - attr_accessor :description - - # 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. For `wire` transfers, this will be in the format of `/`. The field will remain null for transfers on other rails. - attr_accessor :network_trace_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'funding_account_id' => :'funding_account_id', - :'created' => :'created', - :'amount' => :'amount', - :'iso_currency_code' => :'iso_currency_code', - :'settled' => :'settled', - :'status' => :'status', - :'trigger' => :'trigger', - :'description' => :'description', - :'network_trace_id' => :'network_trace_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'funding_account_id' => :'String', - :'created' => :'Time', - :'amount' => :'String', - :'iso_currency_code' => :'String', - :'settled' => :'Date', - :'status' => :'SweepStatus', - :'trigger' => :'SweepTrigger', - :'description' => :'String', - :'network_trace_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'settled', - :'status', - :'trigger', - :'network_trace_id' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferSweep` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferSweep`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - - if attributes.key?(:'created') - self.created = attributes[:'created'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'settled') - self.settled = attributes[:'settled'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'trigger') - self.trigger = attributes[:'trigger'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'network_trace_id') - self.network_trace_id = attributes[:'network_trace_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @funding_account_id.nil? - invalid_properties.push('invalid value for "funding_account_id", funding_account_id cannot be nil.') - end - - if @created.nil? - invalid_properties.push('invalid value for "created", created cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @funding_account_id.nil? - return false if @created.nil? - return false if @amount.nil? - return false if @iso_currency_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - funding_account_id == o.funding_account_id && - created == o.created && - amount == o.amount && - iso_currency_code == o.iso_currency_code && - settled == o.settled && - status == o.status && - trigger == o.trigger && - description == o.description && - network_trace_id == o.network_trace_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, funding_account_id, created, amount, iso_currency_code, settled, status, trigger, description, network_trace_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_sweep_get_request.rb b/lib/plaid/models/transfer_sweep_get_request.rb deleted file mode 100644 index 763271ea4..000000000 --- a/lib/plaid/models/transfer_sweep_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/sweep/get` - class TransferSweepGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Plaid's unique identifier for the sweep (UUID) or a shortened form consisting of the first 8 characters of the identifier (8-digit hexadecimal string). - attr_accessor :sweep_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'sweep_id' => :'sweep_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'sweep_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferSweepGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferSweepGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'sweep_id') - self.sweep_id = attributes[:'sweep_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @sweep_id.nil? - invalid_properties.push('invalid value for "sweep_id", sweep_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @sweep_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - sweep_id == o.sweep_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, sweep_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_sweep_get_response.rb b/lib/plaid/models/transfer_sweep_get_response.rb deleted file mode 100644 index ecad935d8..000000000 --- a/lib/plaid/models/transfer_sweep_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/sweep/get` - class TransferSweepGetResponse - attr_accessor :sweep - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sweep' => :'sweep', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sweep' => :'TransferSweep', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferSweepGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferSweepGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sweep') - self.sweep = attributes[:'sweep'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @sweep.nil? - invalid_properties.push('invalid value for "sweep", sweep cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @sweep.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sweep == o.sweep && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sweep, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_sweep_list_request.rb b/lib/plaid/models/transfer_sweep_list_request.rb deleted file mode 100644 index 1b339f0d0..000000000 --- a/lib/plaid/models/transfer_sweep_list_request.rb +++ /dev/null @@ -1,407 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the request schema for `/transfer/sweep/list` - class TransferSweepListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The start datetime of sweeps to return (RFC 3339 format). - attr_accessor :start_date - - # The end datetime of sweeps to return (RFC 3339 format). - attr_accessor :end_date - - # The maximum number of sweeps to return. - attr_accessor :count - - # The number of sweeps to skip before returning results. - attr_accessor :offset - - # Filter sweeps to only those with the specified amount. - attr_accessor :amount - - attr_accessor :status - - # Filter sweeps to only those with the specified originator client. - attr_accessor :originator_client_id - - # Filter sweeps to only those with the specified `funding_account_id`. - attr_accessor :funding_account_id - - # Filter sweeps to only those with the included `transfer_id`. - attr_accessor :transfer_id - - attr_accessor :trigger - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'start_date' => :'start_date', - :'end_date' => :'end_date', - :'count' => :'count', - :'offset' => :'offset', - :'amount' => :'amount', - :'status' => :'status', - :'originator_client_id' => :'originator_client_id', - :'funding_account_id' => :'funding_account_id', - :'transfer_id' => :'transfer_id', - :'trigger' => :'trigger' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'start_date' => :'Time', - :'end_date' => :'Time', - :'count' => :'Integer', - :'offset' => :'Integer', - :'amount' => :'String', - :'status' => :'SweepStatus', - :'originator_client_id' => :'String', - :'funding_account_id' => :'String', - :'transfer_id' => :'String', - :'trigger' => :'SweepTrigger' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'start_date', - :'end_date', - :'count', - :'amount', - :'status', - :'originator_client_id', - :'funding_account_id', - :'transfer_id', - :'trigger' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferSweepListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferSweepListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 25 - end - - if attributes.key?(:'offset') - self.offset = attributes[:'offset'] - else - self.offset = 0 - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'originator_client_id') - self.originator_client_id = attributes[:'originator_client_id'] - end - - if attributes.key?(:'funding_account_id') - self.funding_account_id = attributes[:'funding_account_id'] - end - - if attributes.key?(:'transfer_id') - self.transfer_id = attributes[:'transfer_id'] - end - - if attributes.key?(:'trigger') - self.trigger = attributes[:'trigger'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@count.nil? && @count > 25 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 25.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - if !@offset.nil? && @offset < 0 - invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@count.nil? && @count > 25 - return false if !@count.nil? && @count < 1 - return false if !@offset.nil? && @offset < 0 - true - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 25 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 25.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Custom attribute writer method with validation - # @param [Object] offset Value to be assigned - def offset=(offset) - if !offset.nil? && offset < 0 - fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.' - end - - - @offset = offset - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - start_date == o.start_date && - end_date == o.end_date && - count == o.count && - offset == o.offset && - amount == o.amount && - status == o.status && - originator_client_id == o.originator_client_id && - funding_account_id == o.funding_account_id && - transfer_id == o.transfer_id && - trigger == o.trigger - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, start_date, end_date, count, offset, amount, status, originator_client_id, funding_account_id, transfer_id, trigger].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_sweep_list_response.rb b/lib/plaid/models/transfer_sweep_list_response.rb deleted file mode 100644 index 6fb00664d..000000000 --- a/lib/plaid/models/transfer_sweep_list_response.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the response schema for `/transfer/sweep/list` - class TransferSweepListResponse - attr_accessor :sweeps - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'sweeps' => :'sweeps', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'sweeps' => :'Array', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferSweepListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferSweepListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'sweeps') - if (value = attributes[:'sweeps']).is_a?(Array) - self.sweeps = value - end - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @sweeps.nil? - invalid_properties.push('invalid value for "sweeps", sweeps cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @sweeps.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - sweeps == o.sweeps && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [sweeps, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_sweep_status.rb b/lib/plaid/models/transfer_sweep_status.rb deleted file mode 100644 index 34931864a..000000000 --- a/lib/plaid/models/transfer_sweep_status.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferSweepStatus - NULL = "null".freeze - UNSWEPT = "unswept".freeze - SWEPT = "swept".freeze - SWEPT_SETTLED = "swept_settled".freeze - RETURN_SWEPT = "return_swept".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_test_clock.rb b/lib/plaid/models/transfer_test_clock.rb deleted file mode 100644 index 42baeadce..000000000 --- a/lib/plaid/models/transfer_test_clock.rb +++ /dev/null @@ -1,241 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Defines the test clock for a transfer. - class TransferTestClock - # Plaid’s unique identifier for a test clock. - attr_accessor :test_clock_id - - # The virtual timestamp on the test clock. This will be of the form `2006-01-02T15:04:05Z`. - attr_accessor :virtual_time - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'test_clock_id' => :'test_clock_id', - :'virtual_time' => :'virtual_time' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'test_clock_id' => :'String', - :'virtual_time' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferTestClock` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferTestClock`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'test_clock_id') - self.test_clock_id = attributes[:'test_clock_id'] - end - - if attributes.key?(:'virtual_time') - self.virtual_time = attributes[:'virtual_time'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @test_clock_id.nil? - invalid_properties.push('invalid value for "test_clock_id", test_clock_id cannot be nil.') - end - - if @virtual_time.nil? - invalid_properties.push('invalid value for "virtual_time", virtual_time cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @test_clock_id.nil? - return false if @virtual_time.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - test_clock_id == o.test_clock_id && - virtual_time == o.virtual_time - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [test_clock_id, virtual_time].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_type.rb b/lib/plaid/models/transfer_type.rb deleted file mode 100644 index 646912785..000000000 --- a/lib/plaid/models/transfer_type.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class TransferType - DEBIT = "debit".freeze - CREDIT = "credit".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/transfer_user_address_in_request.rb b/lib/plaid/models/transfer_user_address_in_request.rb deleted file mode 100644 index a146e8b9a..000000000 --- a/lib/plaid/models/transfer_user_address_in_request.rb +++ /dev/null @@ -1,261 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The address associated with the account holder. - class TransferUserAddressInRequest - # The street number and name (i.e., \"100 Market St.\"). - attr_accessor :street - - # Ex. \"San Francisco\" - attr_accessor :city - - # The state or province (e.g., \"CA\"). - attr_accessor :region - - # The postal code (e.g., \"94103\"). - attr_accessor :postal_code - - # A two-letter country code (e.g., \"US\"). - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'street' => :'street', - :'city' => :'city', - :'region' => :'region', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'street' => :'String', - :'city' => :'String', - :'region' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferUserAddressInRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferUserAddressInRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - street == o.street && - city == o.city && - region == o.region && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [street, city, region, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_user_address_in_response.rb b/lib/plaid/models/transfer_user_address_in_response.rb deleted file mode 100644 index 537c15000..000000000 --- a/lib/plaid/models/transfer_user_address_in_response.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The address associated with the account holder. - class TransferUserAddressInResponse - # The street number and name (i.e., \"100 Market St.\"). - attr_accessor :street - - # Ex. \"San Francisco\" - attr_accessor :city - - # The state or province (e.g., \"CA\"). - attr_accessor :region - - # The postal code (e.g., \"94103\"). - attr_accessor :postal_code - - # A two-letter country code (e.g., \"US\"). - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'street' => :'street', - :'city' => :'city', - :'region' => :'region', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'street' => :'String', - :'city' => :'String', - :'region' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'street', - :'city', - :'region', - :'postal_code', - :'country' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferUserAddressInResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferUserAddressInResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - street == o.street && - city == o.city && - region == o.region && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [street, city, region, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_user_in_request.rb b/lib/plaid/models/transfer_user_in_request.rb deleted file mode 100644 index 20444cf0c..000000000 --- a/lib/plaid/models/transfer_user_in_request.rb +++ /dev/null @@ -1,255 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The legal name and other information for the account holder. - class TransferUserInRequest - # The user's legal name. - attr_accessor :legal_name - - # The user's phone number. - attr_accessor :phone_number - - # The user's email address. - attr_accessor :email_address - - attr_accessor :address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'legal_name' => :'legal_name', - :'phone_number' => :'phone_number', - :'email_address' => :'email_address', - :'address' => :'address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'legal_name' => :'String', - :'phone_number' => :'String', - :'email_address' => :'String', - :'address' => :'TransferUserAddressInRequest' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferUserInRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferUserInRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @legal_name.nil? - invalid_properties.push('invalid value for "legal_name", legal_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @legal_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - legal_name == o.legal_name && - phone_number == o.phone_number && - email_address == o.email_address && - address == o.address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [legal_name, phone_number, email_address, address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_user_in_request_deprecated.rb b/lib/plaid/models/transfer_user_in_request_deprecated.rb deleted file mode 100644 index 39817f4f6..000000000 --- a/lib/plaid/models/transfer_user_in_request_deprecated.rb +++ /dev/null @@ -1,250 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The legal name and other information for the account holder. - class TransferUserInRequestDeprecated - # The user's legal name. - attr_accessor :legal_name - - # The user's phone number. - attr_accessor :phone_number - - # The user's email address. - attr_accessor :email_address - - attr_accessor :address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'legal_name' => :'legal_name', - :'phone_number' => :'phone_number', - :'email_address' => :'email_address', - :'address' => :'address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'legal_name' => :'String', - :'phone_number' => :'String', - :'email_address' => :'String', - :'address' => :'TransferUserAddressInRequest' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferUserInRequestDeprecated` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferUserInRequestDeprecated`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - legal_name == o.legal_name && - phone_number == o.phone_number && - email_address == o.email_address && - address == o.address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [legal_name, phone_number, email_address, address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_user_in_response.rb b/lib/plaid/models/transfer_user_in_response.rb deleted file mode 100644 index 415ac34ba..000000000 --- a/lib/plaid/models/transfer_user_in_response.rb +++ /dev/null @@ -1,258 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The legal name and other information for the account holder. - class TransferUserInResponse - # The user's legal name. - attr_accessor :legal_name - - # The user's phone number. - attr_accessor :phone_number - - # The user's email address. - attr_accessor :email_address - - attr_accessor :address - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'legal_name' => :'legal_name', - :'phone_number' => :'phone_number', - :'email_address' => :'email_address', - :'address' => :'address' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'legal_name' => :'String', - :'phone_number' => :'String', - :'email_address' => :'String', - :'address' => :'TransferUserAddressInResponse' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'phone_number', - :'email_address', - :'address' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferUserInResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferUserInResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @legal_name.nil? - invalid_properties.push('invalid value for "legal_name", legal_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @legal_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - legal_name == o.legal_name && - phone_number == o.phone_number && - email_address == o.email_address && - address == o.address - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [legal_name, phone_number, email_address, address].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/transfer_wire_details.rb b/lib/plaid/models/transfer_wire_details.rb deleted file mode 100644 index ea0e44547..000000000 --- a/lib/plaid/models/transfer_wire_details.rb +++ /dev/null @@ -1,222 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information specific to wire transfers. - class TransferWireDetails - # Additional information from the wire originator to the beneficiary. Max 140 characters. - attr_accessor :message_to_beneficiary - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'message_to_beneficiary' => :'message_to_beneficiary' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'message_to_beneficiary' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'message_to_beneficiary' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::TransferWireDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::TransferWireDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'message_to_beneficiary') - self.message_to_beneficiary = attributes[:'message_to_beneficiary'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - message_to_beneficiary == o.message_to_beneficiary - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [message_to_beneficiary].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/update_entity_screening_request_search_terms.rb b/lib/plaid/models/update_entity_screening_request_search_terms.rb deleted file mode 100644 index 2d4574995..000000000 --- a/lib/plaid/models/update_entity_screening_request_search_terms.rb +++ /dev/null @@ -1,337 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Search terms for editing an entity watchlist screening - class UpdateEntityScreeningRequestSearchTerms - # ID of the associated entity program. - attr_accessor :entity_watchlist_program_id - - # The name of the organization being screened. - attr_accessor :legal_name - - # The numeric or alphanumeric identifier associated with this document. - attr_accessor :document_number - - # A valid email address. - attr_accessor :email_address - - # Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :country - - # A phone number in E.164 format. - attr_accessor :phone_number - - # An 'http' or 'https' URL (must begin with either of those). - attr_accessor :url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'entity_watchlist_program_id' => :'entity_watchlist_program_id', - :'legal_name' => :'legal_name', - :'document_number' => :'document_number', - :'email_address' => :'email_address', - :'country' => :'country', - :'phone_number' => :'phone_number', - :'url' => :'url' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'entity_watchlist_program_id' => :'String', - :'legal_name' => :'String', - :'document_number' => :'String', - :'email_address' => :'String', - :'country' => :'String', - :'phone_number' => :'String', - :'url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::UpdateEntityScreeningRequestSearchTerms` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::UpdateEntityScreeningRequestSearchTerms`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'entity_watchlist_program_id') - self.entity_watchlist_program_id = attributes[:'entity_watchlist_program_id'] - end - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'document_number') - self.document_number = attributes[:'document_number'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @entity_watchlist_program_id.nil? - invalid_properties.push('invalid value for "entity_watchlist_program_id", entity_watchlist_program_id cannot be nil.') - end - - if !@legal_name.nil? && @legal_name.to_s.length < 1 - invalid_properties.push('invalid value for "legal_name", the character length must be great than or equal to 1.') - end - - - if !@document_number.nil? && @document_number.to_s.length < 4 - invalid_properties.push('invalid value for "document_number", the character length must be great than or equal to 4.') - end - - - if !@country.nil? && @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @entity_watchlist_program_id.nil? - return false if !@legal_name.nil? && @legal_name.to_s.length < 1 - return false if !@document_number.nil? && @document_number.to_s.length < 4 - return false if !@country.nil? && @country.to_s.length < 2 - true - end - - # Custom attribute writer method with validation - # @param [Object] legal_name Value to be assigned - def legal_name=(legal_name) - if !legal_name.nil? && legal_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "legal_name", the character length must be great than or equal to 1.' - end - - - @legal_name = legal_name - end - - # Custom attribute writer method with validation - # @param [Object] document_number Value to be assigned - def document_number=(document_number) - if !document_number.nil? && document_number.to_s.length < 4 - fail ArgumentError, 'invalid value for "document_number", the character length must be great than or equal to 4.' - end - - - @document_number = document_number - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if !country.nil? && country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - entity_watchlist_program_id == o.entity_watchlist_program_id && - legal_name == o.legal_name && - document_number == o.document_number && - email_address == o.email_address && - country == o.country && - phone_number == o.phone_number && - url == o.url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [entity_watchlist_program_id, legal_name, document_number, email_address, country, phone_number, url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/update_individual_screening_request_search_terms.rb b/lib/plaid/models/update_individual_screening_request_search_terms.rb deleted file mode 100644 index 813464854..000000000 --- a/lib/plaid/models/update_individual_screening_request_search_terms.rb +++ /dev/null @@ -1,312 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Search terms for editing an individual watchlist screening - class UpdateIndividualScreeningRequestSearchTerms - # ID of the associated program. - attr_accessor :watchlist_program_id - - # The legal name of the individual being screened. - attr_accessor :legal_name - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :date_of_birth - - # The numeric or alphanumeric identifier associated with this document. - attr_accessor :document_number - - # Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'watchlist_program_id' => :'watchlist_program_id', - :'legal_name' => :'legal_name', - :'date_of_birth' => :'date_of_birth', - :'document_number' => :'document_number', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'watchlist_program_id' => :'String', - :'legal_name' => :'String', - :'date_of_birth' => :'Date', - :'document_number' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::UpdateIndividualScreeningRequestSearchTerms` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::UpdateIndividualScreeningRequestSearchTerms`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'watchlist_program_id') - self.watchlist_program_id = attributes[:'watchlist_program_id'] - end - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'document_number') - self.document_number = attributes[:'document_number'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@legal_name.nil? && @legal_name.to_s.length < 1 - invalid_properties.push('invalid value for "legal_name", the character length must be great than or equal to 1.') - end - - - if !@document_number.nil? && @document_number.to_s.length < 4 - invalid_properties.push('invalid value for "document_number", the character length must be great than or equal to 4.') - end - - - if !@country.nil? && @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@legal_name.nil? && @legal_name.to_s.length < 1 - return false if !@document_number.nil? && @document_number.to_s.length < 4 - return false if !@country.nil? && @country.to_s.length < 2 - true - end - - # Custom attribute writer method with validation - # @param [Object] legal_name Value to be assigned - def legal_name=(legal_name) - if !legal_name.nil? && legal_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "legal_name", the character length must be great than or equal to 1.' - end - - - @legal_name = legal_name - end - - # Custom attribute writer method with validation - # @param [Object] document_number Value to be assigned - def document_number=(document_number) - if !document_number.nil? && document_number.to_s.length < 4 - fail ArgumentError, 'invalid value for "document_number", the character length must be great than or equal to 4.' - end - - - @document_number = document_number - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if !country.nil? && country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - watchlist_program_id == o.watchlist_program_id && - legal_name == o.legal_name && - date_of_birth == o.date_of_birth && - document_number == o.document_number && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [watchlist_program_id, legal_name, date_of_birth, document_number, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/user_account_revoked_webhook.rb b/lib/plaid/models/user_account_revoked_webhook.rb deleted file mode 100644 index 9fc58367e..000000000 --- a/lib/plaid/models/user_account_revoked_webhook.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. If you are using Auth and receive this webhook for a Chase Item, 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. - class UserAccountRevokedWebhook - # `ITEM` - attr_accessor :webhook_type - - # `USER_ACCOUNT_REVOKED` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - # The external account ID of the affected account - attr_accessor :account_id - - attr_accessor :error - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'account_id' => :'account_id', - :'error' => :'error', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'account_id' => :'String', - :'error' => :'PlaidError', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::UserAccountRevokedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::UserAccountRevokedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @account_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - account_id == o.account_id && - error == o.error && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, account_id, error, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/user_address.rb b/lib/plaid/models/user_address.rb deleted file mode 100644 index 53e63a1ca..000000000 --- a/lib/plaid/models/user_address.rb +++ /dev/null @@ -1,302 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Home address for the user. Supported values are: not provided, address with only country code or full address. For more context on this field, see [Input Validation by Country](https://plaid.com/docs/identity-verification/hybrid-input-validation/#input-validation-by-country). - class UserAddress - # The primary street portion of an address. If an address is provided, this field will always be filled. - attr_accessor :street - - # Extra street information, like an apartment or suite number. - attr_accessor :street2 - - # City from the end user's address - attr_accessor :city - - # An ISO 3166-2 subdivision code. Related terms would be \"state\", \"province\", \"prefecture\", \"zone\", \"subdivision\", etc. - attr_accessor :region - - # The postal code for the associated address. Between 2 and 10 alphanumeric characters. For US-based addresses this must be 5 numeric digits. - attr_accessor :postal_code - - # Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'street' => :'street', - :'street2' => :'street2', - :'city' => :'city', - :'region' => :'region', - :'postal_code' => :'postal_code', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'street' => :'String', - :'street2' => :'String', - :'city' => :'String', - :'region' => :'String', - :'postal_code' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'street', - :'street2', - :'city', - :'region', - :'postal_code', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::UserAddress` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::UserAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'street') - self.street = attributes[:'street'] - end - - if attributes.key?(:'street2') - self.street2 = attributes[:'street2'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @country.nil? - invalid_properties.push('invalid value for "country", country cannot be nil.') - end - - if @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @country.nil? - return false if @country.to_s.length < 2 - true - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if country.nil? - fail ArgumentError, 'country cannot be nil' - end - - if country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - street == o.street && - street2 == o.street2 && - city == o.city && - region == o.region && - postal_code == o.postal_code && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [street, street2, city, region, postal_code, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/user_create_request.rb b/lib/plaid/models/user_create_request.rb deleted file mode 100644 index 130aaf536..000000000 --- a/lib/plaid/models/user_create_request.rb +++ /dev/null @@ -1,286 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # UserCreateRequest defines the request schema for `/user/create` - class UserCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A unique ID representing the end user. Maximum of 128 characters. Typically this will be a user ID number from your application. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`. - attr_accessor :client_user_id - - attr_accessor :consumer_report_user_identity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'client_user_id' => :'client_user_id', - :'consumer_report_user_identity' => :'consumer_report_user_identity' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'client_user_id' => :'String', - :'consumer_report_user_identity' => :'ConsumerReportUserIdentity' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'consumer_report_user_identity' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::UserCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::UserCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'consumer_report_user_identity') - self.consumer_report_user_identity = attributes[:'consumer_report_user_identity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @client_user_id.nil? - invalid_properties.push('invalid value for "client_user_id", client_user_id cannot be nil.') - end - - if @client_user_id.to_s.length > 128 - invalid_properties.push('invalid value for "client_user_id", the character length must be smaller than or equal to 128.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @client_user_id.nil? - return false if @client_user_id.to_s.length > 128 - return false if @client_user_id.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.nil? - fail ArgumentError, 'client_user_id cannot be nil' - end - - if client_user_id.to_s.length > 128 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be smaller than or equal to 128.' - end - - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - client_user_id == o.client_user_id && - consumer_report_user_identity == o.consumer_report_user_identity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, client_user_id, consumer_report_user_identity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/user_create_response.rb b/lib/plaid/models/user_create_response.rb deleted file mode 100644 index 6e7551bba..000000000 --- a/lib/plaid/models/user_create_response.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # UserCreateResponse defines the response schema for `/user/create` - class UserCreateResponse - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - # The Plaid `user_id` of the User associated with this webhook, warning, or error. - attr_accessor :user_id - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_token' => :'user_token', - :'user_id' => :'user_id', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_token' => :'String', - :'user_id' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::UserCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::UserCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_token.nil? - invalid_properties.push('invalid value for "user_token", user_token cannot be nil.') - end - - if @user_id.nil? - invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_token.nil? - return false if @user_id.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_token == o.user_token && - user_id == o.user_id && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_token, user_id, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/user_custom_password.rb b/lib/plaid/models/user_custom_password.rb deleted file mode 100644 index bc0501834..000000000 --- a/lib/plaid/models/user_custom_password.rb +++ /dev/null @@ -1,298 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Custom test accounts are configured with a JSON configuration object formulated according to the schema below. All top level fields are optional. Sending an empty object as a configuration will result in an account configured with random balances and transaction history. - class UserCustomPassword - # The version of the password schema to use, possible values are 1 or 2. The default value is 2. You should only specify 1 if you know it is necessary for your test suite. - attr_accessor :version - - # A seed, in the form of a string, that will be used to randomly generate account and transaction data, if this data is not specified using the `override_accounts` argument. If no seed is specified, the randomly generated data will be different each time. Note that transactions data is generated relative to the Item's creation date. Different Items created on different dates with the same seed for transactions data will have different dates for the transactions. The number of days between each transaction and the Item creation will remain constant. For example, an Item created on December 15 might show a transaction on December 14. An Item created on December 20, using the same seed, would show that same transaction occurring on December 19. - attr_accessor :seed - - # An array of account overrides to configure the accounts for the Item. By default, if no override is specified, transactions and account data will be randomly generated based on the account type and subtype, and other products will have fixed or empty data. - attr_accessor :override_accounts - - attr_accessor :mfa - - # You may trigger a reCAPTCHA in Plaid Link in the Sandbox environment by using the recaptcha field. Possible values are `good` or `bad`. A value of `good` will result in successful Item creation and `bad` will result in a `RECAPTCHA_BAD` error to simulate a failed reCAPTCHA. Both values require the reCAPTCHA to be manually solved within Plaid Link. - attr_accessor :recaptcha - - # An error code to force on Item creation. Possible values are: `\"INSTITUTION_NOT_RESPONDING\"` `\"INSTITUTION_NO_LONGER_SUPPORTED\"` `\"INVALID_CREDENTIALS\"` `\"INVALID_MFA\"` `\"ITEM_LOCKED\"` `\"ITEM_LOGIN_REQUIRED\"` `\"ITEM_NOT_SUPPORTED\"` `\"INVALID_LINK_TOKEN\"` `\"MFA_NOT_SUPPORTED\"` `\"NO_ACCOUNTS\"` `\"PLAID_ERROR\"` `\"USER_INPUT_TIMEOUT\"` `\"USER_SETUP_REQUIRED\"` - attr_accessor :force_error - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'version' => :'version', - :'seed' => :'seed', - :'override_accounts' => :'override_accounts', - :'mfa' => :'mfa', - :'recaptcha' => :'recaptcha', - :'force_error' => :'force_error' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'version' => :'String', - :'seed' => :'String', - :'override_accounts' => :'Array', - :'mfa' => :'MFA', - :'recaptcha' => :'String', - :'force_error' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'version', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::UserCustomPassword` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::UserCustomPassword`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - - if attributes.key?(:'seed') - self.seed = attributes[:'seed'] - end - - if attributes.key?(:'override_accounts') - if (value = attributes[:'override_accounts']).is_a?(Array) - self.override_accounts = value - end - end - - if attributes.key?(:'mfa') - self.mfa = attributes[:'mfa'] - end - - if attributes.key?(:'recaptcha') - self.recaptcha = attributes[:'recaptcha'] - end - - if attributes.key?(:'force_error') - self.force_error = attributes[:'force_error'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @seed.nil? - invalid_properties.push('invalid value for "seed", seed cannot be nil.') - end - - if @override_accounts.nil? - invalid_properties.push('invalid value for "override_accounts", override_accounts cannot be nil.') - end - - if @mfa.nil? - invalid_properties.push('invalid value for "mfa", mfa cannot be nil.') - end - - if @recaptcha.nil? - invalid_properties.push('invalid value for "recaptcha", recaptcha cannot be nil.') - end - - if @force_error.nil? - invalid_properties.push('invalid value for "force_error", force_error cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @seed.nil? - return false if @override_accounts.nil? - return false if @mfa.nil? - return false if @recaptcha.nil? - return false if @force_error.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - version == o.version && - seed == o.seed && - override_accounts == o.override_accounts && - mfa == o.mfa && - recaptcha == o.recaptcha && - force_error == o.force_error - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [version, seed, override_accounts, mfa, recaptcha, force_error].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/user_data_overview.rb b/lib/plaid/models/user_data_overview.rb deleted file mode 100644 index 933893ccd..000000000 --- a/lib/plaid/models/user_data_overview.rb +++ /dev/null @@ -1,291 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # metadata for the set of insights provided in `TransactionsUserInsightsGetResponse` - class UserDataOverview - # The total number of transactions. - attr_accessor :transaction_count - - # The date of the oldest transaction processed to generate insights. - attr_accessor :oldest_transaction_date - - # The date of the newest transaction processed to generate insights. - attr_accessor :newest_transaction_date - - # The range of days of transactions available. - attr_accessor :days_available - - # Sum of outflow amounts. - attr_accessor :total_outflows - - # Sum of inflow amounts. - attr_accessor :total_inflows - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_count' => :'transaction_count', - :'oldest_transaction_date' => :'oldest_transaction_date', - :'newest_transaction_date' => :'newest_transaction_date', - :'days_available' => :'days_available', - :'total_outflows' => :'total_outflows', - :'total_inflows' => :'total_inflows' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_count' => :'Integer', - :'oldest_transaction_date' => :'Date', - :'newest_transaction_date' => :'Date', - :'days_available' => :'Integer', - :'total_outflows' => :'Float', - :'total_inflows' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::UserDataOverview` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::UserDataOverview`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_count') - self.transaction_count = attributes[:'transaction_count'] - end - - if attributes.key?(:'oldest_transaction_date') - self.oldest_transaction_date = attributes[:'oldest_transaction_date'] - end - - if attributes.key?(:'newest_transaction_date') - self.newest_transaction_date = attributes[:'newest_transaction_date'] - end - - if attributes.key?(:'days_available') - self.days_available = attributes[:'days_available'] - end - - if attributes.key?(:'total_outflows') - self.total_outflows = attributes[:'total_outflows'] - end - - if attributes.key?(:'total_inflows') - self.total_inflows = attributes[:'total_inflows'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transaction_count.nil? - invalid_properties.push('invalid value for "transaction_count", transaction_count cannot be nil.') - end - - if @days_available.nil? - invalid_properties.push('invalid value for "days_available", days_available cannot be nil.') - end - - if @total_outflows.nil? - invalid_properties.push('invalid value for "total_outflows", total_outflows cannot be nil.') - end - - if @total_inflows.nil? - invalid_properties.push('invalid value for "total_inflows", total_inflows cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transaction_count.nil? - return false if @days_available.nil? - return false if @total_outflows.nil? - return false if @total_inflows.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_count == o.transaction_count && - oldest_transaction_date == o.oldest_transaction_date && - newest_transaction_date == o.newest_transaction_date && - days_available == o.days_available && - total_outflows == o.total_outflows && - total_inflows == o.total_inflows - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_count, oldest_transaction_date, newest_transaction_date, days_available, total_outflows, total_inflows].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/user_id_number.rb b/lib/plaid/models/user_id_number.rb deleted file mode 100644 index fe9783f42..000000000 --- a/lib/plaid/models/user_id_number.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class UserIDNumber - # Value of identity document value typed in by user. Alpha-numeric, with all formatting characters stripped. - attr_accessor :value - - attr_accessor :type - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'type' => :'type' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'String', - :'type' => :'IDNumberType' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::UserIDNumber` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::UserIDNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @value.nil? - return false if @type.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/user_permission_revoked_webhook.rb b/lib/plaid/models/user_permission_revoked_webhook.rb deleted file mode 100644 index 72d0a2562..000000000 --- a/lib/plaid/models/user_permission_revoked_webhook.rb +++ /dev/null @@ -1,302 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. Note that when using ACH flows with Chase Items specifically, the account number provided by Plaid will no longer work for creating transfers once user permission has been revoked. If you receive this webhook for a Chase Item, you should not create any new ACH transfers for that Item, as they will be returned. - class UserPermissionRevokedWebhook - # `ITEM` - attr_accessor :webhook_type - - # `USER_PERMISSION_REVOKED` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - attr_accessor :error - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'error' => :'error', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'error' => :'PlaidError', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::UserPermissionRevokedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::UserPermissionRevokedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - error == o.error && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, error, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/user_stated_income_source_category.rb b/lib/plaid/models/user_stated_income_source_category.rb deleted file mode 100644 index 5646dc437..000000000 --- a/lib/plaid/models/user_stated_income_source_category.rb +++ /dev/null @@ -1,48 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class UserStatedIncomeSourceCategory - OTHER = "OTHER".freeze - SALARY = "SALARY".freeze - UNEMPLOYMENT = "UNEMPLOYMENT".freeze - CASH = "CASH".freeze - GIG_ECONOMY = "GIG_ECONOMY".freeze - RENTAL = "RENTAL".freeze - CHILD_SUPPORT = "CHILD_SUPPORT".freeze - MILITARY = "MILITARY".freeze - RETIREMENT = "RETIREMENT".freeze - LONG_TERM_DISABILITY = "LONG_TERM_DISABILITY".freeze - BANK_INTEREST = "BANK_INTEREST".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/user_stated_income_source_frequency.rb b/lib/plaid/models/user_stated_income_source_frequency.rb deleted file mode 100644 index e45a8c579..000000000 --- a/lib/plaid/models/user_stated_income_source_frequency.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class UserStatedIncomeSourceFrequency - UNKNOWN = "UNKNOWN".freeze - WEEKLY = "WEEKLY".freeze - BIWEEKLY = "BIWEEKLY".freeze - SEMI_MONTHLY = "SEMI_MONTHLY".freeze - MONTHLY = "MONTHLY".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/user_stated_income_source_pay_type.rb b/lib/plaid/models/user_stated_income_source_pay_type.rb deleted file mode 100644 index b1f4848d4..000000000 --- a/lib/plaid/models/user_stated_income_source_pay_type.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class UserStatedIncomeSourcePayType - UNKNOWN = "UNKNOWN".freeze - GROSS = "GROSS".freeze - NET = "NET".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/user_update_request.rb b/lib/plaid/models/user_update_request.rb deleted file mode 100644 index 416697435..000000000 --- a/lib/plaid/models/user_update_request.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # UserUpdateRequest defines the request schema for `/user/update` - class UserUpdateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The user token associated with the User data is being requested for. - attr_accessor :user_token - - attr_accessor :consumer_report_user_identity - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'user_token' => :'user_token', - :'consumer_report_user_identity' => :'consumer_report_user_identity' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'user_token' => :'String', - :'consumer_report_user_identity' => :'ConsumerReportUserIdentity' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'consumer_report_user_identity' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::UserUpdateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::UserUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'user_token') - self.user_token = attributes[:'user_token'] - end - - if attributes.key?(:'consumer_report_user_identity') - self.consumer_report_user_identity = attributes[:'consumer_report_user_identity'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @user_token.nil? - invalid_properties.push('invalid value for "user_token", user_token cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @user_token.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - user_token == o.user_token && - consumer_report_user_identity == o.consumer_report_user_identity - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, user_token, consumer_report_user_identity].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/user_update_response.rb b/lib/plaid/models/user_update_response.rb deleted file mode 100644 index a14a41e62..000000000 --- a/lib/plaid/models/user_update_response.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # UserUpdateResponse defines the response schema for `/user/update` - class UserUpdateResponse - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::UserUpdateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::UserUpdateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/validation_source.rb b/lib/plaid/models/validation_source.rb deleted file mode 100644 index 72ce5c6da..000000000 --- a/lib/plaid/models/validation_source.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class ValidationSource - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - attr_accessor :validation_source_name - - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - attr_accessor :validation_source_reference_identifier - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'validation_source_name' => :'ValidationSourceName', - :'validation_source_reference_identifier' => :'ValidationSourceReferenceIdentifier' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'validation_source_name' => :'String', - :'validation_source_reference_identifier' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'validation_source_name', - :'validation_source_reference_identifier' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ValidationSource` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ValidationSource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'validation_source_name') - self.validation_source_name = attributes[:'validation_source_name'] - end - - if attributes.key?(:'validation_source_reference_identifier') - self.validation_source_reference_identifier = attributes[:'validation_source_reference_identifier'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - validation_source_name == o.validation_source_name && - validation_source_reference_identifier == o.validation_source_reference_identifier - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [validation_source_name, validation_source_reference_identifier].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/validation_sources.rb b/lib/plaid/models/validation_sources.rb deleted file mode 100644 index c6efbc6e2..000000000 --- a/lib/plaid/models/validation_sources.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class ValidationSources - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - attr_accessor :validation_source - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'validation_source' => :'VALIDATION_SOURCE' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'validation_source' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::ValidationSources` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::ValidationSources`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'validation_source') - if (value = attributes[:'validation_source']).is_a?(Array) - self.validation_source = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @validation_source.nil? - invalid_properties.push('invalid value for "validation_source", validation_source cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @validation_source.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - validation_source == o.validation_source - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [validation_source].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/verification_expired_webhook.rb b/lib/plaid/models/verification_expired_webhook.rb deleted file mode 100644 index 05b882144..000000000 --- a/lib/plaid/models/verification_expired_webhook.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when an Item was not verified via automated micro-deposits after seven days since the automated micro-deposit was made. - class VerificationExpiredWebhook - # `AUTH` - attr_accessor :webhook_type - - # `VERIFICATION_EXPIRED` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - # The `account_id` of the account associated with the webhook - attr_accessor :account_id - - attr_accessor :environment - - attr_accessor :error - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'account_id' => :'account_id', - :'environment' => :'environment', - :'error' => :'error' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'account_id' => :'String', - :'environment' => :'WebhookEnvironmentValues', - :'error' => :'PlaidError' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::VerificationExpiredWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::VerificationExpiredWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @account_id.nil? - invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @account_id.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - account_id == o.account_id && - environment == o.environment && - error == o.error - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, account_id, environment, error].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/verification_of_asset.rb b/lib/plaid/models/verification_of_asset.rb deleted file mode 100644 index 581b0f293..000000000 --- a/lib/plaid/models/verification_of_asset.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class VerificationOfAsset - attr_accessor :reporting_information - - attr_accessor :service_product_fulfillment - - attr_accessor :verification_of_asset_response - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reporting_information' => :'REPORTING_INFORMATION', - :'service_product_fulfillment' => :'SERVICE_PRODUCT_FULFILLMENT', - :'verification_of_asset_response' => :'VERIFICATION_OF_ASSET_RESPONSE' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'reporting_information' => :'ReportingInformation', - :'service_product_fulfillment' => :'ServiceProductFulfillment', - :'verification_of_asset_response' => :'VerificationOfAssetResponse' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::VerificationOfAsset` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::VerificationOfAsset`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reporting_information') - self.reporting_information = attributes[:'reporting_information'] - end - - if attributes.key?(:'service_product_fulfillment') - self.service_product_fulfillment = attributes[:'service_product_fulfillment'] - end - - if attributes.key?(:'verification_of_asset_response') - self.verification_of_asset_response = attributes[:'verification_of_asset_response'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @reporting_information.nil? - invalid_properties.push('invalid value for "reporting_information", reporting_information cannot be nil.') - end - - if @service_product_fulfillment.nil? - invalid_properties.push('invalid value for "service_product_fulfillment", service_product_fulfillment cannot be nil.') - end - - if @verification_of_asset_response.nil? - invalid_properties.push('invalid value for "verification_of_asset_response", verification_of_asset_response cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @reporting_information.nil? - return false if @service_product_fulfillment.nil? - return false if @verification_of_asset_response.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reporting_information == o.reporting_information && - service_product_fulfillment == o.service_product_fulfillment && - verification_of_asset_response == o.verification_of_asset_response - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reporting_information, service_product_fulfillment, verification_of_asset_response].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/verification_of_asset_response.rb b/lib/plaid/models/verification_of_asset_response.rb deleted file mode 100644 index adce7aba4..000000000 --- a/lib/plaid/models/verification_of_asset_response.rb +++ /dev/null @@ -1,225 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Documentation not found in the MISMO model viewer and not provided by Freddie Mac. - class VerificationOfAssetResponse - attr_accessor :assets - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'assets' => :'ASSETS' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'assets' => :'Assets' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::VerificationOfAssetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::VerificationOfAssetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'assets') - self.assets = attributes[:'assets'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @assets.nil? - invalid_properties.push('invalid value for "assets", assets cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @assets.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - assets == o.assets - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [assets].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/verification_refresh_status.rb b/lib/plaid/models/verification_refresh_status.rb deleted file mode 100644 index 0db8e8a36..000000000 --- a/lib/plaid/models/verification_refresh_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class VerificationRefreshStatus - STATUS_USER_PRESENCE_REQUIRED = "VERIFICATION_REFRESH_STATUS_USER_PRESENCE_REQUIRED".freeze - SUCCESSFUL = "VERIFICATION_REFRESH_SUCCESSFUL".freeze - NOT_FOUND = "VERIFICATION_REFRESH_NOT_FOUND".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/verification_status.rb b/lib/plaid/models/verification_status.rb deleted file mode 100644 index 2bb40a764..000000000 --- a/lib/plaid/models/verification_status.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class VerificationStatus - VERIFIED = "VERIFIED".freeze - UNVERIFIED = "UNVERIFIED".freeze - NEEDS_INFO = "NEEDS_INFO".freeze - UNABLE_TO_VERIFY = "UNABLE_TO_VERIFY".freeze - UNKNOWN = "UNKNOWN".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/w2.rb b/lib/plaid/models/w2.rb deleted file mode 100644 index 4445b394d..000000000 --- a/lib/plaid/models/w2.rb +++ /dev/null @@ -1,438 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # W2 is an object that represents income data taken from a W2 tax document. - class W2 - attr_accessor :employer - - attr_accessor :employee - - # The tax year of the W2 document. - attr_accessor :tax_year - - # An employee identification number or EIN. - attr_accessor :employer_id_number - - # Wages from tips and other compensation. - attr_accessor :wages_tips_other_comp - - # Federal income tax withheld for the tax year. - attr_accessor :federal_income_tax_withheld - - # Wages from social security. - attr_accessor :social_security_wages - - # Social security tax withheld for the tax year. - attr_accessor :social_security_tax_withheld - - # Wages and tips from medicare. - attr_accessor :medicare_wages_and_tips - - # Medicare tax withheld for the tax year. - attr_accessor :medicare_tax_withheld - - # Tips from social security. - attr_accessor :social_security_tips - - # Allocated tips. - attr_accessor :allocated_tips - - # Contents from box 9 on the W2. - attr_accessor :box_9 - - # Dependent care benefits. - attr_accessor :dependent_care_benefits - - # Nonqualified plans. - attr_accessor :nonqualified_plans - - attr_accessor :box_12 - - # Statutory employee. - attr_accessor :statutory_employee - - # Retirement plan. - attr_accessor :retirement_plan - - # Third party sick pay. - attr_accessor :third_party_sick_pay - - # Other. - attr_accessor :other - - attr_accessor :state_and_local_wages - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'employer' => :'employer', - :'employee' => :'employee', - :'tax_year' => :'tax_year', - :'employer_id_number' => :'employer_id_number', - :'wages_tips_other_comp' => :'wages_tips_other_comp', - :'federal_income_tax_withheld' => :'federal_income_tax_withheld', - :'social_security_wages' => :'social_security_wages', - :'social_security_tax_withheld' => :'social_security_tax_withheld', - :'medicare_wages_and_tips' => :'medicare_wages_and_tips', - :'medicare_tax_withheld' => :'medicare_tax_withheld', - :'social_security_tips' => :'social_security_tips', - :'allocated_tips' => :'allocated_tips', - :'box_9' => :'box_9', - :'dependent_care_benefits' => :'dependent_care_benefits', - :'nonqualified_plans' => :'nonqualified_plans', - :'box_12' => :'box_12', - :'statutory_employee' => :'statutory_employee', - :'retirement_plan' => :'retirement_plan', - :'third_party_sick_pay' => :'third_party_sick_pay', - :'other' => :'other', - :'state_and_local_wages' => :'state_and_local_wages' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'employer' => :'PaystubEmployer', - :'employee' => :'Employee', - :'tax_year' => :'String', - :'employer_id_number' => :'String', - :'wages_tips_other_comp' => :'String', - :'federal_income_tax_withheld' => :'String', - :'social_security_wages' => :'String', - :'social_security_tax_withheld' => :'String', - :'medicare_wages_and_tips' => :'String', - :'medicare_tax_withheld' => :'String', - :'social_security_tips' => :'String', - :'allocated_tips' => :'String', - :'box_9' => :'String', - :'dependent_care_benefits' => :'String', - :'nonqualified_plans' => :'String', - :'box_12' => :'Array', - :'statutory_employee' => :'String', - :'retirement_plan' => :'String', - :'third_party_sick_pay' => :'String', - :'other' => :'String', - :'state_and_local_wages' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'tax_year', - :'employer_id_number', - :'wages_tips_other_comp', - :'federal_income_tax_withheld', - :'social_security_wages', - :'social_security_tax_withheld', - :'medicare_wages_and_tips', - :'medicare_tax_withheld', - :'social_security_tips', - :'allocated_tips', - :'box_9', - :'dependent_care_benefits', - :'nonqualified_plans', - :'statutory_employee', - :'retirement_plan', - :'third_party_sick_pay', - :'other', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::W2` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::W2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'employer') - self.employer = attributes[:'employer'] - end - - if attributes.key?(:'employee') - self.employee = attributes[:'employee'] - end - - if attributes.key?(:'tax_year') - self.tax_year = attributes[:'tax_year'] - end - - if attributes.key?(:'employer_id_number') - self.employer_id_number = attributes[:'employer_id_number'] - end - - if attributes.key?(:'wages_tips_other_comp') - self.wages_tips_other_comp = attributes[:'wages_tips_other_comp'] - end - - if attributes.key?(:'federal_income_tax_withheld') - self.federal_income_tax_withheld = attributes[:'federal_income_tax_withheld'] - end - - if attributes.key?(:'social_security_wages') - self.social_security_wages = attributes[:'social_security_wages'] - end - - if attributes.key?(:'social_security_tax_withheld') - self.social_security_tax_withheld = attributes[:'social_security_tax_withheld'] - end - - if attributes.key?(:'medicare_wages_and_tips') - self.medicare_wages_and_tips = attributes[:'medicare_wages_and_tips'] - end - - if attributes.key?(:'medicare_tax_withheld') - self.medicare_tax_withheld = attributes[:'medicare_tax_withheld'] - end - - if attributes.key?(:'social_security_tips') - self.social_security_tips = attributes[:'social_security_tips'] - end - - if attributes.key?(:'allocated_tips') - self.allocated_tips = attributes[:'allocated_tips'] - end - - if attributes.key?(:'box_9') - self.box_9 = attributes[:'box_9'] - end - - if attributes.key?(:'dependent_care_benefits') - self.dependent_care_benefits = attributes[:'dependent_care_benefits'] - end - - if attributes.key?(:'nonqualified_plans') - self.nonqualified_plans = attributes[:'nonqualified_plans'] - end - - if attributes.key?(:'box_12') - if (value = attributes[:'box_12']).is_a?(Array) - self.box_12 = value - end - end - - if attributes.key?(:'statutory_employee') - self.statutory_employee = attributes[:'statutory_employee'] - end - - if attributes.key?(:'retirement_plan') - self.retirement_plan = attributes[:'retirement_plan'] - end - - if attributes.key?(:'third_party_sick_pay') - self.third_party_sick_pay = attributes[:'third_party_sick_pay'] - end - - if attributes.key?(:'other') - self.other = attributes[:'other'] - end - - if attributes.key?(:'state_and_local_wages') - if (value = attributes[:'state_and_local_wages']).is_a?(Array) - self.state_and_local_wages = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - employer == o.employer && - employee == o.employee && - tax_year == o.tax_year && - employer_id_number == o.employer_id_number && - wages_tips_other_comp == o.wages_tips_other_comp && - federal_income_tax_withheld == o.federal_income_tax_withheld && - social_security_wages == o.social_security_wages && - social_security_tax_withheld == o.social_security_tax_withheld && - medicare_wages_and_tips == o.medicare_wages_and_tips && - medicare_tax_withheld == o.medicare_tax_withheld && - social_security_tips == o.social_security_tips && - allocated_tips == o.allocated_tips && - box_9 == o.box_9 && - dependent_care_benefits == o.dependent_care_benefits && - nonqualified_plans == o.nonqualified_plans && - box_12 == o.box_12 && - statutory_employee == o.statutory_employee && - retirement_plan == o.retirement_plan && - third_party_sick_pay == o.third_party_sick_pay && - other == o.other && - state_and_local_wages == o.state_and_local_wages - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [employer, employee, tax_year, employer_id_number, wages_tips_other_comp, federal_income_tax_withheld, social_security_wages, social_security_tax_withheld, medicare_wages_and_tips, medicare_tax_withheld, social_security_tips, allocated_tips, box_9, dependent_care_benefits, nonqualified_plans, box_12, statutory_employee, retirement_plan, third_party_sick_pay, other, state_and_local_wages].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/w2_box12.rb b/lib/plaid/models/w2_box12.rb deleted file mode 100644 index 112d87b83..000000000 --- a/lib/plaid/models/w2_box12.rb +++ /dev/null @@ -1,233 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data on the W2 Box 12 - class W2Box12 - # W2 Box 12 code. - attr_accessor :code - - # W2 Box 12 amount. - attr_accessor :amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'code', - :'amount' => :'amount' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'amount' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'code', - :'amount' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::W2Box12` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::W2Box12`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - amount == o.amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/w2_state_and_local_wages.rb b/lib/plaid/models/w2_state_and_local_wages.rb deleted file mode 100644 index c2f829092..000000000 --- a/lib/plaid/models/w2_state_and_local_wages.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # W2 state and local wages - class W2StateAndLocalWages - # State associated with the wage. - attr_accessor :state - - # State identification number of the employer. - attr_accessor :employer_state_id_number - - # Wages and tips from the specified state. - attr_accessor :state_wages_tips - - # Income tax from the specified state. - attr_accessor :state_income_tax - - # Wages and tips from the locality. - attr_accessor :local_wages_tips - - # Income tax from the locality. - attr_accessor :local_income_tax - - # Name of the locality. - attr_accessor :locality_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'state' => :'state', - :'employer_state_id_number' => :'employer_state_id_number', - :'state_wages_tips' => :'state_wages_tips', - :'state_income_tax' => :'state_income_tax', - :'local_wages_tips' => :'local_wages_tips', - :'local_income_tax' => :'local_income_tax', - :'locality_name' => :'locality_name' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'state' => :'String', - :'employer_state_id_number' => :'String', - :'state_wages_tips' => :'String', - :'state_income_tax' => :'String', - :'local_wages_tips' => :'String', - :'local_income_tax' => :'String', - :'locality_name' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'state', - :'employer_state_id_number', - :'state_wages_tips', - :'state_income_tax', - :'local_wages_tips', - :'local_income_tax', - :'locality_name' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::W2StateAndLocalWages` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::W2StateAndLocalWages`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'employer_state_id_number') - self.employer_state_id_number = attributes[:'employer_state_id_number'] - end - - if attributes.key?(:'state_wages_tips') - self.state_wages_tips = attributes[:'state_wages_tips'] - end - - if attributes.key?(:'state_income_tax') - self.state_income_tax = attributes[:'state_income_tax'] - end - - if attributes.key?(:'local_wages_tips') - self.local_wages_tips = attributes[:'local_wages_tips'] - end - - if attributes.key?(:'local_income_tax') - self.local_income_tax = attributes[:'local_income_tax'] - end - - if attributes.key?(:'locality_name') - self.locality_name = attributes[:'locality_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - state == o.state && - employer_state_id_number == o.employer_state_id_number && - state_wages_tips == o.state_wages_tips && - state_income_tax == o.state_income_tax && - local_wages_tips == o.local_wages_tips && - local_income_tax == o.local_income_tax && - locality_name == o.locality_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [state, employer_state_id_number, state_wages_tips, state_income_tax, local_wages_tips, local_income_tax, locality_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet.rb b/lib/plaid/models/wallet.rb deleted file mode 100644 index fdd0a7359..000000000 --- a/lib/plaid/models/wallet.rb +++ /dev/null @@ -1,300 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing the e-wallet - class Wallet - # A unique ID identifying the e-wallet - attr_accessor :wallet_id - - attr_accessor :balance - - attr_accessor :numbers - - # The ID of the recipient that corresponds to the e-wallet account numbers - attr_accessor :recipient_id - - attr_accessor :status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'wallet_id' => :'wallet_id', - :'balance' => :'balance', - :'numbers' => :'numbers', - :'recipient_id' => :'recipient_id', - :'status' => :'status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'wallet_id' => :'String', - :'balance' => :'WalletBalance', - :'numbers' => :'WalletNumbers', - :'recipient_id' => :'String', - :'status' => :'WalletStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Wallet` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Wallet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'wallet_id') - self.wallet_id = attributes[:'wallet_id'] - end - - if attributes.key?(:'balance') - self.balance = attributes[:'balance'] - end - - if attributes.key?(:'numbers') - self.numbers = attributes[:'numbers'] - end - - if attributes.key?(:'recipient_id') - self.recipient_id = attributes[:'recipient_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @wallet_id.nil? - invalid_properties.push('invalid value for "wallet_id", wallet_id cannot be nil.') - end - - if @balance.nil? - invalid_properties.push('invalid value for "balance", balance cannot be nil.') - end - - if @numbers.nil? - invalid_properties.push('invalid value for "numbers", numbers cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @wallet_id.nil? - return false if @balance.nil? - return false if @numbers.nil? - return false if @status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - wallet_id == o.wallet_id && - balance == o.balance && - numbers == o.numbers && - recipient_id == o.recipient_id && - status == o.status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [wallet_id, balance, numbers, recipient_id, status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_balance.rb b/lib/plaid/models/wallet_balance.rb deleted file mode 100644 index cfb914db1..000000000 --- a/lib/plaid/models/wallet_balance.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing the e-wallet balance - class WalletBalance - # The ISO-4217 currency code of the balance - attr_accessor :iso_currency_code - - # The total amount of funds in the account - attr_accessor :current - - # The total amount of funds in the account after subtracting pending debit transaction amounts - attr_accessor :available - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'iso_currency_code' => :'iso_currency_code', - :'current' => :'current', - :'available' => :'available' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'iso_currency_code' => :'String', - :'current' => :'Float', - :'available' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletBalance` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'current') - self.current = attributes[:'current'] - end - - if attributes.key?(:'available') - self.available = attributes[:'available'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - if @current.nil? - invalid_properties.push('invalid value for "current", current cannot be nil.') - end - - if @available.nil? - invalid_properties.push('invalid value for "available", available cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @iso_currency_code.nil? - return false if @current.nil? - return false if @available.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - iso_currency_code == o.iso_currency_code && - current == o.current && - available == o.available - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [iso_currency_code, current, available].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_create_request.rb b/lib/plaid/models/wallet_create_request.rb deleted file mode 100644 index 36812f3e3..000000000 --- a/lib/plaid/models/wallet_create_request.rb +++ /dev/null @@ -1,267 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # WalletCreateRequest defines the request schema for `/wallet/create` - class WalletCreateRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - attr_accessor :iso_currency_code - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'iso_currency_code' => :'iso_currency_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'iso_currency_code' => :'WalletISOCurrencyCode' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @iso_currency_code.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - iso_currency_code == o.iso_currency_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, iso_currency_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_create_response.rb b/lib/plaid/models/wallet_create_response.rb deleted file mode 100644 index 5a76e529d..000000000 --- a/lib/plaid/models/wallet_create_response.rb +++ /dev/null @@ -1,323 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # WalletCreateResponse defines the response schema for `/wallet/create` - class WalletCreateResponse - # A unique ID identifying the e-wallet - attr_accessor :wallet_id - - attr_accessor :balance - - attr_accessor :numbers - - # The ID of the recipient that corresponds to the e-wallet account numbers - attr_accessor :recipient_id - - attr_accessor :status - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'wallet_id' => :'wallet_id', - :'balance' => :'balance', - :'numbers' => :'numbers', - :'recipient_id' => :'recipient_id', - :'status' => :'status', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'wallet_id' => :'String', - :'balance' => :'WalletBalance', - :'numbers' => :'WalletNumbers', - :'recipient_id' => :'String', - :'status' => :'WalletStatus', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'PaymentInitiationRecipientGetResponseAllOf', - :'Wallet' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'wallet_id') - self.wallet_id = attributes[:'wallet_id'] - end - - if attributes.key?(:'balance') - self.balance = attributes[:'balance'] - end - - if attributes.key?(:'numbers') - self.numbers = attributes[:'numbers'] - end - - if attributes.key?(:'recipient_id') - self.recipient_id = attributes[:'recipient_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @wallet_id.nil? - invalid_properties.push('invalid value for "wallet_id", wallet_id cannot be nil.') - end - - if @balance.nil? - invalid_properties.push('invalid value for "balance", balance cannot be nil.') - end - - if @numbers.nil? - invalid_properties.push('invalid value for "numbers", numbers cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @wallet_id.nil? - return false if @balance.nil? - return false if @numbers.nil? - return false if @status.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - wallet_id == o.wallet_id && - balance == o.balance && - numbers == o.numbers && - recipient_id == o.recipient_id && - status == o.status && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [wallet_id, balance, numbers, recipient_id, status, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_get_request.rb b/lib/plaid/models/wallet_get_request.rb deleted file mode 100644 index 094929245..000000000 --- a/lib/plaid/models/wallet_get_request.rb +++ /dev/null @@ -1,267 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # WalletGetRequest defines the request schema for `/wallet/get` - class WalletGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the e-wallet - attr_accessor :wallet_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'wallet_id' => :'wallet_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'wallet_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'wallet_id') - self.wallet_id = attributes[:'wallet_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @wallet_id.nil? - invalid_properties.push('invalid value for "wallet_id", wallet_id cannot be nil.') - end - - if @wallet_id.to_s.length < 1 - invalid_properties.push('invalid value for "wallet_id", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @wallet_id.nil? - return false if @wallet_id.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] wallet_id Value to be assigned - def wallet_id=(wallet_id) - if wallet_id.nil? - fail ArgumentError, 'wallet_id cannot be nil' - end - - if wallet_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "wallet_id", the character length must be great than or equal to 1.' - end - - - @wallet_id = wallet_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - wallet_id == o.wallet_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, wallet_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_get_response.rb b/lib/plaid/models/wallet_get_response.rb deleted file mode 100644 index d03643f6f..000000000 --- a/lib/plaid/models/wallet_get_response.rb +++ /dev/null @@ -1,323 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # WalletGetResponse defines the response schema for `/wallet/get` - class WalletGetResponse - # A unique ID identifying the e-wallet - attr_accessor :wallet_id - - attr_accessor :balance - - attr_accessor :numbers - - # The ID of the recipient that corresponds to the e-wallet account numbers - attr_accessor :recipient_id - - attr_accessor :status - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'wallet_id' => :'wallet_id', - :'balance' => :'balance', - :'numbers' => :'numbers', - :'recipient_id' => :'recipient_id', - :'status' => :'status', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'wallet_id' => :'String', - :'balance' => :'WalletBalance', - :'numbers' => :'WalletNumbers', - :'recipient_id' => :'String', - :'status' => :'WalletStatus', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'PaymentInitiationRecipientGetResponseAllOf', - :'Wallet' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'wallet_id') - self.wallet_id = attributes[:'wallet_id'] - end - - if attributes.key?(:'balance') - self.balance = attributes[:'balance'] - end - - if attributes.key?(:'numbers') - self.numbers = attributes[:'numbers'] - end - - if attributes.key?(:'recipient_id') - self.recipient_id = attributes[:'recipient_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @wallet_id.nil? - invalid_properties.push('invalid value for "wallet_id", wallet_id cannot be nil.') - end - - if @balance.nil? - invalid_properties.push('invalid value for "balance", balance cannot be nil.') - end - - if @numbers.nil? - invalid_properties.push('invalid value for "numbers", numbers cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @wallet_id.nil? - return false if @balance.nil? - return false if @numbers.nil? - return false if @status.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - wallet_id == o.wallet_id && - balance == o.balance && - numbers == o.numbers && - recipient_id == o.recipient_id && - status == o.status && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [wallet_id, balance, numbers, recipient_id, status, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_iso_currency_code.rb b/lib/plaid/models/wallet_iso_currency_code.rb deleted file mode 100644 index b59f3d47c..000000000 --- a/lib/plaid/models/wallet_iso_currency_code.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class WalletISOCurrencyCode - GBP = "GBP".freeze - EUR = "EUR".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/wallet_list_request.rb b/lib/plaid/models/wallet_list_request.rb deleted file mode 100644 index df0559fc8..000000000 --- a/lib/plaid/models/wallet_list_request.rb +++ /dev/null @@ -1,327 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # WalletListRequest defines the request schema for `/wallet/list` - class WalletListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - attr_accessor :iso_currency_code - - # A base64 value representing the latest e-wallet that has already been requested. Set this to `next_cursor` received from the previous `/wallet/list` request. If provided, the response will only contain e-wallets created before that e-wallet. If omitted, the response will contain e-wallets starting from the most recent, and in descending order. - attr_accessor :cursor - - # The number of e-wallets to fetch - attr_accessor :count - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'iso_currency_code' => :'iso_currency_code', - :'cursor' => :'cursor', - :'count' => :'count' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'iso_currency_code' => :'WalletISOCurrencyCode', - :'cursor' => :'String', - :'count' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 10 - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@cursor.nil? && @cursor.to_s.length > 256 - invalid_properties.push('invalid value for "cursor", the character length must be smaller than or equal to 256.') - end - - - if !@count.nil? && @count > 20 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 20.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@cursor.nil? && @cursor.to_s.length > 256 - return false if !@count.nil? && @count > 20 - return false if !@count.nil? && @count < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] cursor Value to be assigned - def cursor=(cursor) - if !cursor.nil? && cursor.to_s.length > 256 - fail ArgumentError, 'invalid value for "cursor", the character length must be smaller than or equal to 256.' - end - - - @cursor = cursor - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 20 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 20.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - iso_currency_code == o.iso_currency_code && - cursor == o.cursor && - count == o.count - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, iso_currency_code, cursor, count].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_list_response.rb b/lib/plaid/models/wallet_list_response.rb deleted file mode 100644 index 1f7106de0..000000000 --- a/lib/plaid/models/wallet_list_response.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # WalletListResponse defines the response schema for `/wallet/list` - class WalletListResponse - # An array of e-wallets - attr_accessor :wallets - - # Cursor used for fetching e-wallets created before the latest e-wallet provided in this response - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'wallets' => :'wallets', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'wallets' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'wallets') - if (value = attributes[:'wallets']).is_a?(Array) - self.wallets = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @wallets.nil? - invalid_properties.push('invalid value for "wallets", wallets cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @wallets.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - wallets == o.wallets && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [wallets, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_numbers.rb b/lib/plaid/models/wallet_numbers.rb deleted file mode 100644 index 71a4d249d..000000000 --- a/lib/plaid/models/wallet_numbers.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing the e-wallet account numbers - class WalletNumbers - attr_accessor :bacs - - attr_accessor :international - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bacs' => :'bacs', - :'international' => :'international' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bacs' => :'RecipientBACS', - :'international' => :'NumbersInternationalIBAN' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'bacs', - :'international' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletNumbers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletNumbers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bacs') - self.bacs = attributes[:'bacs'] - end - - if attributes.key?(:'international') - self.international = attributes[:'international'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bacs == o.bacs && - international == o.international - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bacs, international].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_payment_scheme.rb b/lib/plaid/models/wallet_payment_scheme.rb deleted file mode 100644 index 36664ae19..000000000 --- a/lib/plaid/models/wallet_payment_scheme.rb +++ /dev/null @@ -1,41 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class WalletPaymentScheme - NULL = "null".freeze - FASTER_PAYMENTS = "FASTER_PAYMENTS".freeze - SEPA_CREDIT_TRANSFER = "SEPA_CREDIT_TRANSFER".freeze - SEPA_CREDIT_TRANSFER_INSTANT = "SEPA_CREDIT_TRANSFER_INSTANT".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/wallet_status.rb b/lib/plaid/models/wallet_status.rb deleted file mode 100644 index dc656a2b1..000000000 --- a/lib/plaid/models/wallet_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class WalletStatus - UNKNOWN = "UNKNOWN".freeze - ACTIVE = "ACTIVE".freeze - CLOSED = "CLOSED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/wallet_transaction.rb b/lib/plaid/models/wallet_transaction.rb deleted file mode 100644 index 74d708fb0..000000000 --- a/lib/plaid/models/wallet_transaction.rb +++ /dev/null @@ -1,408 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The transaction details - class WalletTransaction - # A unique ID identifying the transaction - attr_accessor :transaction_id - - # 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. - attr_accessor :wallet_id - - # A reference for the transaction - attr_accessor :reference - - # The type of the transaction. The supported transaction types that are returned are: `BANK_TRANSFER:` a transaction which credits an e-wallet through an external bank transfer. `PAYOUT:` a transaction which debits an e-wallet by disbursing funds to a counterparty. `PIS_PAY_IN:` a payment which credits an e-wallet through Plaid's Payment Initiation Services (PIS) APIs. For more information see the [Payment Initiation endpoints](https://plaid.com/docs/api/products/payment-initiation/). `REFUND:` a transaction which debits an e-wallet by refunding a previously initiated payment made through Plaid's [PIS APIs](https://plaid.com/docs/api/products/payment-initiation/). `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. - attr_accessor :type - - attr_accessor :scheme - - attr_accessor :amount - - attr_accessor :counterparty - - attr_accessor :status - - # Timestamp when the transaction was created, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :created_at - - # The date and time of the last time the `status` was updated, in IS0 8601 format - attr_accessor :last_status_update - - # The payment id that this transaction is associated with, if any. This is present only for transaction types `PIS_PAY_IN` and `REFUND`. - attr_accessor :payment_id - - attr_accessor :failure_reason - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_id' => :'transaction_id', - :'wallet_id' => :'wallet_id', - :'reference' => :'reference', - :'type' => :'type', - :'scheme' => :'scheme', - :'amount' => :'amount', - :'counterparty' => :'counterparty', - :'status' => :'status', - :'created_at' => :'created_at', - :'last_status_update' => :'last_status_update', - :'payment_id' => :'payment_id', - :'failure_reason' => :'failure_reason' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_id' => :'String', - :'wallet_id' => :'String', - :'reference' => :'String', - :'type' => :'String', - :'scheme' => :'WalletPaymentScheme', - :'amount' => :'WalletTransactionAmount', - :'counterparty' => :'WalletTransactionCounterparty', - :'status' => :'WalletTransactionStatus', - :'created_at' => :'Time', - :'last_status_update' => :'Time', - :'payment_id' => :'String', - :'failure_reason' => :'WalletTransactionFailureReason' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'scheme', - :'payment_id', - :'failure_reason' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - - if attributes.key?(:'wallet_id') - self.wallet_id = attributes[:'wallet_id'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'scheme') - self.scheme = attributes[:'scheme'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'counterparty') - self.counterparty = attributes[:'counterparty'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'last_status_update') - self.last_status_update = attributes[:'last_status_update'] - end - - if attributes.key?(:'payment_id') - self.payment_id = attributes[:'payment_id'] - end - - if attributes.key?(:'failure_reason') - self.failure_reason = attributes[:'failure_reason'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transaction_id.nil? - invalid_properties.push('invalid value for "transaction_id", transaction_id cannot be nil.') - end - - if @wallet_id.nil? - invalid_properties.push('invalid value for "wallet_id", wallet_id cannot be nil.') - end - - if @reference.nil? - invalid_properties.push('invalid value for "reference", reference cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @counterparty.nil? - invalid_properties.push('invalid value for "counterparty", counterparty cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @last_status_update.nil? - invalid_properties.push('invalid value for "last_status_update", last_status_update cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transaction_id.nil? - return false if @wallet_id.nil? - return false if @reference.nil? - return false if @type.nil? - type_validator = EnumAttributeValidator.new('String', ["BANK_TRANSFER", "PAYOUT", "PIS_PAY_IN", "REFUND", "FUNDS_SWEEP", "RETURN"]) - return false unless type_validator.valid?(@type) - return false if @amount.nil? - return false if @counterparty.nil? - return false if @status.nil? - return false if @created_at.nil? - return false if @last_status_update.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["BANK_TRANSFER", "PAYOUT", "PIS_PAY_IN", "REFUND", "FUNDS_SWEEP", "RETURN"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_id == o.transaction_id && - wallet_id == o.wallet_id && - reference == o.reference && - type == o.type && - scheme == o.scheme && - amount == o.amount && - counterparty == o.counterparty && - status == o.status && - created_at == o.created_at && - last_status_update == o.last_status_update && - payment_id == o.payment_id && - failure_reason == o.failure_reason - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_id, wallet_id, reference, type, scheme, amount, counterparty, status, created_at, last_status_update, payment_id, failure_reason].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_transaction_amount.rb b/lib/plaid/models/wallet_transaction_amount.rb deleted file mode 100644 index 082797b68..000000000 --- a/lib/plaid/models/wallet_transaction_amount.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The amount and currency of a transaction - class WalletTransactionAmount - attr_accessor :iso_currency_code - - # The amount of the transaction. Must contain at most two digits of precision e.g. `1.23`. - attr_accessor :value - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'iso_currency_code' => :'iso_currency_code', - :'value' => :'value' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'iso_currency_code' => :'WalletISOCurrencyCode', - :'value' => :'Float' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletTransactionAmount` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletTransactionAmount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'iso_currency_code') - self.iso_currency_code = attributes[:'iso_currency_code'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @iso_currency_code.nil? - invalid_properties.push('invalid value for "iso_currency_code", iso_currency_code cannot be nil.') - end - - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @value < 0.01 - invalid_properties.push('invalid value for "value", must be greater than or equal to 0.01.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @iso_currency_code.nil? - return false if @value.nil? - return false if @value < 0.01 - true - end - - # Custom attribute writer method with validation - # @param [Object] value Value to be assigned - def value=(value) - if value.nil? - fail ArgumentError, 'value cannot be nil' - end - - if value < 0.01 - fail ArgumentError, 'invalid value for "value", must be greater than or equal to 0.01.' - end - - - @value = value - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - iso_currency_code == o.iso_currency_code && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [iso_currency_code, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_transaction_counterparty.rb b/lib/plaid/models/wallet_transaction_counterparty.rb deleted file mode 100644 index 8cab8cb73..000000000 --- a/lib/plaid/models/wallet_transaction_counterparty.rb +++ /dev/null @@ -1,282 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An object representing the e-wallet transaction's counterparty - class WalletTransactionCounterparty - # The name of the counterparty - attr_accessor :name - - attr_accessor :numbers - - attr_accessor :address - - # The counterparty's birthdate, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format. - attr_accessor :date_of_birth - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'name', - :'numbers' => :'numbers', - :'address' => :'address', - :'date_of_birth' => :'date_of_birth' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'numbers' => :'WalletTransactionCounterpartyNumbers', - :'address' => :'PaymentInitiationAddress', - :'date_of_birth' => :'Date' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'address', - :'date_of_birth' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletTransactionCounterparty` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletTransactionCounterparty`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'numbers') - self.numbers = attributes[:'numbers'] - end - - if attributes.key?(:'address') - self.address = attributes[:'address'] - end - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @name.to_s.length < 1 - invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') - end - - - if @numbers.nil? - invalid_properties.push('invalid value for "numbers", numbers cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @name.nil? - return false if @name.to_s.length < 1 - return false if @numbers.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if name.nil? - fail ArgumentError, 'name cannot be nil' - end - - if name.to_s.length < 1 - fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' - end - - - @name = name - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - numbers == o.numbers && - address == o.address && - date_of_birth == o.date_of_birth - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, numbers, address, date_of_birth].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_transaction_counterparty_bacs.rb b/lib/plaid/models/wallet_transaction_counterparty_bacs.rb deleted file mode 100644 index b66a6be64..000000000 --- a/lib/plaid/models/wallet_transaction_counterparty_bacs.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The account number and sort code of the counterparty's account - class WalletTransactionCounterpartyBACS - # The account number of the account. Maximum of 10 characters. - attr_accessor :account - - # The 6-character sort code of the account. - attr_accessor :sort_code - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account' => :'account', - :'sort_code' => :'sort_code' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account' => :'String', - :'sort_code' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'RecipientBACS' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletTransactionCounterpartyBACS` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletTransactionCounterpartyBACS`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'sort_code') - self.sort_code = attributes[:'sort_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@account.nil? && @account.to_s.length > 10 - invalid_properties.push('invalid value for "account", the character length must be smaller than or equal to 10.') - end - - if !@account.nil? && @account.to_s.length < 1 - invalid_properties.push('invalid value for "account", the character length must be great than or equal to 1.') - end - - - if !@sort_code.nil? && @sort_code.to_s.length > 6 - invalid_properties.push('invalid value for "sort_code", the character length must be smaller than or equal to 6.') - end - - if !@sort_code.nil? && @sort_code.to_s.length < 6 - invalid_properties.push('invalid value for "sort_code", the character length must be great than or equal to 6.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@account.nil? && @account.to_s.length > 10 - return false if !@account.nil? && @account.to_s.length < 1 - return false if !@sort_code.nil? && @sort_code.to_s.length > 6 - return false if !@sort_code.nil? && @sort_code.to_s.length < 6 - true - end - - # Custom attribute writer method with validation - # @param [Object] account Value to be assigned - def account=(account) - if !account.nil? && account.to_s.length > 10 - fail ArgumentError, 'invalid value for "account", the character length must be smaller than or equal to 10.' - end - - if !account.nil? && account.to_s.length < 1 - fail ArgumentError, 'invalid value for "account", the character length must be great than or equal to 1.' - end - - - @account = account - end - - # Custom attribute writer method with validation - # @param [Object] sort_code Value to be assigned - def sort_code=(sort_code) - if !sort_code.nil? && sort_code.to_s.length > 6 - fail ArgumentError, 'invalid value for "sort_code", the character length must be smaller than or equal to 6.' - end - - if !sort_code.nil? && sort_code.to_s.length < 6 - fail ArgumentError, 'invalid value for "sort_code", the character length must be great than or equal to 6.' - end - - - @sort_code = sort_code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account == o.account && - sort_code == o.sort_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account, sort_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_transaction_counterparty_international.rb b/lib/plaid/models/wallet_transaction_counterparty_international.rb deleted file mode 100644 index 492635e38..000000000 --- a/lib/plaid/models/wallet_transaction_counterparty_international.rb +++ /dev/null @@ -1,247 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # International Bank Account Number for a Wallet Transaction - class WalletTransactionCounterpartyInternational - # International Bank Account Number (IBAN). - attr_accessor :iban - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'iban' => :'iban' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'iban' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletTransactionCounterpartyInternational` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletTransactionCounterpartyInternational`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'iban') - self.iban = attributes[:'iban'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@iban.nil? && @iban.to_s.length > 34 - invalid_properties.push('invalid value for "iban", the character length must be smaller than or equal to 34.') - end - - if !@iban.nil? && @iban.to_s.length < 15 - invalid_properties.push('invalid value for "iban", the character length must be great than or equal to 15.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@iban.nil? && @iban.to_s.length > 34 - return false if !@iban.nil? && @iban.to_s.length < 15 - true - end - - # Custom attribute writer method with validation - # @param [Object] iban Value to be assigned - def iban=(iban) - if !iban.nil? && iban.to_s.length > 34 - fail ArgumentError, 'invalid value for "iban", the character length must be smaller than or equal to 34.' - end - - if !iban.nil? && iban.to_s.length < 15 - fail ArgumentError, 'invalid value for "iban", the character length must be great than or equal to 15.' - end - - - @iban = iban - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - iban == o.iban - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [iban].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_transaction_counterparty_numbers.rb b/lib/plaid/models/wallet_transaction_counterparty_numbers.rb deleted file mode 100644 index 4aa0e452d..000000000 --- a/lib/plaid/models/wallet_transaction_counterparty_numbers.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # The counterparty's bank account numbers. Exactly one of IBAN or BACS data is required. - class WalletTransactionCounterpartyNumbers - attr_accessor :bacs - - attr_accessor :international - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bacs' => :'bacs', - :'international' => :'international' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'bacs' => :'WalletTransactionCounterpartyBACS', - :'international' => :'WalletTransactionCounterpartyInternational' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'international' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletTransactionCounterpartyNumbers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletTransactionCounterpartyNumbers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bacs') - self.bacs = attributes[:'bacs'] - end - - if attributes.key?(:'international') - self.international = attributes[:'international'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bacs == o.bacs && - international == o.international - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bacs, international].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_transaction_execute_request.rb b/lib/plaid/models/wallet_transaction_execute_request.rb deleted file mode 100644 index 9b827873e..000000000 --- a/lib/plaid/models/wallet_transaction_execute_request.rb +++ /dev/null @@ -1,385 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # WalletTransactionExecuteRequest defines the request schema for `/wallet/transaction/execute` - class WalletTransactionExecuteRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A random key provided by the client, per unique wallet transaction. Maximum of 128 characters. The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. If a request to execute a wallet transaction fails due to a network connection error, then after a minimum delay of one minute, you can retry the request with the same idempotency key to guarantee that only a single wallet transaction is created. If the request was successfully processed, it will prevent any transaction that uses the same idempotency key, and was received within 24 hours of the first request, from being processed. - attr_accessor :idempotency_key - - # The ID of the e-wallet to debit from - attr_accessor :wallet_id - - attr_accessor :counterparty - - attr_accessor :amount - - # A reference for the transaction. This must be an alphanumeric string with 6 to 18 characters and must not contain any special characters or spaces. Ensure that the `reference` field is unique for each transaction. - attr_accessor :reference - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'idempotency_key' => :'idempotency_key', - :'wallet_id' => :'wallet_id', - :'counterparty' => :'counterparty', - :'amount' => :'amount', - :'reference' => :'reference' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'idempotency_key' => :'String', - :'wallet_id' => :'String', - :'counterparty' => :'WalletTransactionCounterparty', - :'amount' => :'WalletTransactionAmount', - :'reference' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletTransactionExecuteRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletTransactionExecuteRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'idempotency_key') - self.idempotency_key = attributes[:'idempotency_key'] - end - - if attributes.key?(:'wallet_id') - self.wallet_id = attributes[:'wallet_id'] - end - - if attributes.key?(:'counterparty') - self.counterparty = attributes[:'counterparty'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @idempotency_key.nil? - invalid_properties.push('invalid value for "idempotency_key", idempotency_key cannot be nil.') - end - - if @idempotency_key.to_s.length > 128 - invalid_properties.push('invalid value for "idempotency_key", the character length must be smaller than or equal to 128.') - end - - if @idempotency_key.to_s.length < 1 - invalid_properties.push('invalid value for "idempotency_key", the character length must be great than or equal to 1.') - end - - - if @wallet_id.nil? - invalid_properties.push('invalid value for "wallet_id", wallet_id cannot be nil.') - end - - if @wallet_id.to_s.length < 1 - invalid_properties.push('invalid value for "wallet_id", the character length must be great than or equal to 1.') - end - - - if @counterparty.nil? - invalid_properties.push('invalid value for "counterparty", counterparty cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @reference.nil? - invalid_properties.push('invalid value for "reference", reference cannot be nil.') - end - - if @reference.to_s.length > 18 - invalid_properties.push('invalid value for "reference", the character length must be smaller than or equal to 18.') - end - - if @reference.to_s.length < 6 - invalid_properties.push('invalid value for "reference", the character length must be great than or equal to 6.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @idempotency_key.nil? - return false if @idempotency_key.to_s.length > 128 - return false if @idempotency_key.to_s.length < 1 - return false if @wallet_id.nil? - return false if @wallet_id.to_s.length < 1 - return false if @counterparty.nil? - return false if @amount.nil? - return false if @reference.nil? - return false if @reference.to_s.length > 18 - return false if @reference.to_s.length < 6 - true - end - - # Custom attribute writer method with validation - # @param [Object] idempotency_key Value to be assigned - def idempotency_key=(idempotency_key) - if idempotency_key.nil? - fail ArgumentError, 'idempotency_key cannot be nil' - end - - if idempotency_key.to_s.length > 128 - fail ArgumentError, 'invalid value for "idempotency_key", the character length must be smaller than or equal to 128.' - end - - if idempotency_key.to_s.length < 1 - fail ArgumentError, 'invalid value for "idempotency_key", the character length must be great than or equal to 1.' - end - - - @idempotency_key = idempotency_key - end - - # Custom attribute writer method with validation - # @param [Object] wallet_id Value to be assigned - def wallet_id=(wallet_id) - if wallet_id.nil? - fail ArgumentError, 'wallet_id cannot be nil' - end - - if wallet_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "wallet_id", the character length must be great than or equal to 1.' - end - - - @wallet_id = wallet_id - end - - # Custom attribute writer method with validation - # @param [Object] reference Value to be assigned - def reference=(reference) - if reference.nil? - fail ArgumentError, 'reference cannot be nil' - end - - if reference.to_s.length > 18 - fail ArgumentError, 'invalid value for "reference", the character length must be smaller than or equal to 18.' - end - - if reference.to_s.length < 6 - fail ArgumentError, 'invalid value for "reference", the character length must be great than or equal to 6.' - end - - - @reference = reference - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - idempotency_key == o.idempotency_key && - wallet_id == o.wallet_id && - counterparty == o.counterparty && - amount == o.amount && - reference == o.reference - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, idempotency_key, wallet_id, counterparty, amount, reference].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_transaction_execute_response.rb b/lib/plaid/models/wallet_transaction_execute_response.rb deleted file mode 100644 index 9a15f7e71..000000000 --- a/lib/plaid/models/wallet_transaction_execute_response.rb +++ /dev/null @@ -1,277 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # WalletTransactionExecuteResponse defines the response schema for `/wallet/transaction/execute` - class WalletTransactionExecuteResponse - # A unique ID identifying the transaction - attr_accessor :transaction_id - - attr_accessor :status - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_id' => :'transaction_id', - :'status' => :'status', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_id' => :'String', - :'status' => :'WalletTransactionStatus', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletTransactionExecuteResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletTransactionExecuteResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transaction_id.nil? - invalid_properties.push('invalid value for "transaction_id", transaction_id cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transaction_id.nil? - return false if @status.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_id == o.transaction_id && - status == o.status && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_id, status, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_transaction_failure_reason.rb b/lib/plaid/models/wallet_transaction_failure_reason.rb deleted file mode 100644 index 129e29548..000000000 --- a/lib/plaid/models/wallet_transaction_failure_reason.rb +++ /dev/null @@ -1,42 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class WalletTransactionFailureReason - EXTERNAL_SYSTEM = "EXTERNAL_SYSTEM".freeze - EXPIRED = "EXPIRED".freeze - CANCELLED = "CANCELLED".freeze - INVALID = "INVALID".freeze - UNKNOWN = "UNKNOWN".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/wallet_transaction_get_request.rb b/lib/plaid/models/wallet_transaction_get_request.rb deleted file mode 100644 index c045bbbac..000000000 --- a/lib/plaid/models/wallet_transaction_get_request.rb +++ /dev/null @@ -1,267 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # WalletTransactionGetRequest defines the request schema for `/wallet/transaction/get` - class WalletTransactionGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the transaction to fetch - attr_accessor :transaction_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'transaction_id' => :'transaction_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'transaction_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletTransactionGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletTransactionGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transaction_id.nil? - invalid_properties.push('invalid value for "transaction_id", transaction_id cannot be nil.') - end - - if @transaction_id.to_s.length < 1 - invalid_properties.push('invalid value for "transaction_id", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transaction_id.nil? - return false if @transaction_id.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] transaction_id Value to be assigned - def transaction_id=(transaction_id) - if transaction_id.nil? - fail ArgumentError, 'transaction_id cannot be nil' - end - - if transaction_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "transaction_id", the character length must be great than or equal to 1.' - end - - - @transaction_id = transaction_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - transaction_id == o.transaction_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, transaction_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_transaction_get_response.rb b/lib/plaid/models/wallet_transaction_get_response.rb deleted file mode 100644 index 9e77041f6..000000000 --- a/lib/plaid/models/wallet_transaction_get_response.rb +++ /dev/null @@ -1,431 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # WalletTransactionGetResponse defines the response schema for `/wallet/transaction/get` - class WalletTransactionGetResponse - # A unique ID identifying the transaction - attr_accessor :transaction_id - - # 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. - attr_accessor :wallet_id - - # A reference for the transaction - attr_accessor :reference - - # The type of the transaction. The supported transaction types that are returned are: `BANK_TRANSFER:` a transaction which credits an e-wallet through an external bank transfer. `PAYOUT:` a transaction which debits an e-wallet by disbursing funds to a counterparty. `PIS_PAY_IN:` a payment which credits an e-wallet through Plaid's Payment Initiation Services (PIS) APIs. For more information see the [Payment Initiation endpoints](https://plaid.com/docs/api/products/payment-initiation/). `REFUND:` a transaction which debits an e-wallet by refunding a previously initiated payment made through Plaid's [PIS APIs](https://plaid.com/docs/api/products/payment-initiation/). `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. - attr_accessor :type - - attr_accessor :scheme - - attr_accessor :amount - - attr_accessor :counterparty - - attr_accessor :status - - # Timestamp when the transaction was created, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format. - attr_accessor :created_at - - # The date and time of the last time the `status` was updated, in IS0 8601 format - attr_accessor :last_status_update - - # The payment id that this transaction is associated with, if any. This is present only for transaction types `PIS_PAY_IN` and `REFUND`. - attr_accessor :payment_id - - attr_accessor :failure_reason - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transaction_id' => :'transaction_id', - :'wallet_id' => :'wallet_id', - :'reference' => :'reference', - :'type' => :'type', - :'scheme' => :'scheme', - :'amount' => :'amount', - :'counterparty' => :'counterparty', - :'status' => :'status', - :'created_at' => :'created_at', - :'last_status_update' => :'last_status_update', - :'payment_id' => :'payment_id', - :'failure_reason' => :'failure_reason', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transaction_id' => :'String', - :'wallet_id' => :'String', - :'reference' => :'String', - :'type' => :'String', - :'scheme' => :'WalletPaymentScheme', - :'amount' => :'WalletTransactionAmount', - :'counterparty' => :'WalletTransactionCounterparty', - :'status' => :'WalletTransactionStatus', - :'created_at' => :'Time', - :'last_status_update' => :'Time', - :'payment_id' => :'String', - :'failure_reason' => :'WalletTransactionFailureReason', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'scheme', - :'payment_id', - :'failure_reason', - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'PaymentInitiationRecipientGetResponseAllOf', - :'WalletTransaction' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletTransactionGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletTransactionGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - - if attributes.key?(:'wallet_id') - self.wallet_id = attributes[:'wallet_id'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'scheme') - self.scheme = attributes[:'scheme'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'counterparty') - self.counterparty = attributes[:'counterparty'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'last_status_update') - self.last_status_update = attributes[:'last_status_update'] - end - - if attributes.key?(:'payment_id') - self.payment_id = attributes[:'payment_id'] - end - - if attributes.key?(:'failure_reason') - self.failure_reason = attributes[:'failure_reason'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transaction_id.nil? - invalid_properties.push('invalid value for "transaction_id", transaction_id cannot be nil.') - end - - if @wallet_id.nil? - invalid_properties.push('invalid value for "wallet_id", wallet_id cannot be nil.') - end - - if @reference.nil? - invalid_properties.push('invalid value for "reference", reference cannot be nil.') - end - - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @counterparty.nil? - invalid_properties.push('invalid value for "counterparty", counterparty cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @last_status_update.nil? - invalid_properties.push('invalid value for "last_status_update", last_status_update cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transaction_id.nil? - return false if @wallet_id.nil? - return false if @reference.nil? - return false if @type.nil? - type_validator = EnumAttributeValidator.new('String', ["BANK_TRANSFER", "PAYOUT", "PIS_PAY_IN", "REFUND", "FUNDS_SWEEP", "RETURN"]) - return false unless type_validator.valid?(@type) - return false if @amount.nil? - return false if @counterparty.nil? - return false if @status.nil? - return false if @created_at.nil? - return false if @last_status_update.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["BANK_TRANSFER", "PAYOUT", "PIS_PAY_IN", "REFUND", "FUNDS_SWEEP", "RETURN"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transaction_id == o.transaction_id && - wallet_id == o.wallet_id && - reference == o.reference && - type == o.type && - scheme == o.scheme && - amount == o.amount && - counterparty == o.counterparty && - status == o.status && - created_at == o.created_at && - last_status_update == o.last_status_update && - payment_id == o.payment_id && - failure_reason == o.failure_reason && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transaction_id, wallet_id, reference, type, scheme, amount, counterparty, status, created_at, last_status_update, payment_id, failure_reason, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_transaction_list_request.rb b/lib/plaid/models/wallet_transaction_list_request.rb deleted file mode 100644 index 75cb51db6..000000000 --- a/lib/plaid/models/wallet_transaction_list_request.rb +++ /dev/null @@ -1,342 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # WalletTransactionListRequest defines the request schema for `/wallet/transaction/list` - class WalletTransactionListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the e-wallet to fetch transactions from - attr_accessor :wallet_id - - # A base64 value representing the latest transaction that has already been requested. Set this to `next_cursor` received from the previous `/wallet/transaction/list` request. If provided, the response will only contain transactions created before that transaction. If omitted, the response will contain transactions starting from the most recent, and in descending order by the `created_at` time. - attr_accessor :cursor - - # The number of transactions to fetch - attr_accessor :count - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'wallet_id' => :'wallet_id', - :'cursor' => :'cursor', - :'count' => :'count', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'wallet_id' => :'String', - :'cursor' => :'String', - :'count' => :'Integer', - :'options' => :'WalletTransactionListRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'options' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletTransactionListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletTransactionListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'wallet_id') - self.wallet_id = attributes[:'wallet_id'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 10 - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @wallet_id.nil? - invalid_properties.push('invalid value for "wallet_id", wallet_id cannot be nil.') - end - - if @wallet_id.to_s.length < 1 - invalid_properties.push('invalid value for "wallet_id", the character length must be great than or equal to 1.') - end - - - if !@cursor.nil? && @cursor.to_s.length > 256 - invalid_properties.push('invalid value for "cursor", the character length must be smaller than or equal to 256.') - end - - - if !@count.nil? && @count > 200 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 200.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @wallet_id.nil? - return false if @wallet_id.to_s.length < 1 - return false if !@cursor.nil? && @cursor.to_s.length > 256 - return false if !@count.nil? && @count > 200 - return false if !@count.nil? && @count < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] wallet_id Value to be assigned - def wallet_id=(wallet_id) - if wallet_id.nil? - fail ArgumentError, 'wallet_id cannot be nil' - end - - if wallet_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "wallet_id", the character length must be great than or equal to 1.' - end - - - @wallet_id = wallet_id - end - - # Custom attribute writer method with validation - # @param [Object] cursor Value to be assigned - def cursor=(cursor) - if !cursor.nil? && cursor.to_s.length > 256 - fail ArgumentError, 'invalid value for "cursor", the character length must be smaller than or equal to 256.' - end - - - @cursor = cursor - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 200 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 200.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - wallet_id == o.wallet_id && - cursor == o.cursor && - count == o.count && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, wallet_id, cursor, count, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_transaction_list_request_options.rb b/lib/plaid/models/wallet_transaction_list_request_options.rb deleted file mode 100644 index e7a9719cc..000000000 --- a/lib/plaid/models/wallet_transaction_list_request_options.rb +++ /dev/null @@ -1,231 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Additional wallet transaction options - class WalletTransactionListRequestOptions - # Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DDThh:mm:ssZ) for filtering transactions, inclusive of the provided date. - attr_accessor :start_time - - # Timestamp in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format (YYYY-MM-DDThh:mm:ssZ) for filtering transactions, inclusive of the provided date. - attr_accessor :end_time - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'start_time' => :'start_time', - :'end_time' => :'end_time' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'start_time' => :'Time', - :'end_time' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletTransactionListRequestOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletTransactionListRequestOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'start_time') - self.start_time = attributes[:'start_time'] - end - - if attributes.key?(:'end_time') - self.end_time = attributes[:'end_time'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - start_time == o.start_time && - end_time == o.end_time - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [start_time, end_time].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_transaction_list_response.rb b/lib/plaid/models/wallet_transaction_list_response.rb deleted file mode 100644 index c1f7c7c81..000000000 --- a/lib/plaid/models/wallet_transaction_list_response.rb +++ /dev/null @@ -1,253 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # WalletTransactionListResponse defines the response schema for `/wallet/transaction/list` - class WalletTransactionListResponse - # An array of transactions of an e-wallet, associated with the given `wallet_id` - attr_accessor :transactions - - # Cursor used for fetching transactions created before the latest transaction provided in this response - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'transactions' => :'transactions', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'transactions' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletTransactionListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletTransactionListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'transactions') - if (value = attributes[:'transactions']).is_a?(Array) - self.transactions = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @transactions.nil? - invalid_properties.push('invalid value for "transactions", transactions cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @transactions.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - transactions == o.transactions && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [transactions, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_transaction_status.rb b/lib/plaid/models/wallet_transaction_status.rb deleted file mode 100644 index e5de43840..000000000 --- a/lib/plaid/models/wallet_transaction_status.rb +++ /dev/null @@ -1,43 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class WalletTransactionStatus - AUTHORISING = "AUTHORISING".freeze - INITIATED = "INITIATED".freeze - EXECUTED = "EXECUTED".freeze - SETTLED = "SETTLED".freeze - BLOCKED = "BLOCKED".freeze - FAILED = "FAILED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/wallet_transaction_status_update_webhook.rb b/lib/plaid/models/wallet_transaction_status_update_webhook.rb deleted file mode 100644 index c88228d90..000000000 --- a/lib/plaid/models/wallet_transaction_status_update_webhook.rb +++ /dev/null @@ -1,356 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when the status of a wallet transaction has changed. - class WalletTransactionStatusUpdateWebhook - # `WALLET` - attr_accessor :webhook_type - - # `WALLET_TRANSACTION_STATUS_UPDATE` - attr_accessor :webhook_code - - # The `transaction_id` for the wallet transaction being updated - attr_accessor :transaction_id - - # The `payment_id` associated with the transaction. This will be present in case of `REFUND` and `PIS_PAY_IN`. - attr_accessor :payment_id - - # The EMI (E-Money Institution) wallet that this payment is associated with. This wallet is used as an intermediary account to enable Plaid to reconcile the settlement of funds for Payment Initiation requests. - attr_accessor :wallet_id - - attr_accessor :new_status - - attr_accessor :old_status - - # The timestamp of the update, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) format, e.g. `\"2017-09-14T14:42:19.350Z\"` - attr_accessor :timestamp - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'transaction_id' => :'transaction_id', - :'payment_id' => :'payment_id', - :'wallet_id' => :'wallet_id', - :'new_status' => :'new_status', - :'old_status' => :'old_status', - :'timestamp' => :'timestamp', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'transaction_id' => :'String', - :'payment_id' => :'String', - :'wallet_id' => :'String', - :'new_status' => :'WalletTransactionStatus', - :'old_status' => :'WalletTransactionStatus', - :'timestamp' => :'Time', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'payment_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletTransactionStatusUpdateWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletTransactionStatusUpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'transaction_id') - self.transaction_id = attributes[:'transaction_id'] - end - - if attributes.key?(:'payment_id') - self.payment_id = attributes[:'payment_id'] - end - - if attributes.key?(:'wallet_id') - self.wallet_id = attributes[:'wallet_id'] - end - - if attributes.key?(:'new_status') - self.new_status = attributes[:'new_status'] - end - - if attributes.key?(:'old_status') - self.old_status = attributes[:'old_status'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @transaction_id.nil? - invalid_properties.push('invalid value for "transaction_id", transaction_id cannot be nil.') - end - - if @new_status.nil? - invalid_properties.push('invalid value for "new_status", new_status cannot be nil.') - end - - if @old_status.nil? - invalid_properties.push('invalid value for "old_status", old_status cannot be nil.') - end - - if @timestamp.nil? - invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @transaction_id.nil? - return false if @new_status.nil? - return false if @old_status.nil? - return false if @timestamp.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - transaction_id == o.transaction_id && - payment_id == o.payment_id && - wallet_id == o.wallet_id && - new_status == o.new_status && - old_status == o.old_status && - timestamp == o.timestamp && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, transaction_id, payment_id, wallet_id, new_status, old_status, timestamp, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/wallet_transactions_list_request.rb b/lib/plaid/models/wallet_transactions_list_request.rb deleted file mode 100644 index ad05a294e..000000000 --- a/lib/plaid/models/wallet_transactions_list_request.rb +++ /dev/null @@ -1,342 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # WalletTransactionListRequest defines the request schema for `/wallet/transaction/list` - class WalletTransactionsListRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The ID of the e-wallet to fetch transactions from - attr_accessor :wallet_id - - # A base64 value representing the latest transaction that has already been requested. Set this to `next_cursor` received from the previous `/wallet/transaction/list` request. If provided, the response will only contain transactions created before that transaction. If omitted, the response will contain transactions starting from the most recent, and in descending order by the `created_at` time. - attr_accessor :cursor - - # The number of transactions to fetch - attr_accessor :count - - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'wallet_id' => :'wallet_id', - :'cursor' => :'cursor', - :'count' => :'count', - :'options' => :'options' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'wallet_id' => :'String', - :'cursor' => :'String', - :'count' => :'Integer', - :'options' => :'WalletTransactionListRequestOptions' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'options' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WalletTransactionsListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WalletTransactionsListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'wallet_id') - self.wallet_id = attributes[:'wallet_id'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - - if attributes.key?(:'count') - self.count = attributes[:'count'] - else - self.count = 10 - end - - if attributes.key?(:'options') - self.options = attributes[:'options'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @wallet_id.nil? - invalid_properties.push('invalid value for "wallet_id", wallet_id cannot be nil.') - end - - if @wallet_id.to_s.length < 1 - invalid_properties.push('invalid value for "wallet_id", the character length must be great than or equal to 1.') - end - - - if !@cursor.nil? && @cursor.to_s.length > 256 - invalid_properties.push('invalid value for "cursor", the character length must be smaller than or equal to 256.') - end - - - if !@count.nil? && @count > 200 - invalid_properties.push('invalid value for "count", must be smaller than or equal to 200.') - end - - if !@count.nil? && @count < 1 - invalid_properties.push('invalid value for "count", must be greater than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @wallet_id.nil? - return false if @wallet_id.to_s.length < 1 - return false if !@cursor.nil? && @cursor.to_s.length > 256 - return false if !@count.nil? && @count > 200 - return false if !@count.nil? && @count < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] wallet_id Value to be assigned - def wallet_id=(wallet_id) - if wallet_id.nil? - fail ArgumentError, 'wallet_id cannot be nil' - end - - if wallet_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "wallet_id", the character length must be great than or equal to 1.' - end - - - @wallet_id = wallet_id - end - - # Custom attribute writer method with validation - # @param [Object] cursor Value to be assigned - def cursor=(cursor) - if !cursor.nil? && cursor.to_s.length > 256 - fail ArgumentError, 'invalid value for "cursor", the character length must be smaller than or equal to 256.' - end - - - @cursor = cursor - end - - # Custom attribute writer method with validation - # @param [Object] count Value to be assigned - def count=(count) - if !count.nil? && count > 200 - fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 200.' - end - - if !count.nil? && count < 1 - fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.' - end - - - @count = count - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - wallet_id == o.wallet_id && - cursor == o.cursor && - count == o.count && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, wallet_id, cursor, count, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/warning.rb b/lib/plaid/models/warning.rb deleted file mode 100644 index 18b6791b2..000000000 --- a/lib/plaid/models/warning.rb +++ /dev/null @@ -1,289 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # It is possible for an Asset Report to be returned with missing account owner information. In such cases, the Asset Report will contain warning data in the response, indicating why obtaining the owner information failed. - class Warning - # The warning type, which will always be `ASSET_REPORT_WARNING` - attr_accessor :warning_type - - # 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. - attr_accessor :warning_code - - attr_accessor :cause - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'warning_type' => :'warning_type', - :'warning_code' => :'warning_code', - :'cause' => :'cause' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'warning_type' => :'String', - :'warning_code' => :'String', - :'cause' => :'Cause' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::Warning` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::Warning`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'warning_type') - self.warning_type = attributes[:'warning_type'] - end - - if attributes.key?(:'warning_code') - self.warning_code = attributes[:'warning_code'] - end - - if attributes.key?(:'cause') - self.cause = attributes[:'cause'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @warning_type.nil? - invalid_properties.push('invalid value for "warning_type", warning_type cannot be nil.') - end - - if @warning_code.nil? - invalid_properties.push('invalid value for "warning_code", warning_code cannot be nil.') - end - - if @cause.nil? - invalid_properties.push('invalid value for "cause", cause cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @warning_type.nil? - return false if @warning_code.nil? - warning_code_validator = EnumAttributeValidator.new('String', ["OWNERS_UNAVAILABLE", "INVESTMENTS_UNAVAILABLE", "TRANSACTIONS_UNAVAILABLE"]) - return false unless warning_code_validator.valid?(@warning_code) - return false if @cause.nil? - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] warning_code Object to be assigned - def warning_code=(warning_code) - validator = EnumAttributeValidator.new('String', ["OWNERS_UNAVAILABLE", "INVESTMENTS_UNAVAILABLE", "TRANSACTIONS_UNAVAILABLE"]) - unless validator.valid?(warning_code) - fail ArgumentError, "invalid value for \"warning_code\", must be one of #{validator.allowable_values}." - end - @warning_code = warning_code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - warning_type == o.warning_type && - warning_code == o.warning_code && - cause == o.cause - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [warning_type, warning_code, cause].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_audit_trail.rb b/lib/plaid/models/watchlist_screening_audit_trail.rb deleted file mode 100644 index ed1ad4988..000000000 --- a/lib/plaid/models/watchlist_screening_audit_trail.rb +++ /dev/null @@ -1,273 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Information about the last change made to the parent object specifying what caused the change as well as when it occurred. - class WatchlistScreeningAuditTrail - attr_accessor :source - - # ID of the associated user. - attr_accessor :dashboard_user_id - - # An ISO8601 formatted timestamp. - attr_accessor :timestamp - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'source' => :'source', - :'dashboard_user_id' => :'dashboard_user_id', - :'timestamp' => :'timestamp' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'source' => :'Source', - :'dashboard_user_id' => :'String', - :'timestamp' => :'Time' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'dashboard_user_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningAuditTrail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningAuditTrail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'source') - self.source = attributes[:'source'] - end - - if attributes.key?(:'dashboard_user_id') - self.dashboard_user_id = attributes[:'dashboard_user_id'] - end - - if attributes.key?(:'timestamp') - self.timestamp = attributes[:'timestamp'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @source.nil? - invalid_properties.push('invalid value for "source", source cannot be nil.') - end - - if @timestamp.nil? - invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @source.nil? - return false if @timestamp.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - source == o.source && - dashboard_user_id == o.dashboard_user_id && - timestamp == o.timestamp - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [source, dashboard_user_id, timestamp].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_document.rb b/lib/plaid/models/watchlist_screening_document.rb deleted file mode 100644 index c2bd0e784..000000000 --- a/lib/plaid/models/watchlist_screening_document.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # An official document, usually issued by a governing body or institution, with an associated identifier. - class WatchlistScreeningDocument - attr_accessor :type - - # The numeric or alphanumeric identifier associated with this document. - attr_accessor :number - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'type', - :'number' => :'number' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'WatchlistScreeningDocumentType', - :'number' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningDocument` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningDocument`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'number') - self.number = attributes[:'number'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @number.nil? - invalid_properties.push('invalid value for "number", number cannot be nil.') - end - - if @number.to_s.length < 4 - invalid_properties.push('invalid value for "number", the character length must be great than or equal to 4.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - return false if @number.nil? - return false if @number.to_s.length < 4 - true - end - - # Custom attribute writer method with validation - # @param [Object] number Value to be assigned - def number=(number) - if number.nil? - fail ArgumentError, 'number cannot be nil' - end - - if number.to_s.length < 4 - fail ArgumentError, 'invalid value for "number", the character length must be great than or equal to 4.' - end - - - @number = number - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - number == o.number - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, number].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_document_type.rb b/lib/plaid/models/watchlist_screening_document_type.rb deleted file mode 100644 index 9af49ee0c..000000000 --- a/lib/plaid/models/watchlist_screening_document_type.rb +++ /dev/null @@ -1,50 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class WatchlistScreeningDocumentType - BIRTH_CERTIFICATE = "birth_certificate".freeze - DRIVERS_LICENSE = "drivers_license".freeze - IMMIGRATION_NUMBER = "immigration_number".freeze - MILITARY_ID = "military_id".freeze - OTHER = "other".freeze - PASSPORT = "passport".freeze - PERSONAL_IDENTIFICATION = "personal_identification".freeze - RATION_CARD = "ration_card".freeze - SSN = "ssn".freeze - STUDENT_ID = "student_id".freeze - TAX_ID = "tax_id".freeze - TRAVEL_DOCUMENT = "travel_document".freeze - VOTER_ID = "voter_id".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_create_request.rb b/lib/plaid/models/watchlist_screening_entity_create_request.rb deleted file mode 100644 index c7c74ecd5..000000000 --- a/lib/plaid/models/watchlist_screening_entity_create_request.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for creating an entity screening review - class WatchlistScreeningEntityCreateRequest - attr_accessor :search_terms - - # 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`. - attr_accessor :client_user_id - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'search_terms' => :'search_terms', - :'client_user_id' => :'client_user_id', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'search_terms' => :'EntityWatchlistSearchTerms', - :'client_user_id' => :'String', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'search_terms') - self.search_terms = attributes[:'search_terms'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @search_terms.nil? - invalid_properties.push('invalid value for "search_terms", search_terms cannot be nil.') - end - - if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @search_terms.nil? - return false if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if !client_user_id.nil? && client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - search_terms == o.search_terms && - client_user_id == o.client_user_id && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [search_terms, client_user_id, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_create_response.rb b/lib/plaid/models/watchlist_screening_entity_create_response.rb deleted file mode 100644 index 243c7852a..000000000 --- a/lib/plaid/models/watchlist_screening_entity_create_response.rb +++ /dev/null @@ -1,344 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class WatchlistScreeningEntityCreateResponse - # ID of the associated entity screening. - attr_accessor :id - - attr_accessor :search_terms - - # ID of the associated user. - attr_accessor :assignee - - attr_accessor :status - - # 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`. - attr_accessor :client_user_id - - attr_accessor :audit_trail - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'search_terms' => :'search_terms', - :'assignee' => :'assignee', - :'status' => :'status', - :'client_user_id' => :'client_user_id', - :'audit_trail' => :'audit_trail', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'search_terms' => :'EntityWatchlistScreeningSearchTerms', - :'assignee' => :'String', - :'status' => :'WatchlistScreeningStatus', - :'client_user_id' => :'String', - :'audit_trail' => :'WatchlistScreeningAuditTrail', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'assignee', - :'client_user_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'search_terms') - self.search_terms = attributes[:'search_terms'] - end - - if attributes.key?(:'assignee') - self.assignee = attributes[:'assignee'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @search_terms.nil? - invalid_properties.push('invalid value for "search_terms", search_terms cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @search_terms.nil? - return false if @status.nil? - return false if @client_user_id.to_s.length < 1 - return false if @audit_trail.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - search_terms == o.search_terms && - assignee == o.assignee && - status == o.status && - client_user_id == o.client_user_id && - audit_trail == o.audit_trail && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, search_terms, assignee, status, client_user_id, audit_trail, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_get_request.rb b/lib/plaid/models/watchlist_screening_entity_get_request.rb deleted file mode 100644 index c530981c4..000000000 --- a/lib/plaid/models/watchlist_screening_entity_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for fetching an entity watchlist screening - class WatchlistScreeningEntityGetRequest - # ID of the associated entity screening. - attr_accessor :entity_watchlist_screening_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'entity_watchlist_screening_id' => :'entity_watchlist_screening_id', - :'secret' => :'secret', - :'client_id' => :'client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'entity_watchlist_screening_id' => :'String', - :'secret' => :'String', - :'client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'entity_watchlist_screening_id') - self.entity_watchlist_screening_id = attributes[:'entity_watchlist_screening_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @entity_watchlist_screening_id.nil? - invalid_properties.push('invalid value for "entity_watchlist_screening_id", entity_watchlist_screening_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @entity_watchlist_screening_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - entity_watchlist_screening_id == o.entity_watchlist_screening_id && - secret == o.secret && - client_id == o.client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [entity_watchlist_screening_id, secret, client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_get_response.rb b/lib/plaid/models/watchlist_screening_entity_get_response.rb deleted file mode 100644 index 71452a13d..000000000 --- a/lib/plaid/models/watchlist_screening_entity_get_response.rb +++ /dev/null @@ -1,344 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class WatchlistScreeningEntityGetResponse - # ID of the associated entity screening. - attr_accessor :id - - attr_accessor :search_terms - - # ID of the associated user. - attr_accessor :assignee - - attr_accessor :status - - # 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`. - attr_accessor :client_user_id - - attr_accessor :audit_trail - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'search_terms' => :'search_terms', - :'assignee' => :'assignee', - :'status' => :'status', - :'client_user_id' => :'client_user_id', - :'audit_trail' => :'audit_trail', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'search_terms' => :'EntityWatchlistScreeningSearchTerms', - :'assignee' => :'String', - :'status' => :'WatchlistScreeningStatus', - :'client_user_id' => :'String', - :'audit_trail' => :'WatchlistScreeningAuditTrail', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'assignee', - :'client_user_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'search_terms') - self.search_terms = attributes[:'search_terms'] - end - - if attributes.key?(:'assignee') - self.assignee = attributes[:'assignee'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @search_terms.nil? - invalid_properties.push('invalid value for "search_terms", search_terms cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @search_terms.nil? - return false if @status.nil? - return false if @client_user_id.to_s.length < 1 - return false if @audit_trail.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - search_terms == o.search_terms && - assignee == o.assignee && - status == o.status && - client_user_id == o.client_user_id && - audit_trail == o.audit_trail && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, search_terms, assignee, status, client_user_id, audit_trail, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_history_list_request.rb b/lib/plaid/models/watchlist_screening_entity_history_list_request.rb deleted file mode 100644 index 86b806e1e..000000000 --- a/lib/plaid/models/watchlist_screening_entity_history_list_request.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for listing changes to entity watchlist screenings - class WatchlistScreeningEntityHistoryListRequest - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # ID of the associated entity screening. - attr_accessor :entity_watchlist_screening_id - - # An identifier that determines which page of results you receive. - attr_accessor :cursor - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'secret' => :'secret', - :'client_id' => :'client_id', - :'entity_watchlist_screening_id' => :'entity_watchlist_screening_id', - :'cursor' => :'cursor' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'secret' => :'String', - :'client_id' => :'String', - :'entity_watchlist_screening_id' => :'String', - :'cursor' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'cursor' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityHistoryListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityHistoryListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'entity_watchlist_screening_id') - self.entity_watchlist_screening_id = attributes[:'entity_watchlist_screening_id'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @entity_watchlist_screening_id.nil? - invalid_properties.push('invalid value for "entity_watchlist_screening_id", entity_watchlist_screening_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @entity_watchlist_screening_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - secret == o.secret && - client_id == o.client_id && - entity_watchlist_screening_id == o.entity_watchlist_screening_id && - cursor == o.cursor - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [secret, client_id, entity_watchlist_screening_id, cursor].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_history_list_response.rb b/lib/plaid/models/watchlist_screening_entity_history_list_response.rb deleted file mode 100644 index 9504f502b..000000000 --- a/lib/plaid/models/watchlist_screening_entity_history_list_response.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Paginated list of entity watchlist screenings - class WatchlistScreeningEntityHistoryListResponse - # List of entity watchlist screening - attr_accessor :entity_watchlist_screenings - - # An identifier that determines which page of results you receive. - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'entity_watchlist_screenings' => :'entity_watchlist_screenings', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'entity_watchlist_screenings' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityHistoryListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityHistoryListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'entity_watchlist_screenings') - if (value = attributes[:'entity_watchlist_screenings']).is_a?(Array) - self.entity_watchlist_screenings = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @entity_watchlist_screenings.nil? - invalid_properties.push('invalid value for "entity_watchlist_screenings", entity_watchlist_screenings cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @entity_watchlist_screenings.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - entity_watchlist_screenings == o.entity_watchlist_screenings && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [entity_watchlist_screenings, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_hit_list_request.rb b/lib/plaid/models/watchlist_screening_entity_hit_list_request.rb deleted file mode 100644 index b757f0749..000000000 --- a/lib/plaid/models/watchlist_screening_entity_hit_list_request.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for listing hits for an entity watchlist screening - class WatchlistScreeningEntityHitListRequest - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # ID of the associated entity screening. - attr_accessor :entity_watchlist_screening_id - - # An identifier that determines which page of results you receive. - attr_accessor :cursor - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'secret' => :'secret', - :'client_id' => :'client_id', - :'entity_watchlist_screening_id' => :'entity_watchlist_screening_id', - :'cursor' => :'cursor' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'secret' => :'String', - :'client_id' => :'String', - :'entity_watchlist_screening_id' => :'String', - :'cursor' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'cursor' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityHitListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityHitListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'entity_watchlist_screening_id') - self.entity_watchlist_screening_id = attributes[:'entity_watchlist_screening_id'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @entity_watchlist_screening_id.nil? - invalid_properties.push('invalid value for "entity_watchlist_screening_id", entity_watchlist_screening_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @entity_watchlist_screening_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - secret == o.secret && - client_id == o.client_id && - entity_watchlist_screening_id == o.entity_watchlist_screening_id && - cursor == o.cursor - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [secret, client_id, entity_watchlist_screening_id, cursor].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_hit_list_response.rb b/lib/plaid/models/watchlist_screening_entity_hit_list_response.rb deleted file mode 100644 index e39c759e5..000000000 --- a/lib/plaid/models/watchlist_screening_entity_hit_list_response.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Paginated list of entity watchlist screening hits - class WatchlistScreeningEntityHitListResponse - # List of entity watchlist screening hits - attr_accessor :entity_watchlist_screening_hits - - # An identifier that determines which page of results you receive. - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'entity_watchlist_screening_hits' => :'entity_watchlist_screening_hits', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'entity_watchlist_screening_hits' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityHitListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityHitListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'entity_watchlist_screening_hits') - if (value = attributes[:'entity_watchlist_screening_hits']).is_a?(Array) - self.entity_watchlist_screening_hits = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @entity_watchlist_screening_hits.nil? - invalid_properties.push('invalid value for "entity_watchlist_screening_hits", entity_watchlist_screening_hits cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @entity_watchlist_screening_hits.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - entity_watchlist_screening_hits == o.entity_watchlist_screening_hits && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [entity_watchlist_screening_hits, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_list_request.rb b/lib/plaid/models/watchlist_screening_entity_list_request.rb deleted file mode 100644 index 3db5fbe47..000000000 --- a/lib/plaid/models/watchlist_screening_entity_list_request.rb +++ /dev/null @@ -1,325 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for listing entity watchlist screenings - class WatchlistScreeningEntityListRequest - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # ID of the associated entity program. - attr_accessor :entity_watchlist_program_id - - # 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`. - attr_accessor :client_user_id - - attr_accessor :status - - # ID of the associated user. - attr_accessor :assignee - - # An identifier that determines which page of results you receive. - attr_accessor :cursor - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'secret' => :'secret', - :'client_id' => :'client_id', - :'entity_watchlist_program_id' => :'entity_watchlist_program_id', - :'client_user_id' => :'client_user_id', - :'status' => :'status', - :'assignee' => :'assignee', - :'cursor' => :'cursor' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'secret' => :'String', - :'client_id' => :'String', - :'entity_watchlist_program_id' => :'String', - :'client_user_id' => :'String', - :'status' => :'WatchlistScreeningStatus', - :'assignee' => :'String', - :'cursor' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'cursor' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'entity_watchlist_program_id') - self.entity_watchlist_program_id = attributes[:'entity_watchlist_program_id'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'assignee') - self.assignee = attributes[:'assignee'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @entity_watchlist_program_id.nil? - invalid_properties.push('invalid value for "entity_watchlist_program_id", entity_watchlist_program_id cannot be nil.') - end - - if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @entity_watchlist_program_id.nil? - return false if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if !client_user_id.nil? && client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - secret == o.secret && - client_id == o.client_id && - entity_watchlist_program_id == o.entity_watchlist_program_id && - client_user_id == o.client_user_id && - status == o.status && - assignee == o.assignee && - cursor == o.cursor - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [secret, client_id, entity_watchlist_program_id, client_user_id, status, assignee, cursor].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_list_response.rb b/lib/plaid/models/watchlist_screening_entity_list_response.rb deleted file mode 100644 index 4f9fc7473..000000000 --- a/lib/plaid/models/watchlist_screening_entity_list_response.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Paginated list of entity watchlist screenings - class WatchlistScreeningEntityListResponse - # List of entity watchlist screening - attr_accessor :entity_watchlist_screenings - - # An identifier that determines which page of results you receive. - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'entity_watchlist_screenings' => :'entity_watchlist_screenings', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'entity_watchlist_screenings' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'entity_watchlist_screenings') - if (value = attributes[:'entity_watchlist_screenings']).is_a?(Array) - self.entity_watchlist_screenings = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @entity_watchlist_screenings.nil? - invalid_properties.push('invalid value for "entity_watchlist_screenings", entity_watchlist_screenings cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @entity_watchlist_screenings.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - entity_watchlist_screenings == o.entity_watchlist_screenings && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [entity_watchlist_screenings, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_program_get_request.rb b/lib/plaid/models/watchlist_screening_entity_program_get_request.rb deleted file mode 100644 index 699624aa0..000000000 --- a/lib/plaid/models/watchlist_screening_entity_program_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for fetching an entity watchlist program - class WatchlistScreeningEntityProgramGetRequest - # ID of the associated entity program. - attr_accessor :entity_watchlist_program_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'entity_watchlist_program_id' => :'entity_watchlist_program_id', - :'secret' => :'secret', - :'client_id' => :'client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'entity_watchlist_program_id' => :'String', - :'secret' => :'String', - :'client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityProgramGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityProgramGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'entity_watchlist_program_id') - self.entity_watchlist_program_id = attributes[:'entity_watchlist_program_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @entity_watchlist_program_id.nil? - invalid_properties.push('invalid value for "entity_watchlist_program_id", entity_watchlist_program_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @entity_watchlist_program_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - entity_watchlist_program_id == o.entity_watchlist_program_id && - secret == o.secret && - client_id == o.client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [entity_watchlist_program_id, secret, client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_program_get_response.rb b/lib/plaid/models/watchlist_screening_entity_program_get_response.rb deleted file mode 100644 index e5d100e9e..000000000 --- a/lib/plaid/models/watchlist_screening_entity_program_get_response.rb +++ /dev/null @@ -1,401 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A program that configures the active lists, search parameters, and other behavior for initial and ongoing screening of entities. - class WatchlistScreeningEntityProgramGetResponse - # ID of the associated entity program. - attr_accessor :id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - # Indicator specifying whether the program is enabled and will perform daily rescans. - attr_accessor :is_rescanning_enabled - - # Watchlists enabled for the associated program - attr_accessor :lists_enabled - - # A name for the entity program to define its purpose. For example, \"High Risk Organizations\" or \"Applicants\". - attr_accessor :name - - attr_accessor :name_sensitivity - - attr_accessor :audit_trail - - # Archived programs are read-only and cannot screen new customers nor participate in ongoing monitoring. - attr_accessor :is_archived - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'created_at' => :'created_at', - :'is_rescanning_enabled' => :'is_rescanning_enabled', - :'lists_enabled' => :'lists_enabled', - :'name' => :'name', - :'name_sensitivity' => :'name_sensitivity', - :'audit_trail' => :'audit_trail', - :'is_archived' => :'is_archived', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'created_at' => :'Time', - :'is_rescanning_enabled' => :'Boolean', - :'lists_enabled' => :'Array', - :'name' => :'String', - :'name_sensitivity' => :'ProgramNameSensitivity', - :'audit_trail' => :'WatchlistScreeningAuditTrail', - :'is_archived' => :'Boolean', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityProgramGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityProgramGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'is_rescanning_enabled') - self.is_rescanning_enabled = attributes[:'is_rescanning_enabled'] - end - - if attributes.key?(:'lists_enabled') - if (value = attributes[:'lists_enabled']).is_a?(Array) - self.lists_enabled = value - end - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'name_sensitivity') - self.name_sensitivity = attributes[:'name_sensitivity'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'is_archived') - self.is_archived = attributes[:'is_archived'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @is_rescanning_enabled.nil? - invalid_properties.push('invalid value for "is_rescanning_enabled", is_rescanning_enabled cannot be nil.') - end - - if @lists_enabled.nil? - invalid_properties.push('invalid value for "lists_enabled", lists_enabled cannot be nil.') - end - - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @name.to_s.length < 1 - invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') - end - - - if @name_sensitivity.nil? - invalid_properties.push('invalid value for "name_sensitivity", name_sensitivity cannot be nil.') - end - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @is_archived.nil? - invalid_properties.push('invalid value for "is_archived", is_archived cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @created_at.nil? - return false if @is_rescanning_enabled.nil? - return false if @lists_enabled.nil? - return false if @name.nil? - return false if @name.to_s.length < 1 - return false if @name_sensitivity.nil? - return false if @audit_trail.nil? - return false if @is_archived.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] lists_enabled Value to be assigned - def lists_enabled=(lists_enabled) - if lists_enabled.nil? - fail ArgumentError, 'lists_enabled cannot be nil' - end - - - @lists_enabled = lists_enabled - end - - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if name.nil? - fail ArgumentError, 'name cannot be nil' - end - - if name.to_s.length < 1 - fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' - end - - - @name = name - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - created_at == o.created_at && - is_rescanning_enabled == o.is_rescanning_enabled && - lists_enabled == o.lists_enabled && - name == o.name && - name_sensitivity == o.name_sensitivity && - audit_trail == o.audit_trail && - is_archived == o.is_archived && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, created_at, is_rescanning_enabled, lists_enabled, name, name_sensitivity, audit_trail, is_archived, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_program_list_request.rb b/lib/plaid/models/watchlist_screening_entity_program_list_request.rb deleted file mode 100644 index 830dcca1a..000000000 --- a/lib/plaid/models/watchlist_screening_entity_program_list_request.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for listing entity watchlist screening programs - class WatchlistScreeningEntityProgramListRequest - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # An identifier that determines which page of results you receive. - attr_accessor :cursor - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'secret' => :'secret', - :'client_id' => :'client_id', - :'cursor' => :'cursor' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'secret' => :'String', - :'client_id' => :'String', - :'cursor' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'cursor' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityProgramListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityProgramListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - secret == o.secret && - client_id == o.client_id && - cursor == o.cursor - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [secret, client_id, cursor].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_program_list_response.rb b/lib/plaid/models/watchlist_screening_entity_program_list_response.rb deleted file mode 100644 index b5dc732ac..000000000 --- a/lib/plaid/models/watchlist_screening_entity_program_list_response.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Paginated list of entity watchlist screening programs - class WatchlistScreeningEntityProgramListResponse - # List of entity watchlist screening programs - attr_accessor :entity_watchlist_programs - - # An identifier that determines which page of results you receive. - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'entity_watchlist_programs' => :'entity_watchlist_programs', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'entity_watchlist_programs' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityProgramListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityProgramListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'entity_watchlist_programs') - if (value = attributes[:'entity_watchlist_programs']).is_a?(Array) - self.entity_watchlist_programs = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @entity_watchlist_programs.nil? - invalid_properties.push('invalid value for "entity_watchlist_programs", entity_watchlist_programs cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @entity_watchlist_programs.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - entity_watchlist_programs == o.entity_watchlist_programs && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [entity_watchlist_programs, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_review_create_request.rb b/lib/plaid/models/watchlist_screening_entity_review_create_request.rb deleted file mode 100644 index acb468ca0..000000000 --- a/lib/plaid/models/watchlist_screening_entity_review_create_request.rb +++ /dev/null @@ -1,308 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for creating a review for an entity screening - class WatchlistScreeningEntityReviewCreateRequest - # Hits to mark as a true positive after thorough manual review. These hits will never recur or be updated once dismissed. In most cases, confirmed hits indicate that the customer should be rejected. - attr_accessor :confirmed_hits - - # Hits to mark as a false positive after thorough manual review. These hits will never recur or be updated once dismissed. - attr_accessor :dismissed_hits - - # A comment submitted by a team member as part of reviewing a watchlist screening. - attr_accessor :comment - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # ID of the associated entity screening. - attr_accessor :entity_watchlist_screening_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'confirmed_hits' => :'confirmed_hits', - :'dismissed_hits' => :'dismissed_hits', - :'comment' => :'comment', - :'client_id' => :'client_id', - :'secret' => :'secret', - :'entity_watchlist_screening_id' => :'entity_watchlist_screening_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'confirmed_hits' => :'Array', - :'dismissed_hits' => :'Array', - :'comment' => :'String', - :'client_id' => :'String', - :'secret' => :'String', - :'entity_watchlist_screening_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'comment', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityReviewCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityReviewCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'confirmed_hits') - if (value = attributes[:'confirmed_hits']).is_a?(Array) - self.confirmed_hits = value - end - end - - if attributes.key?(:'dismissed_hits') - if (value = attributes[:'dismissed_hits']).is_a?(Array) - self.dismissed_hits = value - end - end - - if attributes.key?(:'comment') - self.comment = attributes[:'comment'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'entity_watchlist_screening_id') - self.entity_watchlist_screening_id = attributes[:'entity_watchlist_screening_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @confirmed_hits.nil? - invalid_properties.push('invalid value for "confirmed_hits", confirmed_hits cannot be nil.') - end - - if @dismissed_hits.nil? - invalid_properties.push('invalid value for "dismissed_hits", dismissed_hits cannot be nil.') - end - - if !@comment.nil? && @comment.to_s.length < 1 - invalid_properties.push('invalid value for "comment", the character length must be great than or equal to 1.') - end - - - if @entity_watchlist_screening_id.nil? - invalid_properties.push('invalid value for "entity_watchlist_screening_id", entity_watchlist_screening_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @confirmed_hits.nil? - return false if @dismissed_hits.nil? - return false if !@comment.nil? && @comment.to_s.length < 1 - return false if @entity_watchlist_screening_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] comment Value to be assigned - def comment=(comment) - if !comment.nil? && comment.to_s.length < 1 - fail ArgumentError, 'invalid value for "comment", the character length must be great than or equal to 1.' - end - - - @comment = comment - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - confirmed_hits == o.confirmed_hits && - dismissed_hits == o.dismissed_hits && - comment == o.comment && - client_id == o.client_id && - secret == o.secret && - entity_watchlist_screening_id == o.entity_watchlist_screening_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [confirmed_hits, dismissed_hits, comment, client_id, secret, entity_watchlist_screening_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_review_create_response.rb b/lib/plaid/models/watchlist_screening_entity_review_create_response.rb deleted file mode 100644 index 470637426..000000000 --- a/lib/plaid/models/watchlist_screening_entity_review_create_response.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class WatchlistScreeningEntityReviewCreateResponse - # ID of the associated entity review. - attr_accessor :id - - # Hits marked as a true positive after thorough manual review. These hits will never recur or be updated once dismissed. In most cases, confirmed hits indicate that the customer should be rejected. - attr_accessor :confirmed_hits - - # Hits marked as a false positive after thorough manual review. These hits will never recur or be updated once dismissed. - attr_accessor :dismissed_hits - - # A comment submitted by a team member as part of reviewing a watchlist screening. - attr_accessor :comment - - attr_accessor :audit_trail - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'confirmed_hits' => :'confirmed_hits', - :'dismissed_hits' => :'dismissed_hits', - :'comment' => :'comment', - :'audit_trail' => :'audit_trail', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'confirmed_hits' => :'Array', - :'dismissed_hits' => :'Array', - :'comment' => :'String', - :'audit_trail' => :'WatchlistScreeningAuditTrail', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'comment', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityReviewCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityReviewCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'confirmed_hits') - if (value = attributes[:'confirmed_hits']).is_a?(Array) - self.confirmed_hits = value - end - end - - if attributes.key?(:'dismissed_hits') - if (value = attributes[:'dismissed_hits']).is_a?(Array) - self.dismissed_hits = value - end - end - - if attributes.key?(:'comment') - self.comment = attributes[:'comment'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @confirmed_hits.nil? - invalid_properties.push('invalid value for "confirmed_hits", confirmed_hits cannot be nil.') - end - - if @dismissed_hits.nil? - invalid_properties.push('invalid value for "dismissed_hits", dismissed_hits cannot be nil.') - end - - if @comment.to_s.length < 1 - invalid_properties.push('invalid value for "comment", the character length must be great than or equal to 1.') - end - - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @confirmed_hits.nil? - return false if @dismissed_hits.nil? - return false if @comment.to_s.length < 1 - return false if @audit_trail.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] comment Value to be assigned - def comment=(comment) - if comment.to_s.length < 1 - fail ArgumentError, 'invalid value for "comment", the character length must be great than or equal to 1.' - end - - - @comment = comment - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - confirmed_hits == o.confirmed_hits && - dismissed_hits == o.dismissed_hits && - comment == o.comment && - audit_trail == o.audit_trail && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, confirmed_hits, dismissed_hits, comment, audit_trail, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_review_list_request.rb b/lib/plaid/models/watchlist_screening_entity_review_list_request.rb deleted file mode 100644 index 5b70d8f1c..000000000 --- a/lib/plaid/models/watchlist_screening_entity_review_list_request.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for listing reviews for an entity watchlist screening - class WatchlistScreeningEntityReviewListRequest - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # ID of the associated entity screening. - attr_accessor :entity_watchlist_screening_id - - # An identifier that determines which page of results you receive. - attr_accessor :cursor - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'secret' => :'secret', - :'client_id' => :'client_id', - :'entity_watchlist_screening_id' => :'entity_watchlist_screening_id', - :'cursor' => :'cursor' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'secret' => :'String', - :'client_id' => :'String', - :'entity_watchlist_screening_id' => :'String', - :'cursor' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'cursor' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityReviewListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityReviewListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'entity_watchlist_screening_id') - self.entity_watchlist_screening_id = attributes[:'entity_watchlist_screening_id'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @entity_watchlist_screening_id.nil? - invalid_properties.push('invalid value for "entity_watchlist_screening_id", entity_watchlist_screening_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @entity_watchlist_screening_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - secret == o.secret && - client_id == o.client_id && - entity_watchlist_screening_id == o.entity_watchlist_screening_id && - cursor == o.cursor - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [secret, client_id, entity_watchlist_screening_id, cursor].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_review_list_response.rb b/lib/plaid/models/watchlist_screening_entity_review_list_response.rb deleted file mode 100644 index fd814a73e..000000000 --- a/lib/plaid/models/watchlist_screening_entity_review_list_response.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Paginated list of entity watchlist screening reviews - class WatchlistScreeningEntityReviewListResponse - # List of entity watchlist screening reviews - attr_accessor :entity_watchlist_screening_reviews - - # An identifier that determines which page of results you receive. - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'entity_watchlist_screening_reviews' => :'entity_watchlist_screening_reviews', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'entity_watchlist_screening_reviews' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityReviewListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityReviewListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'entity_watchlist_screening_reviews') - if (value = attributes[:'entity_watchlist_screening_reviews']).is_a?(Array) - self.entity_watchlist_screening_reviews = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @entity_watchlist_screening_reviews.nil? - invalid_properties.push('invalid value for "entity_watchlist_screening_reviews", entity_watchlist_screening_reviews cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @entity_watchlist_screening_reviews.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - entity_watchlist_screening_reviews == o.entity_watchlist_screening_reviews && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [entity_watchlist_screening_reviews, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_update_request.rb b/lib/plaid/models/watchlist_screening_entity_update_request.rb deleted file mode 100644 index 10fdaeff6..000000000 --- a/lib/plaid/models/watchlist_screening_entity_update_request.rb +++ /dev/null @@ -1,337 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for editing an entity watchlist screening - class WatchlistScreeningEntityUpdateRequest - # ID of the associated entity screening. - attr_accessor :entity_watchlist_screening_id - - attr_accessor :search_terms - - # ID of the associated user. - attr_accessor :assignee - - attr_accessor :status - - # 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`. - attr_accessor :client_user_id - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A list of fields to reset back to null - attr_accessor :reset_fields - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'entity_watchlist_screening_id' => :'entity_watchlist_screening_id', - :'search_terms' => :'search_terms', - :'assignee' => :'assignee', - :'status' => :'status', - :'client_user_id' => :'client_user_id', - :'client_id' => :'client_id', - :'secret' => :'secret', - :'reset_fields' => :'reset_fields' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'entity_watchlist_screening_id' => :'String', - :'search_terms' => :'UpdateEntityScreeningRequestSearchTerms', - :'assignee' => :'String', - :'status' => :'WatchlistScreeningStatus', - :'client_user_id' => :'String', - :'client_id' => :'String', - :'secret' => :'String', - :'reset_fields' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'search_terms', - :'reset_fields' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityUpdateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'entity_watchlist_screening_id') - self.entity_watchlist_screening_id = attributes[:'entity_watchlist_screening_id'] - end - - if attributes.key?(:'search_terms') - self.search_terms = attributes[:'search_terms'] - end - - if attributes.key?(:'assignee') - self.assignee = attributes[:'assignee'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'reset_fields') - if (value = attributes[:'reset_fields']).is_a?(Array) - self.reset_fields = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @entity_watchlist_screening_id.nil? - invalid_properties.push('invalid value for "entity_watchlist_screening_id", entity_watchlist_screening_id cannot be nil.') - end - - if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @entity_watchlist_screening_id.nil? - return false if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if !client_user_id.nil? && client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - entity_watchlist_screening_id == o.entity_watchlist_screening_id && - search_terms == o.search_terms && - assignee == o.assignee && - status == o.status && - client_user_id == o.client_user_id && - client_id == o.client_id && - secret == o.secret && - reset_fields == o.reset_fields - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [entity_watchlist_screening_id, search_terms, assignee, status, client_user_id, client_id, secret, reset_fields].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_update_request_resettable_field.rb b/lib/plaid/models/watchlist_screening_entity_update_request_resettable_field.rb deleted file mode 100644 index 31ee13f62..000000000 --- a/lib/plaid/models/watchlist_screening_entity_update_request_resettable_field.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class WatchlistScreeningEntityUpdateRequestResettableField - ASSIGNEE = "assignee".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/watchlist_screening_entity_update_response.rb b/lib/plaid/models/watchlist_screening_entity_update_response.rb deleted file mode 100644 index 0fb03b079..000000000 --- a/lib/plaid/models/watchlist_screening_entity_update_response.rb +++ /dev/null @@ -1,344 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class WatchlistScreeningEntityUpdateResponse - # ID of the associated entity screening. - attr_accessor :id - - attr_accessor :search_terms - - # ID of the associated user. - attr_accessor :assignee - - attr_accessor :status - - # 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`. - attr_accessor :client_user_id - - attr_accessor :audit_trail - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'search_terms' => :'search_terms', - :'assignee' => :'assignee', - :'status' => :'status', - :'client_user_id' => :'client_user_id', - :'audit_trail' => :'audit_trail', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'search_terms' => :'EntityWatchlistScreeningSearchTerms', - :'assignee' => :'String', - :'status' => :'WatchlistScreeningStatus', - :'client_user_id' => :'String', - :'audit_trail' => :'WatchlistScreeningAuditTrail', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'assignee', - :'client_user_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningEntityUpdateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningEntityUpdateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'search_terms') - self.search_terms = attributes[:'search_terms'] - end - - if attributes.key?(:'assignee') - self.assignee = attributes[:'assignee'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @search_terms.nil? - invalid_properties.push('invalid value for "search_terms", search_terms cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @search_terms.nil? - return false if @status.nil? - return false if @client_user_id.to_s.length < 1 - return false if @audit_trail.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - search_terms == o.search_terms && - assignee == o.assignee && - status == o.status && - client_user_id == o.client_user_id && - audit_trail == o.audit_trail && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, search_terms, assignee, status, client_user_id, audit_trail, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_hit.rb b/lib/plaid/models/watchlist_screening_hit.rb deleted file mode 100644 index c6b505c79..000000000 --- a/lib/plaid/models/watchlist_screening_hit.rb +++ /dev/null @@ -1,374 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Data from a government watchlist or PEP list that has been attached to the screening. - class WatchlistScreeningHit - # ID of the associated screening hit. - attr_accessor :id - - attr_accessor :review_status - - # An ISO8601 formatted timestamp. - attr_accessor :first_active - - # An ISO8601 formatted timestamp. - attr_accessor :inactive_since - - # An ISO8601 formatted timestamp. - attr_accessor :historical_since - - attr_accessor :list_code - - # A universal identifier for a watchlist individual that is stable across searches and updates. - attr_accessor :plaid_uid - - # The identifier provided by the source sanction or watchlist. When one is not provided by the source, this is `null`. - attr_accessor :source_uid - - attr_accessor :analysis - - attr_accessor :data - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'review_status' => :'review_status', - :'first_active' => :'first_active', - :'inactive_since' => :'inactive_since', - :'historical_since' => :'historical_since', - :'list_code' => :'list_code', - :'plaid_uid' => :'plaid_uid', - :'source_uid' => :'source_uid', - :'analysis' => :'analysis', - :'data' => :'data' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'review_status' => :'WatchlistScreeningHitStatus', - :'first_active' => :'Time', - :'inactive_since' => :'Time', - :'historical_since' => :'Time', - :'list_code' => :'IndividualWatchlistCode', - :'plaid_uid' => :'String', - :'source_uid' => :'String', - :'analysis' => :'ScreeningHitAnalysis', - :'data' => :'ScreeningHitData' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'inactive_since', - :'historical_since', - :'source_uid', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningHit` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningHit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'review_status') - self.review_status = attributes[:'review_status'] - end - - if attributes.key?(:'first_active') - self.first_active = attributes[:'first_active'] - end - - if attributes.key?(:'inactive_since') - self.inactive_since = attributes[:'inactive_since'] - end - - if attributes.key?(:'historical_since') - self.historical_since = attributes[:'historical_since'] - end - - if attributes.key?(:'list_code') - self.list_code = attributes[:'list_code'] - end - - if attributes.key?(:'plaid_uid') - self.plaid_uid = attributes[:'plaid_uid'] - end - - if attributes.key?(:'source_uid') - self.source_uid = attributes[:'source_uid'] - end - - if attributes.key?(:'analysis') - self.analysis = attributes[:'analysis'] - end - - if attributes.key?(:'data') - self.data = attributes[:'data'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @review_status.nil? - invalid_properties.push('invalid value for "review_status", review_status cannot be nil.') - end - - if @first_active.nil? - invalid_properties.push('invalid value for "first_active", first_active cannot be nil.') - end - - if @list_code.nil? - invalid_properties.push('invalid value for "list_code", list_code cannot be nil.') - end - - if @plaid_uid.nil? - invalid_properties.push('invalid value for "plaid_uid", plaid_uid cannot be nil.') - end - - if @source_uid.to_s.length < 1 - invalid_properties.push('invalid value for "source_uid", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @review_status.nil? - return false if @first_active.nil? - return false if @list_code.nil? - return false if @plaid_uid.nil? - return false if @source_uid.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] source_uid Value to be assigned - def source_uid=(source_uid) - if source_uid.to_s.length < 1 - fail ArgumentError, 'invalid value for "source_uid", the character length must be great than or equal to 1.' - end - - - @source_uid = source_uid - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - review_status == o.review_status && - first_active == o.first_active && - inactive_since == o.inactive_since && - historical_since == o.historical_since && - list_code == o.list_code && - plaid_uid == o.plaid_uid && - source_uid == o.source_uid && - analysis == o.analysis && - data == o.data - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, review_status, first_active, inactive_since, historical_since, list_code, plaid_uid, source_uid, analysis, data].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_hit_locations.rb b/lib/plaid/models/watchlist_screening_hit_locations.rb deleted file mode 100644 index 61dedff31..000000000 --- a/lib/plaid/models/watchlist_screening_hit_locations.rb +++ /dev/null @@ -1,262 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Location information for the associated individual watchlist hit - class WatchlistScreeningHitLocations - # The full location string, potentially including elements like street, city, postal codes and country codes. Note that this is not necessarily a complete or well-formatted address. - attr_accessor :full - - # Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'full' => :'full', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'full' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningHitLocations` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningHitLocations`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'full') - self.full = attributes[:'full'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @full.nil? - invalid_properties.push('invalid value for "full", full cannot be nil.') - end - - if @country.nil? - invalid_properties.push('invalid value for "country", country cannot be nil.') - end - - if @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @full.nil? - return false if @country.nil? - return false if @country.to_s.length < 2 - true - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if country.nil? - fail ArgumentError, 'country cannot be nil' - end - - if country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - full == o.full && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [full, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_hit_status.rb b/lib/plaid/models/watchlist_screening_hit_status.rb deleted file mode 100644 index 74f705b80..000000000 --- a/lib/plaid/models/watchlist_screening_hit_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class WatchlistScreeningHitStatus - CONFIRMED = "confirmed".freeze - PENDING_REVIEW = "pending_review".freeze - DISMISSED = "dismissed".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual.rb b/lib/plaid/models/watchlist_screening_individual.rb deleted file mode 100644 index f18386452..000000000 --- a/lib/plaid/models/watchlist_screening_individual.rb +++ /dev/null @@ -1,329 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class WatchlistScreeningIndividual - # ID of the associated screening. - attr_accessor :id - - attr_accessor :search_terms - - # ID of the associated user. - attr_accessor :assignee - - attr_accessor :status - - # 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`. - attr_accessor :client_user_id - - attr_accessor :audit_trail - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'search_terms' => :'search_terms', - :'assignee' => :'assignee', - :'status' => :'status', - :'client_user_id' => :'client_user_id', - :'audit_trail' => :'audit_trail' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'search_terms' => :'WatchlistScreeningSearchTerms', - :'assignee' => :'String', - :'status' => :'WatchlistScreeningStatus', - :'client_user_id' => :'String', - :'audit_trail' => :'WatchlistScreeningAuditTrail' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'assignee', - :'client_user_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividual` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividual`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'search_terms') - self.search_terms = attributes[:'search_terms'] - end - - if attributes.key?(:'assignee') - self.assignee = attributes[:'assignee'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @search_terms.nil? - invalid_properties.push('invalid value for "search_terms", search_terms cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @search_terms.nil? - return false if @status.nil? - return false if @client_user_id.to_s.length < 1 - return false if @audit_trail.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - search_terms == o.search_terms && - assignee == o.assignee && - status == o.status && - client_user_id == o.client_user_id && - audit_trail == o.audit_trail - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, search_terms, assignee, status, client_user_id, audit_trail].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_create_request.rb b/lib/plaid/models/watchlist_screening_individual_create_request.rb deleted file mode 100644 index 772bf5004..000000000 --- a/lib/plaid/models/watchlist_screening_individual_create_request.rb +++ /dev/null @@ -1,272 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for creating an individual watchlist screening - class WatchlistScreeningIndividualCreateRequest - attr_accessor :search_terms - - # 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`. - attr_accessor :client_user_id - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'search_terms' => :'search_terms', - :'client_user_id' => :'client_user_id', - :'client_id' => :'client_id', - :'secret' => :'secret' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'search_terms' => :'WatchlistScreeningRequestSearchTerms', - :'client_user_id' => :'String', - :'client_id' => :'String', - :'secret' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'search_terms') - self.search_terms = attributes[:'search_terms'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @search_terms.nil? - invalid_properties.push('invalid value for "search_terms", search_terms cannot be nil.') - end - - if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @search_terms.nil? - return false if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if !client_user_id.nil? && client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - search_terms == o.search_terms && - client_user_id == o.client_user_id && - client_id == o.client_id && - secret == o.secret - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [search_terms, client_user_id, client_id, secret].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_create_response.rb b/lib/plaid/models/watchlist_screening_individual_create_response.rb deleted file mode 100644 index 379aa3bbf..000000000 --- a/lib/plaid/models/watchlist_screening_individual_create_response.rb +++ /dev/null @@ -1,344 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class WatchlistScreeningIndividualCreateResponse - # ID of the associated screening. - attr_accessor :id - - attr_accessor :search_terms - - # ID of the associated user. - attr_accessor :assignee - - attr_accessor :status - - # 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`. - attr_accessor :client_user_id - - attr_accessor :audit_trail - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'search_terms' => :'search_terms', - :'assignee' => :'assignee', - :'status' => :'status', - :'client_user_id' => :'client_user_id', - :'audit_trail' => :'audit_trail', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'search_terms' => :'WatchlistScreeningSearchTerms', - :'assignee' => :'String', - :'status' => :'WatchlistScreeningStatus', - :'client_user_id' => :'String', - :'audit_trail' => :'WatchlistScreeningAuditTrail', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'assignee', - :'client_user_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'search_terms') - self.search_terms = attributes[:'search_terms'] - end - - if attributes.key?(:'assignee') - self.assignee = attributes[:'assignee'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @search_terms.nil? - invalid_properties.push('invalid value for "search_terms", search_terms cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @search_terms.nil? - return false if @status.nil? - return false if @client_user_id.to_s.length < 1 - return false if @audit_trail.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - search_terms == o.search_terms && - assignee == o.assignee && - status == o.status && - client_user_id == o.client_user_id && - audit_trail == o.audit_trail && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, search_terms, assignee, status, client_user_id, audit_trail, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_get_request.rb b/lib/plaid/models/watchlist_screening_individual_get_request.rb deleted file mode 100644 index 9a9a4532e..000000000 --- a/lib/plaid/models/watchlist_screening_individual_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for fetching an individual watchlist screening - class WatchlistScreeningIndividualGetRequest - # ID of the associated screening. - attr_accessor :watchlist_screening_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'watchlist_screening_id' => :'watchlist_screening_id', - :'secret' => :'secret', - :'client_id' => :'client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'watchlist_screening_id' => :'String', - :'secret' => :'String', - :'client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'watchlist_screening_id') - self.watchlist_screening_id = attributes[:'watchlist_screening_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @watchlist_screening_id.nil? - invalid_properties.push('invalid value for "watchlist_screening_id", watchlist_screening_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @watchlist_screening_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - watchlist_screening_id == o.watchlist_screening_id && - secret == o.secret && - client_id == o.client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [watchlist_screening_id, secret, client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_get_response.rb b/lib/plaid/models/watchlist_screening_individual_get_response.rb deleted file mode 100644 index 33118cfcf..000000000 --- a/lib/plaid/models/watchlist_screening_individual_get_response.rb +++ /dev/null @@ -1,344 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class WatchlistScreeningIndividualGetResponse - # ID of the associated screening. - attr_accessor :id - - attr_accessor :search_terms - - # ID of the associated user. - attr_accessor :assignee - - attr_accessor :status - - # 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`. - attr_accessor :client_user_id - - attr_accessor :audit_trail - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'search_terms' => :'search_terms', - :'assignee' => :'assignee', - :'status' => :'status', - :'client_user_id' => :'client_user_id', - :'audit_trail' => :'audit_trail', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'search_terms' => :'WatchlistScreeningSearchTerms', - :'assignee' => :'String', - :'status' => :'WatchlistScreeningStatus', - :'client_user_id' => :'String', - :'audit_trail' => :'WatchlistScreeningAuditTrail', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'assignee', - :'client_user_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'search_terms') - self.search_terms = attributes[:'search_terms'] - end - - if attributes.key?(:'assignee') - self.assignee = attributes[:'assignee'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @search_terms.nil? - invalid_properties.push('invalid value for "search_terms", search_terms cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @search_terms.nil? - return false if @status.nil? - return false if @client_user_id.to_s.length < 1 - return false if @audit_trail.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - search_terms == o.search_terms && - assignee == o.assignee && - status == o.status && - client_user_id == o.client_user_id && - audit_trail == o.audit_trail && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, search_terms, assignee, status, client_user_id, audit_trail, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_history_list_request.rb b/lib/plaid/models/watchlist_screening_individual_history_list_request.rb deleted file mode 100644 index 0a4e90995..000000000 --- a/lib/plaid/models/watchlist_screening_individual_history_list_request.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for listing changes to watchlist screenings for individuals - class WatchlistScreeningIndividualHistoryListRequest - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # ID of the associated screening. - attr_accessor :watchlist_screening_id - - # An identifier that determines which page of results you receive. - attr_accessor :cursor - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'secret' => :'secret', - :'client_id' => :'client_id', - :'watchlist_screening_id' => :'watchlist_screening_id', - :'cursor' => :'cursor' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'secret' => :'String', - :'client_id' => :'String', - :'watchlist_screening_id' => :'String', - :'cursor' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'cursor' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualHistoryListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualHistoryListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'watchlist_screening_id') - self.watchlist_screening_id = attributes[:'watchlist_screening_id'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @watchlist_screening_id.nil? - invalid_properties.push('invalid value for "watchlist_screening_id", watchlist_screening_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @watchlist_screening_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - secret == o.secret && - client_id == o.client_id && - watchlist_screening_id == o.watchlist_screening_id && - cursor == o.cursor - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [secret, client_id, watchlist_screening_id, cursor].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_history_list_response.rb b/lib/plaid/models/watchlist_screening_individual_history_list_response.rb deleted file mode 100644 index 10bcd66b9..000000000 --- a/lib/plaid/models/watchlist_screening_individual_history_list_response.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Paginated list of individual watchlist screenings. - class WatchlistScreeningIndividualHistoryListResponse - # List of individual watchlist screenings - attr_accessor :watchlist_screenings - - # An identifier that determines which page of results you receive. - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'watchlist_screenings' => :'watchlist_screenings', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'watchlist_screenings' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualHistoryListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualHistoryListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'watchlist_screenings') - if (value = attributes[:'watchlist_screenings']).is_a?(Array) - self.watchlist_screenings = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @watchlist_screenings.nil? - invalid_properties.push('invalid value for "watchlist_screenings", watchlist_screenings cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @watchlist_screenings.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - watchlist_screenings == o.watchlist_screenings && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [watchlist_screenings, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_hit_list_request.rb b/lib/plaid/models/watchlist_screening_individual_hit_list_request.rb deleted file mode 100644 index ebac85cac..000000000 --- a/lib/plaid/models/watchlist_screening_individual_hit_list_request.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for listing hits for an individual watchlist screening - class WatchlistScreeningIndividualHitListRequest - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # ID of the associated screening. - attr_accessor :watchlist_screening_id - - # An identifier that determines which page of results you receive. - attr_accessor :cursor - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'secret' => :'secret', - :'client_id' => :'client_id', - :'watchlist_screening_id' => :'watchlist_screening_id', - :'cursor' => :'cursor' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'secret' => :'String', - :'client_id' => :'String', - :'watchlist_screening_id' => :'String', - :'cursor' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'cursor' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualHitListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualHitListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'watchlist_screening_id') - self.watchlist_screening_id = attributes[:'watchlist_screening_id'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @watchlist_screening_id.nil? - invalid_properties.push('invalid value for "watchlist_screening_id", watchlist_screening_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @watchlist_screening_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - secret == o.secret && - client_id == o.client_id && - watchlist_screening_id == o.watchlist_screening_id && - cursor == o.cursor - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [secret, client_id, watchlist_screening_id, cursor].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_hit_list_response.rb b/lib/plaid/models/watchlist_screening_individual_hit_list_response.rb deleted file mode 100644 index 3bfe68708..000000000 --- a/lib/plaid/models/watchlist_screening_individual_hit_list_response.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Paginated list of individual watchlist screening hits - class WatchlistScreeningIndividualHitListResponse - # List of individual watchlist screening hits - attr_accessor :watchlist_screening_hits - - # An identifier that determines which page of results you receive. - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'watchlist_screening_hits' => :'watchlist_screening_hits', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'watchlist_screening_hits' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualHitListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualHitListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'watchlist_screening_hits') - if (value = attributes[:'watchlist_screening_hits']).is_a?(Array) - self.watchlist_screening_hits = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @watchlist_screening_hits.nil? - invalid_properties.push('invalid value for "watchlist_screening_hits", watchlist_screening_hits cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @watchlist_screening_hits.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - watchlist_screening_hits == o.watchlist_screening_hits && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [watchlist_screening_hits, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_list_request.rb b/lib/plaid/models/watchlist_screening_individual_list_request.rb deleted file mode 100644 index 6e514bfe0..000000000 --- a/lib/plaid/models/watchlist_screening_individual_list_request.rb +++ /dev/null @@ -1,325 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for listinging watchlist screenings for individuals - class WatchlistScreeningIndividualListRequest - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # ID of the associated program. - attr_accessor :watchlist_program_id - - # 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`. - attr_accessor :client_user_id - - attr_accessor :status - - # ID of the associated user. - attr_accessor :assignee - - # An identifier that determines which page of results you receive. - attr_accessor :cursor - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'secret' => :'secret', - :'client_id' => :'client_id', - :'watchlist_program_id' => :'watchlist_program_id', - :'client_user_id' => :'client_user_id', - :'status' => :'status', - :'assignee' => :'assignee', - :'cursor' => :'cursor' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'secret' => :'String', - :'client_id' => :'String', - :'watchlist_program_id' => :'String', - :'client_user_id' => :'String', - :'status' => :'WatchlistScreeningStatus', - :'assignee' => :'String', - :'cursor' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'cursor' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'watchlist_program_id') - self.watchlist_program_id = attributes[:'watchlist_program_id'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'assignee') - self.assignee = attributes[:'assignee'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @watchlist_program_id.nil? - invalid_properties.push('invalid value for "watchlist_program_id", watchlist_program_id cannot be nil.') - end - - if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @watchlist_program_id.nil? - return false if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if !client_user_id.nil? && client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - secret == o.secret && - client_id == o.client_id && - watchlist_program_id == o.watchlist_program_id && - client_user_id == o.client_user_id && - status == o.status && - assignee == o.assignee && - cursor == o.cursor - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [secret, client_id, watchlist_program_id, client_user_id, status, assignee, cursor].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_list_response.rb b/lib/plaid/models/watchlist_screening_individual_list_response.rb deleted file mode 100644 index c380c697e..000000000 --- a/lib/plaid/models/watchlist_screening_individual_list_response.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Paginated list of individual watchlist screenings. - class WatchlistScreeningIndividualListResponse - # List of individual watchlist screenings - attr_accessor :watchlist_screenings - - # An identifier that determines which page of results you receive. - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'watchlist_screenings' => :'watchlist_screenings', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'watchlist_screenings' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'watchlist_screenings') - if (value = attributes[:'watchlist_screenings']).is_a?(Array) - self.watchlist_screenings = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @watchlist_screenings.nil? - invalid_properties.push('invalid value for "watchlist_screenings", watchlist_screenings cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @watchlist_screenings.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - watchlist_screenings == o.watchlist_screenings && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [watchlist_screenings, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_program_get_request.rb b/lib/plaid/models/watchlist_screening_individual_program_get_request.rb deleted file mode 100644 index ca4e9ebd3..000000000 --- a/lib/plaid/models/watchlist_screening_individual_program_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for fetching an individual watchlist program - class WatchlistScreeningIndividualProgramGetRequest - # ID of the associated program. - attr_accessor :watchlist_program_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'watchlist_program_id' => :'watchlist_program_id', - :'secret' => :'secret', - :'client_id' => :'client_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'watchlist_program_id' => :'String', - :'secret' => :'String', - :'client_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualProgramGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualProgramGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'watchlist_program_id') - self.watchlist_program_id = attributes[:'watchlist_program_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @watchlist_program_id.nil? - invalid_properties.push('invalid value for "watchlist_program_id", watchlist_program_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @watchlist_program_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - watchlist_program_id == o.watchlist_program_id && - secret == o.secret && - client_id == o.client_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [watchlist_program_id, secret, client_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_program_get_response.rb b/lib/plaid/models/watchlist_screening_individual_program_get_response.rb deleted file mode 100644 index a295f1558..000000000 --- a/lib/plaid/models/watchlist_screening_individual_program_get_response.rb +++ /dev/null @@ -1,401 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # A program that configures the active lists, search parameters, and other behavior for initial and ongoing screening of individuals. - class WatchlistScreeningIndividualProgramGetResponse - # ID of the associated program. - attr_accessor :id - - # An ISO8601 formatted timestamp. - attr_accessor :created_at - - # Indicator specifying whether the program is enabled and will perform daily rescans. - attr_accessor :is_rescanning_enabled - - # Watchlists enabled for the associated program - attr_accessor :lists_enabled - - # A name for the program to define its purpose. For example, \"High Risk Individuals\", \"US Cardholders\", or \"Applicants\". - attr_accessor :name - - attr_accessor :name_sensitivity - - attr_accessor :audit_trail - - # Archived programs are read-only and cannot screen new customers nor participate in ongoing monitoring. - attr_accessor :is_archived - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'created_at' => :'created_at', - :'is_rescanning_enabled' => :'is_rescanning_enabled', - :'lists_enabled' => :'lists_enabled', - :'name' => :'name', - :'name_sensitivity' => :'name_sensitivity', - :'audit_trail' => :'audit_trail', - :'is_archived' => :'is_archived', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'created_at' => :'Time', - :'is_rescanning_enabled' => :'Boolean', - :'lists_enabled' => :'Array', - :'name' => :'String', - :'name_sensitivity' => :'ProgramNameSensitivity', - :'audit_trail' => :'WatchlistScreeningAuditTrail', - :'is_archived' => :'Boolean', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualProgramGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualProgramGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] - end - - if attributes.key?(:'is_rescanning_enabled') - self.is_rescanning_enabled = attributes[:'is_rescanning_enabled'] - end - - if attributes.key?(:'lists_enabled') - if (value = attributes[:'lists_enabled']).is_a?(Array) - self.lists_enabled = value - end - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'name_sensitivity') - self.name_sensitivity = attributes[:'name_sensitivity'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'is_archived') - self.is_archived = attributes[:'is_archived'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @created_at.nil? - invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') - end - - if @is_rescanning_enabled.nil? - invalid_properties.push('invalid value for "is_rescanning_enabled", is_rescanning_enabled cannot be nil.') - end - - if @lists_enabled.nil? - invalid_properties.push('invalid value for "lists_enabled", lists_enabled cannot be nil.') - end - - - if @name.nil? - invalid_properties.push('invalid value for "name", name cannot be nil.') - end - - if @name.to_s.length < 1 - invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.') - end - - - if @name_sensitivity.nil? - invalid_properties.push('invalid value for "name_sensitivity", name_sensitivity cannot be nil.') - end - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @is_archived.nil? - invalid_properties.push('invalid value for "is_archived", is_archived cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @created_at.nil? - return false if @is_rescanning_enabled.nil? - return false if @lists_enabled.nil? - return false if @name.nil? - return false if @name.to_s.length < 1 - return false if @name_sensitivity.nil? - return false if @audit_trail.nil? - return false if @is_archived.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] lists_enabled Value to be assigned - def lists_enabled=(lists_enabled) - if lists_enabled.nil? - fail ArgumentError, 'lists_enabled cannot be nil' - end - - - @lists_enabled = lists_enabled - end - - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if name.nil? - fail ArgumentError, 'name cannot be nil' - end - - if name.to_s.length < 1 - fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' - end - - - @name = name - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - created_at == o.created_at && - is_rescanning_enabled == o.is_rescanning_enabled && - lists_enabled == o.lists_enabled && - name == o.name && - name_sensitivity == o.name_sensitivity && - audit_trail == o.audit_trail && - is_archived == o.is_archived && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, created_at, is_rescanning_enabled, lists_enabled, name, name_sensitivity, audit_trail, is_archived, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_program_list_request.rb b/lib/plaid/models/watchlist_screening_individual_program_list_request.rb deleted file mode 100644 index b0d0e12b5..000000000 --- a/lib/plaid/models/watchlist_screening_individual_program_list_request.rb +++ /dev/null @@ -1,242 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for listing watchlist screening programs for individuals - class WatchlistScreeningIndividualProgramListRequest - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # An identifier that determines which page of results you receive. - attr_accessor :cursor - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'secret' => :'secret', - :'client_id' => :'client_id', - :'cursor' => :'cursor' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'secret' => :'String', - :'client_id' => :'String', - :'cursor' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'cursor' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualProgramListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualProgramListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - secret == o.secret && - client_id == o.client_id && - cursor == o.cursor - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [secret, client_id, cursor].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_program_list_response.rb b/lib/plaid/models/watchlist_screening_individual_program_list_response.rb deleted file mode 100644 index 4c39a4904..000000000 --- a/lib/plaid/models/watchlist_screening_individual_program_list_response.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Paginated list of individual watchlist screening programs - class WatchlistScreeningIndividualProgramListResponse - # List of individual watchlist screening programs - attr_accessor :watchlist_programs - - # An identifier that determines which page of results you receive. - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'watchlist_programs' => :'watchlist_programs', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'watchlist_programs' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualProgramListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualProgramListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'watchlist_programs') - if (value = attributes[:'watchlist_programs']).is_a?(Array) - self.watchlist_programs = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @watchlist_programs.nil? - invalid_properties.push('invalid value for "watchlist_programs", watchlist_programs cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @watchlist_programs.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - watchlist_programs == o.watchlist_programs && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [watchlist_programs, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_review_create_request.rb b/lib/plaid/models/watchlist_screening_individual_review_create_request.rb deleted file mode 100644 index c414031b3..000000000 --- a/lib/plaid/models/watchlist_screening_individual_review_create_request.rb +++ /dev/null @@ -1,308 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for creating a screening review - class WatchlistScreeningIndividualReviewCreateRequest - # Hits to mark as a true positive after thorough manual review. These hits will never recur or be updated once dismissed. In most cases, confirmed hits indicate that the customer should be rejected. - attr_accessor :confirmed_hits - - # Hits to mark as a false positive after thorough manual review. These hits will never recur or be updated once dismissed. - attr_accessor :dismissed_hits - - # A comment submitted by a team member as part of reviewing a watchlist screening. - attr_accessor :comment - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # ID of the associated screening. - attr_accessor :watchlist_screening_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'confirmed_hits' => :'confirmed_hits', - :'dismissed_hits' => :'dismissed_hits', - :'comment' => :'comment', - :'client_id' => :'client_id', - :'secret' => :'secret', - :'watchlist_screening_id' => :'watchlist_screening_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'confirmed_hits' => :'Array', - :'dismissed_hits' => :'Array', - :'comment' => :'String', - :'client_id' => :'String', - :'secret' => :'String', - :'watchlist_screening_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'comment', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualReviewCreateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualReviewCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'confirmed_hits') - if (value = attributes[:'confirmed_hits']).is_a?(Array) - self.confirmed_hits = value - end - end - - if attributes.key?(:'dismissed_hits') - if (value = attributes[:'dismissed_hits']).is_a?(Array) - self.dismissed_hits = value - end - end - - if attributes.key?(:'comment') - self.comment = attributes[:'comment'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'watchlist_screening_id') - self.watchlist_screening_id = attributes[:'watchlist_screening_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @confirmed_hits.nil? - invalid_properties.push('invalid value for "confirmed_hits", confirmed_hits cannot be nil.') - end - - if @dismissed_hits.nil? - invalid_properties.push('invalid value for "dismissed_hits", dismissed_hits cannot be nil.') - end - - if !@comment.nil? && @comment.to_s.length < 1 - invalid_properties.push('invalid value for "comment", the character length must be great than or equal to 1.') - end - - - if @watchlist_screening_id.nil? - invalid_properties.push('invalid value for "watchlist_screening_id", watchlist_screening_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @confirmed_hits.nil? - return false if @dismissed_hits.nil? - return false if !@comment.nil? && @comment.to_s.length < 1 - return false if @watchlist_screening_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] comment Value to be assigned - def comment=(comment) - if !comment.nil? && comment.to_s.length < 1 - fail ArgumentError, 'invalid value for "comment", the character length must be great than or equal to 1.' - end - - - @comment = comment - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - confirmed_hits == o.confirmed_hits && - dismissed_hits == o.dismissed_hits && - comment == o.comment && - client_id == o.client_id && - secret == o.secret && - watchlist_screening_id == o.watchlist_screening_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [confirmed_hits, dismissed_hits, comment, client_id, secret, watchlist_screening_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_review_create_response.rb b/lib/plaid/models/watchlist_screening_individual_review_create_response.rb deleted file mode 100644 index c518d1b36..000000000 --- a/lib/plaid/models/watchlist_screening_individual_review_create_response.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class WatchlistScreeningIndividualReviewCreateResponse - # ID of the associated review. - attr_accessor :id - - # Hits marked as a true positive after thorough manual review. These hits will never recur or be updated once dismissed. In most cases, confirmed hits indicate that the customer should be rejected. - attr_accessor :confirmed_hits - - # Hits marked as a false positive after thorough manual review. These hits will never recur or be updated once dismissed. - attr_accessor :dismissed_hits - - # A comment submitted by a team member as part of reviewing a watchlist screening. - attr_accessor :comment - - attr_accessor :audit_trail - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'confirmed_hits' => :'confirmed_hits', - :'dismissed_hits' => :'dismissed_hits', - :'comment' => :'comment', - :'audit_trail' => :'audit_trail', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'confirmed_hits' => :'Array', - :'dismissed_hits' => :'Array', - :'comment' => :'String', - :'audit_trail' => :'WatchlistScreeningAuditTrail', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'comment', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualReviewCreateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualReviewCreateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'confirmed_hits') - if (value = attributes[:'confirmed_hits']).is_a?(Array) - self.confirmed_hits = value - end - end - - if attributes.key?(:'dismissed_hits') - if (value = attributes[:'dismissed_hits']).is_a?(Array) - self.dismissed_hits = value - end - end - - if attributes.key?(:'comment') - self.comment = attributes[:'comment'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @confirmed_hits.nil? - invalid_properties.push('invalid value for "confirmed_hits", confirmed_hits cannot be nil.') - end - - if @dismissed_hits.nil? - invalid_properties.push('invalid value for "dismissed_hits", dismissed_hits cannot be nil.') - end - - if @comment.to_s.length < 1 - invalid_properties.push('invalid value for "comment", the character length must be great than or equal to 1.') - end - - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @confirmed_hits.nil? - return false if @dismissed_hits.nil? - return false if @comment.to_s.length < 1 - return false if @audit_trail.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] comment Value to be assigned - def comment=(comment) - if comment.to_s.length < 1 - fail ArgumentError, 'invalid value for "comment", the character length must be great than or equal to 1.' - end - - - @comment = comment - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - confirmed_hits == o.confirmed_hits && - dismissed_hits == o.dismissed_hits && - comment == o.comment && - audit_trail == o.audit_trail && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, confirmed_hits, dismissed_hits, comment, audit_trail, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_review_list_request.rb b/lib/plaid/models/watchlist_screening_individual_review_list_request.rb deleted file mode 100644 index d586af84b..000000000 --- a/lib/plaid/models/watchlist_screening_individual_review_list_request.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for listing reviews for an individual watchlist screening - class WatchlistScreeningIndividualReviewListRequest - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # ID of the associated screening. - attr_accessor :watchlist_screening_id - - # An identifier that determines which page of results you receive. - attr_accessor :cursor - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'secret' => :'secret', - :'client_id' => :'client_id', - :'watchlist_screening_id' => :'watchlist_screening_id', - :'cursor' => :'cursor' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'secret' => :'String', - :'client_id' => :'String', - :'watchlist_screening_id' => :'String', - :'cursor' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'cursor' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualReviewListRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualReviewListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'watchlist_screening_id') - self.watchlist_screening_id = attributes[:'watchlist_screening_id'] - end - - if attributes.key?(:'cursor') - self.cursor = attributes[:'cursor'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @watchlist_screening_id.nil? - invalid_properties.push('invalid value for "watchlist_screening_id", watchlist_screening_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @watchlist_screening_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - secret == o.secret && - client_id == o.client_id && - watchlist_screening_id == o.watchlist_screening_id && - cursor == o.cursor - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [secret, client_id, watchlist_screening_id, cursor].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_review_list_response.rb b/lib/plaid/models/watchlist_screening_individual_review_list_response.rb deleted file mode 100644 index 5bd68d7d6..000000000 --- a/lib/plaid/models/watchlist_screening_individual_review_list_response.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Paginated list of screening reviews - class WatchlistScreeningIndividualReviewListResponse - # List of screening reviews - attr_accessor :watchlist_screening_reviews - - # An identifier that determines which page of results you receive. - attr_accessor :next_cursor - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'watchlist_screening_reviews' => :'watchlist_screening_reviews', - :'next_cursor' => :'next_cursor', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'watchlist_screening_reviews' => :'Array', - :'next_cursor' => :'String', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'next_cursor', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualReviewListResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualReviewListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'watchlist_screening_reviews') - if (value = attributes[:'watchlist_screening_reviews']).is_a?(Array) - self.watchlist_screening_reviews = value - end - end - - if attributes.key?(:'next_cursor') - self.next_cursor = attributes[:'next_cursor'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @watchlist_screening_reviews.nil? - invalid_properties.push('invalid value for "watchlist_screening_reviews", watchlist_screening_reviews cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @watchlist_screening_reviews.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - watchlist_screening_reviews == o.watchlist_screening_reviews && - next_cursor == o.next_cursor && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [watchlist_screening_reviews, next_cursor, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_update_request.rb b/lib/plaid/models/watchlist_screening_individual_update_request.rb deleted file mode 100644 index 61eaf16c0..000000000 --- a/lib/plaid/models/watchlist_screening_individual_update_request.rb +++ /dev/null @@ -1,337 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Request input for editing an individual watchlist screening - class WatchlistScreeningIndividualUpdateRequest - # ID of the associated screening. - attr_accessor :watchlist_screening_id - - attr_accessor :search_terms - - # ID of the associated user. - attr_accessor :assignee - - attr_accessor :status - - # 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`. - attr_accessor :client_user_id - - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # A list of fields to reset back to null - attr_accessor :reset_fields - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'watchlist_screening_id' => :'watchlist_screening_id', - :'search_terms' => :'search_terms', - :'assignee' => :'assignee', - :'status' => :'status', - :'client_user_id' => :'client_user_id', - :'client_id' => :'client_id', - :'secret' => :'secret', - :'reset_fields' => :'reset_fields' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'watchlist_screening_id' => :'String', - :'search_terms' => :'UpdateIndividualScreeningRequestSearchTerms', - :'assignee' => :'String', - :'status' => :'WatchlistScreeningStatus', - :'client_user_id' => :'String', - :'client_id' => :'String', - :'secret' => :'String', - :'reset_fields' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'search_terms', - :'reset_fields' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualUpdateRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'watchlist_screening_id') - self.watchlist_screening_id = attributes[:'watchlist_screening_id'] - end - - if attributes.key?(:'search_terms') - self.search_terms = attributes[:'search_terms'] - end - - if attributes.key?(:'assignee') - self.assignee = attributes[:'assignee'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'reset_fields') - if (value = attributes[:'reset_fields']).is_a?(Array) - self.reset_fields = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @watchlist_screening_id.nil? - invalid_properties.push('invalid value for "watchlist_screening_id", watchlist_screening_id cannot be nil.') - end - - if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @watchlist_screening_id.nil? - return false if !@client_user_id.nil? && @client_user_id.to_s.length < 1 - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if !client_user_id.nil? && client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - watchlist_screening_id == o.watchlist_screening_id && - search_terms == o.search_terms && - assignee == o.assignee && - status == o.status && - client_user_id == o.client_user_id && - client_id == o.client_id && - secret == o.secret && - reset_fields == o.reset_fields - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [watchlist_screening_id, search_terms, assignee, status, client_user_id, client_id, secret, reset_fields].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_update_request_resettable_field.rb b/lib/plaid/models/watchlist_screening_individual_update_request_resettable_field.rb deleted file mode 100644 index 74537ac6b..000000000 --- a/lib/plaid/models/watchlist_screening_individual_update_request_resettable_field.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class WatchlistScreeningIndividualUpdateRequestResettableField - ASSIGNEE = "assignee".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/watchlist_screening_individual_update_response.rb b/lib/plaid/models/watchlist_screening_individual_update_response.rb deleted file mode 100644 index d88c99001..000000000 --- a/lib/plaid/models/watchlist_screening_individual_update_response.rb +++ /dev/null @@ -1,344 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class WatchlistScreeningIndividualUpdateResponse - # ID of the associated screening. - attr_accessor :id - - attr_accessor :search_terms - - # ID of the associated user. - attr_accessor :assignee - - attr_accessor :status - - # 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`. - attr_accessor :client_user_id - - attr_accessor :audit_trail - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'search_terms' => :'search_terms', - :'assignee' => :'assignee', - :'status' => :'status', - :'client_user_id' => :'client_user_id', - :'audit_trail' => :'audit_trail', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'search_terms' => :'WatchlistScreeningSearchTerms', - :'assignee' => :'String', - :'status' => :'WatchlistScreeningStatus', - :'client_user_id' => :'String', - :'audit_trail' => :'WatchlistScreeningAuditTrail', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'assignee', - :'client_user_id', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningIndividualUpdateResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningIndividualUpdateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'search_terms') - self.search_terms = attributes[:'search_terms'] - end - - if attributes.key?(:'assignee') - self.assignee = attributes[:'assignee'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'client_user_id') - self.client_user_id = attributes[:'client_user_id'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @search_terms.nil? - invalid_properties.push('invalid value for "search_terms", search_terms cannot be nil.') - end - - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - if @client_user_id.to_s.length < 1 - invalid_properties.push('invalid value for "client_user_id", the character length must be great than or equal to 1.') - end - - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @search_terms.nil? - return false if @status.nil? - return false if @client_user_id.to_s.length < 1 - return false if @audit_trail.nil? - return false if @request_id.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] client_user_id Value to be assigned - def client_user_id=(client_user_id) - if client_user_id.to_s.length < 1 - fail ArgumentError, 'invalid value for "client_user_id", the character length must be great than or equal to 1.' - end - - - @client_user_id = client_user_id - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - search_terms == o.search_terms && - assignee == o.assignee && - status == o.status && - client_user_id == o.client_user_id && - audit_trail == o.audit_trail && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, search_terms, assignee, status, client_user_id, audit_trail, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_request_search_terms.rb b/lib/plaid/models/watchlist_screening_request_search_terms.rb deleted file mode 100644 index 080f757a7..000000000 --- a/lib/plaid/models/watchlist_screening_request_search_terms.rb +++ /dev/null @@ -1,326 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Search inputs for creating a watchlist screening - class WatchlistScreeningRequestSearchTerms - # ID of the associated program. - attr_accessor :watchlist_program_id - - # The legal name of the individual being screened. - attr_accessor :legal_name - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :date_of_birth - - # The numeric or alphanumeric identifier associated with this document. - attr_accessor :document_number - - # Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :country - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'watchlist_program_id' => :'watchlist_program_id', - :'legal_name' => :'legal_name', - :'date_of_birth' => :'date_of_birth', - :'document_number' => :'document_number', - :'country' => :'country' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'watchlist_program_id' => :'String', - :'legal_name' => :'String', - :'date_of_birth' => :'Date', - :'document_number' => :'String', - :'country' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningRequestSearchTerms` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningRequestSearchTerms`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'watchlist_program_id') - self.watchlist_program_id = attributes[:'watchlist_program_id'] - end - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'document_number') - self.document_number = attributes[:'document_number'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @watchlist_program_id.nil? - invalid_properties.push('invalid value for "watchlist_program_id", watchlist_program_id cannot be nil.') - end - - if @legal_name.nil? - invalid_properties.push('invalid value for "legal_name", legal_name cannot be nil.') - end - - if @legal_name.to_s.length < 1 - invalid_properties.push('invalid value for "legal_name", the character length must be great than or equal to 1.') - end - - - if !@document_number.nil? && @document_number.to_s.length < 4 - invalid_properties.push('invalid value for "document_number", the character length must be great than or equal to 4.') - end - - - if !@country.nil? && @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @watchlist_program_id.nil? - return false if @legal_name.nil? - return false if @legal_name.to_s.length < 1 - return false if !@document_number.nil? && @document_number.to_s.length < 4 - return false if !@country.nil? && @country.to_s.length < 2 - true - end - - # Custom attribute writer method with validation - # @param [Object] legal_name Value to be assigned - def legal_name=(legal_name) - if legal_name.nil? - fail ArgumentError, 'legal_name cannot be nil' - end - - if legal_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "legal_name", the character length must be great than or equal to 1.' - end - - - @legal_name = legal_name - end - - # Custom attribute writer method with validation - # @param [Object] document_number Value to be assigned - def document_number=(document_number) - if !document_number.nil? && document_number.to_s.length < 4 - fail ArgumentError, 'invalid value for "document_number", the character length must be great than or equal to 4.' - end - - - @document_number = document_number - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if !country.nil? && country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - watchlist_program_id == o.watchlist_program_id && - legal_name == o.legal_name && - date_of_birth == o.date_of_birth && - document_number == o.document_number && - country == o.country - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [watchlist_program_id, legal_name, date_of_birth, document_number, country].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_review.rb b/lib/plaid/models/watchlist_screening_review.rb deleted file mode 100644 index 07e13c802..000000000 --- a/lib/plaid/models/watchlist_screening_review.rb +++ /dev/null @@ -1,302 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # 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. - class WatchlistScreeningReview - # ID of the associated review. - attr_accessor :id - - # Hits marked as a true positive after thorough manual review. These hits will never recur or be updated once dismissed. In most cases, confirmed hits indicate that the customer should be rejected. - attr_accessor :confirmed_hits - - # Hits marked as a false positive after thorough manual review. These hits will never recur or be updated once dismissed. - attr_accessor :dismissed_hits - - # A comment submitted by a team member as part of reviewing a watchlist screening. - attr_accessor :comment - - attr_accessor :audit_trail - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'id', - :'confirmed_hits' => :'confirmed_hits', - :'dismissed_hits' => :'dismissed_hits', - :'comment' => :'comment', - :'audit_trail' => :'audit_trail' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'confirmed_hits' => :'Array', - :'dismissed_hits' => :'Array', - :'comment' => :'String', - :'audit_trail' => :'WatchlistScreeningAuditTrail' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'comment', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningReview` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningReview`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'confirmed_hits') - if (value = attributes[:'confirmed_hits']).is_a?(Array) - self.confirmed_hits = value - end - end - - if attributes.key?(:'dismissed_hits') - if (value = attributes[:'dismissed_hits']).is_a?(Array) - self.dismissed_hits = value - end - end - - if attributes.key?(:'comment') - self.comment = attributes[:'comment'] - end - - if attributes.key?(:'audit_trail') - self.audit_trail = attributes[:'audit_trail'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @confirmed_hits.nil? - invalid_properties.push('invalid value for "confirmed_hits", confirmed_hits cannot be nil.') - end - - if @dismissed_hits.nil? - invalid_properties.push('invalid value for "dismissed_hits", dismissed_hits cannot be nil.') - end - - if @comment.to_s.length < 1 - invalid_properties.push('invalid value for "comment", the character length must be great than or equal to 1.') - end - - - if @audit_trail.nil? - invalid_properties.push('invalid value for "audit_trail", audit_trail cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @id.nil? - return false if @confirmed_hits.nil? - return false if @dismissed_hits.nil? - return false if @comment.to_s.length < 1 - return false if @audit_trail.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] comment Value to be assigned - def comment=(comment) - if comment.to_s.length < 1 - fail ArgumentError, 'invalid value for "comment", the character length must be great than or equal to 1.' - end - - - @comment = comment - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - confirmed_hits == o.confirmed_hits && - dismissed_hits == o.dismissed_hits && - comment == o.comment && - audit_trail == o.audit_trail - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, confirmed_hits, dismissed_hits, comment, audit_trail].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_search_terms.rb b/lib/plaid/models/watchlist_screening_search_terms.rb deleted file mode 100644 index 3229ab4b6..000000000 --- a/lib/plaid/models/watchlist_screening_search_terms.rb +++ /dev/null @@ -1,344 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Search terms for creating an individual watchlist screening - class WatchlistScreeningSearchTerms - # ID of the associated program. - attr_accessor :watchlist_program_id - - # The legal name of the individual being screened. - attr_accessor :legal_name - - # A date in the format YYYY-MM-DD (RFC 3339 Section 5.6). - attr_accessor :date_of_birth - - # The numeric or alphanumeric identifier associated with this document. - attr_accessor :document_number - - # Valid, capitalized, two-letter ISO code representing the country of this object. Must be in ISO 3166-1 alpha-2 form. - attr_accessor :country - - # The current version of the search terms. Starts at `1` and increments with each edit to `search_terms`. - attr_accessor :version - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'watchlist_program_id' => :'watchlist_program_id', - :'legal_name' => :'legal_name', - :'date_of_birth' => :'date_of_birth', - :'document_number' => :'document_number', - :'country' => :'country', - :'version' => :'version' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'watchlist_program_id' => :'String', - :'legal_name' => :'String', - :'date_of_birth' => :'Date', - :'document_number' => :'String', - :'country' => :'String', - :'version' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'date_of_birth', - :'document_number', - :'country', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WatchlistScreeningSearchTerms` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WatchlistScreeningSearchTerms`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'watchlist_program_id') - self.watchlist_program_id = attributes[:'watchlist_program_id'] - end - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'date_of_birth') - self.date_of_birth = attributes[:'date_of_birth'] - end - - if attributes.key?(:'document_number') - self.document_number = attributes[:'document_number'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @watchlist_program_id.nil? - invalid_properties.push('invalid value for "watchlist_program_id", watchlist_program_id cannot be nil.') - end - - if @legal_name.nil? - invalid_properties.push('invalid value for "legal_name", legal_name cannot be nil.') - end - - if @legal_name.to_s.length < 1 - invalid_properties.push('invalid value for "legal_name", the character length must be great than or equal to 1.') - end - - - if @document_number.to_s.length < 4 - invalid_properties.push('invalid value for "document_number", the character length must be great than or equal to 4.') - end - - - if @country.to_s.length < 2 - invalid_properties.push('invalid value for "country", the character length must be great than or equal to 2.') - end - - - if @version.nil? - invalid_properties.push('invalid value for "version", version cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @watchlist_program_id.nil? - return false if @legal_name.nil? - return false if @legal_name.to_s.length < 1 - return false if @document_number.to_s.length < 4 - return false if @country.to_s.length < 2 - return false if @version.nil? - true - end - - # Custom attribute writer method with validation - # @param [Object] legal_name Value to be assigned - def legal_name=(legal_name) - if legal_name.nil? - fail ArgumentError, 'legal_name cannot be nil' - end - - if legal_name.to_s.length < 1 - fail ArgumentError, 'invalid value for "legal_name", the character length must be great than or equal to 1.' - end - - - @legal_name = legal_name - end - - # Custom attribute writer method with validation - # @param [Object] document_number Value to be assigned - def document_number=(document_number) - if document_number.to_s.length < 4 - fail ArgumentError, 'invalid value for "document_number", the character length must be great than or equal to 4.' - end - - - @document_number = document_number - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if country.to_s.length < 2 - fail ArgumentError, 'invalid value for "country", the character length must be great than or equal to 2.' - end - - - @country = country - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - watchlist_program_id == o.watchlist_program_id && - legal_name == o.legal_name && - date_of_birth == o.date_of_birth && - document_number == o.document_number && - country == o.country && - version == o.version - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [watchlist_program_id, legal_name, date_of_birth, document_number, country, version].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/watchlist_screening_status.rb b/lib/plaid/models/watchlist_screening_status.rb deleted file mode 100644 index 135767564..000000000 --- a/lib/plaid/models/watchlist_screening_status.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class WatchlistScreeningStatus - REJECTED = "rejected".freeze - PENDING_REVIEW = "pending_review".freeze - CLEARED = "cleared".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/weak_alias_determination.rb b/lib/plaid/models/weak_alias_determination.rb deleted file mode 100644 index 2e9369ec6..000000000 --- a/lib/plaid/models/weak_alias_determination.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class WeakAliasDetermination - NONE = "none".freeze - SOURCE = "source".freeze - PLAID = "plaid".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/webhook_environment_values.rb b/lib/plaid/models/webhook_environment_values.rb deleted file mode 100644 index 7912c974f..000000000 --- a/lib/plaid/models/webhook_environment_values.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class WebhookEnvironmentValues - DEVELOPMENT = "development".freeze - SANDBOX = "sandbox".freeze - PRODUCTION = "production".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/webhook_type.rb b/lib/plaid/models/webhook_type.rb deleted file mode 100644 index c095d2e0d..000000000 --- a/lib/plaid/models/webhook_type.rb +++ /dev/null @@ -1,44 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - class WebhookType - AUTH = "AUTH".freeze - HOLDINGS = "HOLDINGS".freeze - INVESTMENTS_TRANSACTIONS = "INVESTMENTS_TRANSACTIONS".freeze - ITEM = "ITEM".freeze - LIABILITIES = "LIABILITIES".freeze - TRANSACTIONS = "TRANSACTIONS".freeze - ASSETS = "ASSETS".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - # We do not validate that the value is one of the enums set in the OpenAPI - # file because we want to be able to add to our list of enums without - # breaking this client library. - value - end - end - -end diff --git a/lib/plaid/models/webhook_update_acknowledged_webhook.rb b/lib/plaid/models/webhook_update_acknowledged_webhook.rb deleted file mode 100644 index 381a1c75f..000000000 --- a/lib/plaid/models/webhook_update_acknowledged_webhook.rb +++ /dev/null @@ -1,317 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Fired when an Item's webhook is updated. This will be sent to the newly specified webhook. - class WebhookUpdateAcknowledgedWebhook - # `ITEM` - attr_accessor :webhook_type - - # `WEBHOOK_UPDATE_ACKNOWLEDGED` - attr_accessor :webhook_code - - # The `item_id` of the Item associated with this webhook, warning, or error - attr_accessor :item_id - - # The new webhook URL - attr_accessor :new_webhook_url - - attr_accessor :error - - attr_accessor :environment - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'webhook_type' => :'webhook_type', - :'webhook_code' => :'webhook_code', - :'item_id' => :'item_id', - :'new_webhook_url' => :'new_webhook_url', - :'error' => :'error', - :'environment' => :'environment' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'webhook_type' => :'String', - :'webhook_code' => :'String', - :'item_id' => :'String', - :'new_webhook_url' => :'String', - :'error' => :'PlaidError', - :'environment' => :'WebhookEnvironmentValues' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'error', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WebhookUpdateAcknowledgedWebhook` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WebhookUpdateAcknowledgedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'webhook_type') - self.webhook_type = attributes[:'webhook_type'] - end - - if attributes.key?(:'webhook_code') - self.webhook_code = attributes[:'webhook_code'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'new_webhook_url') - self.new_webhook_url = attributes[:'new_webhook_url'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'environment') - self.environment = attributes[:'environment'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @webhook_type.nil? - invalid_properties.push('invalid value for "webhook_type", webhook_type cannot be nil.') - end - - if @webhook_code.nil? - invalid_properties.push('invalid value for "webhook_code", webhook_code cannot be nil.') - end - - if @item_id.nil? - invalid_properties.push('invalid value for "item_id", item_id cannot be nil.') - end - - if @new_webhook_url.nil? - invalid_properties.push('invalid value for "new_webhook_url", new_webhook_url cannot be nil.') - end - - if @environment.nil? - invalid_properties.push('invalid value for "environment", environment cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @webhook_type.nil? - return false if @webhook_code.nil? - return false if @item_id.nil? - return false if @new_webhook_url.nil? - return false if @environment.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - webhook_type == o.webhook_type && - webhook_code == o.webhook_code && - item_id == o.item_id && - new_webhook_url == o.new_webhook_url && - error == o.error && - environment == o.environment - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [webhook_type, webhook_code, item_id, new_webhook_url, error, environment].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/webhook_verification_key_get_request.rb b/lib/plaid/models/webhook_verification_key_get_request.rb deleted file mode 100644 index 79fcc4f79..000000000 --- a/lib/plaid/models/webhook_verification_key_get_request.rb +++ /dev/null @@ -1,246 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # WebhookVerificationKeyGetRequest defines the request schema for `/webhook_verification_key/get` - class WebhookVerificationKeyGetRequest - # Your Plaid API `client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body. - attr_accessor :client_id - - # Your Plaid API `secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body. - attr_accessor :secret - - # The key ID ( `kid` ) from the JWT header. - attr_accessor :key_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'client_id' => :'client_id', - :'secret' => :'secret', - :'key_id' => :'key_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'client_id' => :'String', - :'secret' => :'String', - :'key_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WebhookVerificationKeyGetRequest` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WebhookVerificationKeyGetRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'client_id') - self.client_id = attributes[:'client_id'] - end - - if attributes.key?(:'secret') - self.secret = attributes[:'secret'] - end - - if attributes.key?(:'key_id') - self.key_id = attributes[:'key_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @key_id.nil? - invalid_properties.push('invalid value for "key_id", key_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @key_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - client_id == o.client_id && - secret == o.secret && - key_id == o.key_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [client_id, secret, key_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/webhook_verification_key_get_response.rb b/lib/plaid/models/webhook_verification_key_get_response.rb deleted file mode 100644 index 05ed86081..000000000 --- a/lib/plaid/models/webhook_verification_key_get_response.rb +++ /dev/null @@ -1,240 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # WebhookVerificationKeyGetResponse defines the response schema for `/webhook_verification_key/get` - class WebhookVerificationKeyGetResponse - attr_accessor :key - - # A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive. - attr_accessor :request_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'key' => :'key', - :'request_id' => :'request_id' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'key' => :'JWKPublicKey', - :'request_id' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::WebhookVerificationKeyGetResponse` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::WebhookVerificationKeyGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'key') - self.key = attributes[:'key'] - end - - if attributes.key?(:'request_id') - self.request_id = attributes[:'request_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @key.nil? - invalid_properties.push('invalid value for "key", key cannot be nil.') - end - - if @request_id.nil? - invalid_properties.push('invalid value for "request_id", request_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @key.nil? - return false if @request_id.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - key == o.key && - request_id == o.request_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [key, request_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/ytd_gross_income_summary_field_number.rb b/lib/plaid/models/ytd_gross_income_summary_field_number.rb deleted file mode 100644 index 63628e19a..000000000 --- a/lib/plaid/models/ytd_gross_income_summary_field_number.rb +++ /dev/null @@ -1,269 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Year-to-date pre-tax earnings, as reported on the paystub. - class YTDGrossIncomeSummaryFieldNumber - # The value of the field. - attr_accessor :value - - attr_accessor :verification_status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'verification_status' => :'verification_status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'Float', - :'verification_status' => :'VerificationStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'IncomeSummaryFieldNumber' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::YTDGrossIncomeSummaryFieldNumber` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::YTDGrossIncomeSummaryFieldNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @verification_status.nil? - invalid_properties.push('invalid value for "verification_status", verification_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @value.nil? - return false if @verification_status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - verification_status == o.verification_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, verification_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/models/ytd_net_income_summary_field_number.rb b/lib/plaid/models/ytd_net_income_summary_field_number.rb deleted file mode 100644 index 3634feba2..000000000 --- a/lib/plaid/models/ytd_net_income_summary_field_number.rb +++ /dev/null @@ -1,269 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -require 'date' -require 'time' - -module Plaid - # Year-to-date earnings after any tax withholdings, benefit payments or deductions, as reported on the paystub. - class YTDNetIncomeSummaryFieldNumber - # The value of the field. - attr_accessor :value - - attr_accessor :verification_status - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'value', - :'verification_status' => :'verification_status' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'Float', - :'verification_status' => :'VerificationStatus' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # List of class defined in allOf (OpenAPI v3) - def self.openapi_all_of - [ - :'IncomeSummaryFieldNumber' - ] - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::YTDNetIncomeSummaryFieldNumber` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::YTDNetIncomeSummaryFieldNumber`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'verification_status') - self.verification_status = attributes[:'verification_status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @value.nil? - invalid_properties.push('invalid value for "value", value cannot be nil.') - end - - if @verification_status.nil? - invalid_properties.push('invalid value for "verification_status", verification_status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @value.nil? - return false if @verification_status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - verification_status == o.verification_status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, verification_status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - attributes = attributes.transform_keys(&:to_sym) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Plaid.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/plaid/version.rb b/lib/plaid/version.rb deleted file mode 100644 index 7c3778a35..000000000 --- a/lib/plaid/version.rb +++ /dev/null @@ -1,15 +0,0 @@ -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -module Plaid - VERSION = '25.0.0' -end diff --git a/plaid.gemspec b/plaid.gemspec deleted file mode 100644 index b348457da..000000000 --- a/plaid.gemspec +++ /dev/null @@ -1,45 +0,0 @@ -# -*- encoding: utf-8 -*- - -=begin -#The Plaid API - -#The Plaid REST API. Please see https://plaid.com/docs/api for more details. - -The version of the OpenAPI document: 2020-09-14_1.496.2 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 6.3.0 - -=end - -$:.push File.expand_path("../lib", __FILE__) -require "plaid/version" - -Gem::Specification.new do |s| - s.name = "plaid" - s.version = Plaid::VERSION - s.platform = Gem::Platform::RUBY - s.authors = ["Plaid"] - s.email = [""] - s.homepage = "https://plaid.com" - s.summary = "The Plaid API Ruby Gem" - s.description = "Ruby gem wrapper for the Plaid API. Read more at the homepage, the wiki, or in the Plaid documentation." - s.license = "MIT" - s.required_ruby_version = ">= 3.0.0" - - s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0' - s.add_runtime_dependency 'faraday-multipart', '>= 1.0.1', '< 2.0' - - s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - s.add_development_dependency 'bundler', '~> 2.2.9' - s.add_development_dependency 'dotenv' - s.add_development_dependency 'minitest', '~> 5.14' - s.add_development_dependency 'minitest-around', '~> 0.5.0' - s.add_development_dependency 'rake', '>= 13.0' - s.add_development_dependency 'rubocop', '~> 0.91.0' - - s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } - s.test_files = `find spec/*`.split("\n") - s.executables = [] - s.require_paths = ["lib"] -end diff --git a/test/test_statements.rb b/test/test_statements.rb new file mode 100644 index 000000000..0770bb5e8 --- /dev/null +++ b/test/test_statements.rb @@ -0,0 +1,71 @@ +require_relative "test_helper" +require "date" + +# Internal: The test for Plaid::Statements. +class PlaidStatementsTest < PlaidTest + def test_full_flow # rubocop:disable Metrics/MethodLength + create_item initial_products: [:statements] + + # 1. /statements/list + response = poll_for_statements_list(access_token) + refute_empty(response.accounts) + refute_empty(response.accounts[0].statements) + assert_kind_of(Plaid::StatementsListResponse, response) + + # 2. /statements/download + response.accounts.each do |account| + account.statements.each do |statement| + statements_download_request = Plaid::StatementsDownloadRequest.new + statements_download_request.access_token = access_token + statements_download_request.statement_id = statement.statement_id + + file, status_code, headers = client.statements_download_with_http_info(statements_download_request) + assert_equal(status_code, 200) + assert_equal(headers["content-type"], "application/pdf") + + sha = Digest::SHA2.new + File.open(file.path) do |f| + while chunk = f.read(256) # only load 256 bytes at a time + sha << chunk + end + end + + assert_equal(headers["plaid-content-hash"], sha.hexdigest) + end + end + + # 3. /statements/refresh + statements_refresh_request = Plaid::StatementsRefreshRequest.new + statements_refresh_request.access_token = access_token + statements_refresh_request.start_date = Date.today.prev_year + statements_refresh_request.end_date = Date.today.prev_month(10) + + response = client.statements_refresh(statements_refresh_request) + assert_kind_of(Plaid::StatementsRefreshResponse, response) + refute_empty(response.request_id) + + # 4. /statements/list + response = poll_for_statements_list(access_token) + refute_empty(response.accounts) + refute_empty(response.accounts[0].statements) + assert_kind_of(Plaid::StatementsListResponse, response) + end +end + +def poll_for_statements_list(access_token) + response = nil + 10.times do + begin + statements_list_request = Plaid::StatementsListRequest.new + statements_list_request.access_token = access_token + response = @client.statements_list(statements_list_request) + break + rescue Plaid::ApiError => e + json_response = JSON.parse(e.response_body) + raise e if json_response["error_code"] != "PRODUCT_NOT_READY" + sleep 1 + end + end + assert response, "Timed out while waiting for statements list" + response +end